long now = time.milliseconds();
for (int i = 0; i < requests.size(); i++) {
ClientRequest request = requests.get(i);
int records = 0;
if (request.attachment() != null) {
Map<TopicPartition, RecordBatch> responseBatches = (Map<TopicPartition, RecordBatch>) request.attachment();
for (RecordBatch batch : responseBatches.values()) {
// register all per-topic metrics at once
String topic = batch.topicPartition.topic();