Skip to content

Commit 9a1d986

Browse files
Databean0405ysj
authored andcommitted
Enforce clang-format on host/libs/metrics
Bug: b/512215781
1 parent 65dab0c commit 9a1d986

2 files changed

Lines changed: 44 additions & 129 deletions

File tree

base/cvd/cuttlefish/host/libs/metrics/BUILD.bazel

Lines changed: 42 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ package(
66

77
cf_cc_library(
88
name = "device_metrics_orchestration",
9-
srcs = [
10-
"device_metrics_orchestration.cc",
11-
],
12-
hdrs = [
13-
"device_metrics_orchestration.h",
14-
],
9+
srcs = ["device_metrics_orchestration.cc"],
10+
hdrs = ["device_metrics_orchestration.h"],
1511
deps = [
1612
"//cuttlefish/common/libs/utils:files",
1713
"//cuttlefish/common/libs/utils:tee_logging",
@@ -31,35 +27,23 @@ cf_cc_library(
3127

3228
cf_cc_library(
3329
name = "enabled",
34-
srcs = [
35-
"enabled.cc",
36-
],
37-
hdrs = [
38-
"enabled.h",
39-
],
30+
srcs = ["enabled.cc"],
31+
hdrs = ["enabled.h"],
4032
deps = [
4133
"//cuttlefish/common/libs/utils:files",
4234
],
4335
)
4436

4537
cf_cc_library(
4638
name = "device_event_type",
47-
srcs = [
48-
"device_event_type.cc",
49-
],
50-
hdrs = [
51-
"device_event_type.h",
52-
],
39+
srcs = ["device_event_type.cc"],
40+
hdrs = ["device_event_type.h"],
5341
)
5442

5543
cf_cc_library(
5644
name = "fetch_metrics",
57-
srcs = [
58-
"fetch_metrics.cc",
59-
],
60-
hdrs = [
61-
"fetch_metrics.h",
62-
],
45+
srcs = ["fetch_metrics.cc"],
46+
hdrs = ["fetch_metrics.h"],
6347
deps = [
6448
"//cuttlefish/host/commands/cvd/fetch:builds",
6549
"//cuttlefish/host/commands/cvd/fetch:fetch_cvd",
@@ -70,12 +54,8 @@ cf_cc_library(
7054

7155
cf_cc_library(
7256
name = "fetch_metrics_orchestration",
73-
srcs = [
74-
"fetch_metrics_orchestration.cc",
75-
],
76-
hdrs = [
77-
"fetch_metrics_orchestration.h",
78-
],
57+
srcs = ["fetch_metrics_orchestration.cc"],
58+
hdrs = ["fetch_metrics_orchestration.h"],
7959
deps = [
8060
"//cuttlefish/common/libs/utils:files",
8161
"//cuttlefish/common/libs/utils:tee_logging",
@@ -93,12 +73,8 @@ cf_cc_library(
9373

9474
cf_cc_library(
9575
name = "flag_metrics",
96-
srcs = [
97-
"flag_metrics.cc",
98-
],
99-
hdrs = [
100-
"flag_metrics.h",
101-
],
76+
srcs = ["flag_metrics.cc"],
77+
hdrs = ["flag_metrics.h"],
10278
deps = [
10379
"//cuttlefish/host/libs/config:data_image_policy",
10480
"//cuttlefish/host/libs/config:gpu_mode",
@@ -109,12 +85,8 @@ cf_cc_library(
10985

11086
cf_cc_library(
11187
name = "gce_environment",
112-
srcs = [
113-
"gce_environment.cc",
114-
],
115-
hdrs = [
116-
"gce_environment.h",
117-
],
88+
srcs = ["gce_environment.cc"],
89+
hdrs = ["gce_environment.h"],
11890
deps = [
11991
"//cuttlefish/host/libs/web/http_client",
12092
"//cuttlefish/host/libs/web/http_client:curl_global_init",
@@ -128,25 +100,15 @@ cf_cc_library(
128100

129101
cf_cc_library(
130102
name = "github_environment",
131-
srcs = [
132-
"github_environment.cc",
133-
],
134-
hdrs = [
135-
"github_environment.h",
136-
],
137-
deps = [
138-
"//cuttlefish/common/libs/utils:environment",
139-
],
103+
srcs = ["github_environment.cc"],
104+
hdrs = ["github_environment.h"],
105+
deps = ["//cuttlefish/common/libs/utils:environment"],
140106
)
141107

142108
cf_cc_library(
143109
name = "guest_metrics",
144-
srcs = [
145-
"guest_metrics.cc",
146-
],
147-
hdrs = [
148-
"guest_metrics.h",
149-
],
110+
srcs = ["guest_metrics.cc"],
111+
hdrs = ["guest_metrics.h"],
150112
deps = [
151113
"//cuttlefish/host/commands/assemble_cvd:boot_image_utils",
152114
"//cuttlefish/host/libs/metrics:device_event_type",
@@ -159,12 +121,8 @@ cf_cc_library(
159121

160122
cf_cc_library(
161123
name = "host_metrics",
162-
srcs = [
163-
"host_metrics.cc",
164-
],
165-
hdrs = [
166-
"host_metrics.h",
167-
],
124+
srcs = ["host_metrics.cc"],
125+
hdrs = ["host_metrics.h"],
168126
deps = [
169127
"//cuttlefish/common/libs/utils:host_info",
170128
"//cuttlefish/host/libs/metrics:gce_environment",
@@ -176,26 +134,15 @@ cf_cc_library(
176134

177135
cf_cc_library(
178136
name = "invoker",
179-
srcs = [
180-
"invoker.cc",
181-
],
182-
hdrs = [
183-
"invoker.h",
184-
],
185-
deps = [
186-
"//cuttlefish/common/libs/utils:environment",
187-
],
137+
srcs = ["invoker.cc"],
138+
hdrs = ["invoker.h"],
139+
deps = ["//cuttlefish/common/libs/utils:environment"],
188140
)
189141

190142
cf_cc_library(
191143
name = "metrics",
192-
srcs = [
193-
"metrics_receiver.cc",
194-
],
195-
hdrs = [
196-
"metrics_receiver.h",
197-
],
198-
clang_format_enabled = False,
144+
srcs = ["metrics_receiver.cc"],
145+
hdrs = ["metrics_receiver.h"],
199146
deps = [
200147
":metrics_headers",
201148
"//cuttlefish/common/libs/fs",
@@ -212,12 +159,8 @@ cf_cc_library(
212159

213160
cf_cc_library(
214161
name = "metrics_conversion",
215-
srcs = [
216-
"metrics_conversion.cc",
217-
],
218-
hdrs = [
219-
"metrics_conversion.h",
220-
],
162+
srcs = ["metrics_conversion.cc"],
163+
hdrs = ["metrics_conversion.h"],
221164
deps = [
222165
"//cuttlefish/common/libs/utils:host_info",
223166
"//cuttlefish/host/commands/cvd/fetch:builds",
@@ -251,12 +194,8 @@ cf_cc_library(
251194

252195
cf_cc_library(
253196
name = "metrics_environment",
254-
srcs = [
255-
"metrics_environment.cc",
256-
],
257-
hdrs = [
258-
"metrics_environment.h",
259-
],
197+
srcs = ["metrics_environment.cc"],
198+
hdrs = ["metrics_environment.h"],
260199
)
261200

262201
cf_cc_library(
@@ -269,12 +208,8 @@ cf_cc_library(
269208

270209
cf_cc_library(
271210
name = "metrics_orchestration",
272-
srcs = [
273-
"metrics_orchestration.cc",
274-
],
275-
hdrs = [
276-
"metrics_orchestration.h",
277-
],
211+
srcs = ["metrics_orchestration.cc"],
212+
hdrs = ["metrics_orchestration.h"],
278213
deps = [
279214
"//cuttlefish/common/libs/utils:files",
280215
"//cuttlefish/common/libs/utils:tee_logging",
@@ -295,12 +230,8 @@ cf_cc_library(
295230

296231
cf_cc_library(
297232
name = "metrics_transmitter",
298-
srcs = [
299-
"metrics_transmitter.cc",
300-
],
301-
hdrs = [
302-
"metrics_transmitter.h",
303-
],
233+
srcs = ["metrics_transmitter.cc"],
234+
hdrs = ["metrics_transmitter.h"],
304235
deps = [
305236
"//cuttlefish/common/libs/utils:base64",
306237
"//cuttlefish/common/libs/utils:subprocess",
@@ -313,12 +244,8 @@ cf_cc_library(
313244

314245
cf_cc_library(
315246
name = "metrics_writer",
316-
srcs = [
317-
"metrics_writer.cc",
318-
],
319-
hdrs = [
320-
"metrics_writer.h",
321-
],
247+
srcs = ["metrics_writer.cc"],
248+
hdrs = ["metrics_writer.h"],
322249
deps = [
323250
"//cuttlefish/common/libs/fs",
324251
"//cuttlefish/common/libs/utils:files",
@@ -332,12 +259,8 @@ cf_cc_library(
332259

333260
cf_cc_library(
334261
name = "notification",
335-
srcs = [
336-
"notification.cc",
337-
],
338-
hdrs = [
339-
"notification.h",
340-
],
262+
srcs = ["notification.cc"],
263+
hdrs = ["notification.h"],
341264
deps = [
342265
"//cuttlefish/common/libs/utils:files",
343266
"//cuttlefish/host/libs/directories",
@@ -351,12 +274,8 @@ cf_cc_library(
351274

352275
cf_cc_library(
353276
name = "parsed_flags",
354-
srcs = [
355-
"parsed_flags.cc",
356-
],
357-
hdrs = [
358-
"parsed_flags.h",
359-
],
277+
srcs = ["parsed_flags.cc"],
278+
hdrs = ["parsed_flags.h"],
360279
deps = [
361280
"//cuttlefish/host/commands/assemble_cvd/flags:cpus",
362281
"//cuttlefish/host/commands/assemble_cvd/flags:daemon",
@@ -373,12 +292,8 @@ cf_cc_library(
373292

374293
cf_cc_library(
375294
name = "session_id",
376-
srcs = [
377-
"session_id.cc",
378-
],
379-
hdrs = [
380-
"session_id.h",
381-
],
295+
srcs = ["session_id.cc"],
296+
hdrs = ["session_id.h"],
382297
deps = [
383298
"//cuttlefish/common/libs/utils:files",
384299
"//cuttlefish/common/libs/utils:uuid",

base/cvd/cuttlefish/host/libs/metrics/metrics_receiver.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include <iostream>
2727
#include <memory>
2828

29-
#include <gflags/gflags.h>
3029
#include "absl/log/log.h"
30+
#include "gflags/gflags.h"
3131

3232
#include "cuttlefish/common/libs/utils/tee_logging.h"
3333
#include "cuttlefish/host/libs/config/cuttlefish_config.h"
@@ -39,7 +39,7 @@ using cuttlefish::MetricsExitCodes;
3939

4040
namespace cuttlefish {
4141

42-
void SendHelper(const std::string &queue_name, const std::string &message) {
42+
void SendHelper(const std::string& queue_name, const std::string& message) {
4343
auto msg_queue = SysVMessageQueue::Create(queue_name, false);
4444
if (msg_queue == NULL) {
4545
LOG(FATAL) << "Create: failed to create" << queue_name;

0 commit comments

Comments
 (0)