diff --git a/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/EvalPayload.java b/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/EvalPayload.java index 2c5cec998..41e245176 100644 --- a/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/EvalPayload.java +++ b/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/EvalPayload.java @@ -70,7 +70,7 @@ public List getMessages() { * @return * List of payloads that have at most {@code batchSize} metrics per payload. */ - public List consumeBatches(int batchSize) { + public List toBatches(int batchSize) { List payloads = new ArrayList<>(metrics.size() / batchSize + 1); consumeBatches(batchSize, payloads::add); return payloads; diff --git a/spectator-reg-atlas/src/test/java/com/netflix/spectator/atlas/impl/EvalPayloadTest.java b/spectator-reg-atlas/src/test/java/com/netflix/spectator/atlas/impl/EvalPayloadTest.java index 9a2ca5e69..05fdf5b6c 100644 --- a/spectator-reg-atlas/src/test/java/com/netflix/spectator/atlas/impl/EvalPayloadTest.java +++ b/spectator-reg-atlas/src/test/java/com/netflix/spectator/atlas/impl/EvalPayloadTest.java @@ -77,7 +77,7 @@ private List messages(int n) { @Test public void toBatchesBelowThreshold() { EvalPayload payload = new EvalPayload(0L, metrics(4)); - List batches = payload.consumeBatches(4); + List batches = payload.toBatches(4); Assertions.assertEquals(1, batches.size()); Assertions.assertSame(payload, batches.get(0)); } @@ -85,7 +85,7 @@ public void toBatchesBelowThreshold() { @Test public void toBatchesAboveThreshold() { EvalPayload payload = new EvalPayload(0L, metrics(21)); - List batches = payload.consumeBatches(4); + List batches = payload.toBatches(4); Assertions.assertEquals(6, batches.size()); int i = 0; for (EvalPayload batch : batches) { @@ -100,7 +100,7 @@ public void toBatchesAboveThreshold() { @Test public void toBatchesWithMessages() { EvalPayload payload = new EvalPayload(0L, metrics(21), messages(2)); - List batches = payload.consumeBatches(4); + List batches = payload.toBatches(4); Assertions.assertEquals(6, batches.size()); int i = 0; for (EvalPayload batch : batches) {