Skip to content

Commit

Permalink
fix name
Browse files Browse the repository at this point in the history
  • Loading branch information
brharrington committed Mar 14, 2024
1 parent 220cf3f commit 9fea09c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public List<Message> getMessages() {
* @return
* List of payloads that have at most {@code batchSize} metrics per payload.
*/
public List<EvalPayload> consumeBatches(int batchSize) {
public List<EvalPayload> toBatches(int batchSize) {
List<EvalPayload> payloads = new ArrayList<>(metrics.size() / batchSize + 1);
consumeBatches(batchSize, payloads::add);
return payloads;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ private List<EvalPayload.Message> messages(int n) {
@Test
public void toBatchesBelowThreshold() {
EvalPayload payload = new EvalPayload(0L, metrics(4));
List<EvalPayload> batches = payload.consumeBatches(4);
List<EvalPayload> batches = payload.toBatches(4);
Assertions.assertEquals(1, batches.size());
Assertions.assertSame(payload, batches.get(0));
}

@Test
public void toBatchesAboveThreshold() {
EvalPayload payload = new EvalPayload(0L, metrics(21));
List<EvalPayload> batches = payload.consumeBatches(4);
List<EvalPayload> batches = payload.toBatches(4);
Assertions.assertEquals(6, batches.size());
int i = 0;
for (EvalPayload batch : batches) {
Expand All @@ -100,7 +100,7 @@ public void toBatchesAboveThreshold() {
@Test
public void toBatchesWithMessages() {
EvalPayload payload = new EvalPayload(0L, metrics(21), messages(2));
List<EvalPayload> batches = payload.consumeBatches(4);
List<EvalPayload> batches = payload.toBatches(4);
Assertions.assertEquals(6, batches.size());
int i = 0;
for (EvalPayload batch : batches) {
Expand Down

0 comments on commit 9fea09c

Please sign in to comment.