Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brharrington committed Dec 2, 2023
1 parent f26ef2c commit a3aa292
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public void sumAndMaxForGroup() {
EvalPayload payload = evaluator.eval(0L, data("foo", 1.0, 2.0, 3.0));

List<EvalPayload.Metric> metrics = new ArrayList<>();
metrics.add(new EvalPayload.Metric("max", Collections.emptyMap(), 3.0));
metrics.add(new EvalPayload.Metric("sum", Collections.emptyMap(), 6.0));
metrics.add(new EvalPayload.Metric("max", tags("name", "unknown"), 3.0));
metrics.add(new EvalPayload.Metric("sum", tags("name", "unknown"), 6.0));
EvalPayload expected = new EvalPayload(0L, metrics);
Assertions.assertEquals(expected, sort(payload));
}
Expand All @@ -133,7 +133,7 @@ public void updateSub() {
evaluator.sync(sumSub);
EvalPayload payload = evaluator.eval(0L, data("foo", 1.0, 2.0, 3.0));
List<EvalPayload.Metric> metrics = new ArrayList<>();
metrics.add(new EvalPayload.Metric("sum", Collections.emptyMap(), 6.0));
metrics.add(new EvalPayload.Metric("sum", tags("name", "unknown"), 6.0));
EvalPayload expected = new EvalPayload(0L, metrics);
Assertions.assertEquals(expected, payload);

Expand All @@ -143,7 +143,7 @@ public void updateSub() {
evaluator.sync(maxSub);
payload = evaluator.eval(0L, data("foo", 1.0, 2.0, 3.0));
metrics = new ArrayList<>();
metrics.add(new EvalPayload.Metric("sum", Collections.emptyMap(), 3.0));
metrics.add(new EvalPayload.Metric("sum", tags("name", "unknown"), 3.0));
expected = new EvalPayload(0L, metrics);
Assertions.assertEquals(expected, payload);
}
Expand Down Expand Up @@ -212,7 +212,7 @@ public void delayAggrCounterSum() {

Assertions.assertEquals(1, payload.getMetrics().size());
Assertions.assertEquals(
new EvalPayload.Metric("sum", tags(), 6.0),
new EvalPayload.Metric("sum", tags("name", "unknown"), 6.0),
payload.getMetrics().get(0)
);
}
Expand All @@ -229,7 +229,7 @@ public void delayAggrGaugeSum() {
Assertions.assertEquals(3, payload.getMetrics().size());
for (EvalPayload.Metric m : payload.getMetrics()) {
Map<String, String> tags = m.getTags();
Assertions.assertEquals(1, tags.size());
Assertions.assertEquals(2, tags.size());
Assertions.assertTrue(tags.containsKey("atlas.aggr"));
}
}
Expand All @@ -247,7 +247,7 @@ public void delayAggrGaugeCount() {
Assertions.assertEquals(3, payload.getMetrics().size());
for (EvalPayload.Metric m : payload.getMetrics()) {
Map<String, String> tags = m.getTags();
Assertions.assertEquals(1, tags.size());
Assertions.assertEquals(2, tags.size());
Assertions.assertTrue(tags.containsKey("atlas.aggr"));
Assertions.assertEquals(1.0, m.getValue());
}
Expand Down Expand Up @@ -294,7 +294,7 @@ public void delayAggrGaugeMax() {

Assertions.assertEquals(1, payload.getMetrics().size());
Assertions.assertEquals(
new EvalPayload.Metric("max", tags(), 3.0),
new EvalPayload.Metric("max", tags("name", "unknown"), 3.0),
payload.getMetrics().get(0)
);
}
Expand Down

0 comments on commit a3aa292

Please sign in to comment.