Skip to content

Commit

Permalink
HOTFIX: Fix checkstyle errors in MetricsTest (#5345)
Browse files Browse the repository at this point in the history
This was broken when picking #5341 into 1.1.

Reviewers: Guozhang Wang <[email protected]>
  • Loading branch information
hachikuji authored Jul 6, 2018
1 parent 10f27ce commit 9e20618
Showing 1 changed file with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -624,16 +624,15 @@ public void testConcurrentReadUpdate() throws Exception {
final AtomicBoolean alive = new AtomicBoolean(true);
executorService = Executors.newSingleThreadExecutor();
executorService.submit(new ConcurrentMetricOperation(alive, "record", new Runnable() {
@Override
public void run() {
while (alive.get()) {
for (Sensor sensor : sensors) {
sensor.record(random.nextInt(10000));
}
}
@Override
public void run() {
while (alive.get()) {
for (Sensor sensor : sensors) {
sensor.record(random.nextInt(10000));
}
})
);
}
}
}));

for (int i = 0; i < 10000; i++) {
if (sensors.size() > 5) {
Expand Down Expand Up @@ -708,28 +707,25 @@ public void run() {
}
}
}
})
);
}));
Future<?> readFuture = executorService.submit(new ConcurrentMetricOperation(alive, "read", new Runnable() {
@Override
public void run() {
while (alive.get()) {
for (Sensor sensor : sensors) {
for (Metric metric : sensor.metrics()) {
assertNotNull("Invalid metric value", metric.metricValue());
}
}
@Override
public void run() {
while (alive.get()) {
for (Sensor sensor : sensors) {
for (Metric metric : sensor.metrics()) {
assertNotNull("Invalid metric value", metric.metricValue());
}
}
})
);
}
}
}));
Future<?> reportFuture = executorService.submit(new ConcurrentMetricOperation(alive, "report", new Runnable() {
@Override
public void run() {
reporter.processMetrics();
}
})
);
@Override
public void run() {
reporter.processMetrics();
}
}));

for (int i = 0; i < 10000; i++) {
if (sensors.size() > 10) {
Expand Down

0 comments on commit 9e20618

Please sign in to comment.