hostLoadManager.recordResult(newBatchResult(200, 4000));
assertFalse(hostLoadManager.shouldDelay());
// The host load manager will try to suggest larger batches,
// trying to pull the low throughput up towards the load.
BatchSize batchSize = hostLoadManager.determineBatchSize();
assertEquals(800, batchSize.getHint());
// Another slow-running batch should produce a similar result, but
// the returned batch hint should be capped at the maximum batch size.
hostLoadManager.recordResult(newBatchResult(800, 8000));
assertFalse(hostLoadManager.shouldDelay());
batchSize = hostLoadManager.determineBatchSize();
assertEquals(1000, batchSize.getHint());
// A gross overage should put the brakes on.
hostLoadManager.recordResult(newBatchResult(4000, 200));
assertTrue(hostLoadManager.shouldDelay());
batchSize = hostLoadManager.determineBatchSize();
assertEquals(0, batchSize.getHint());
}