code: protected void processQueue() {
          try {
              Collection<RequestMetric> batch = new ArrayList<>(this.batchSize);
              RequestMetric rm = queue.take();
              batch.add(rm);
  			queue.drainTo(batch, this.batchSize - 1);
  			
  			Builder builder = new Bulk.Builder();
  			for (RequestMetric metric : batch) {
  	            Index index = new Index.Builder(metric).refresh(false)
  	                    .index(getIndexName())
  	                    .type("request").build(); //$NON-NLS-1$
  				builder.addAction(index);
  			}
              
              BulkResult result = getClient().execute(builder.build());
              if (!result.isSucceeded()) {
                  logger.warn("Failed to add metric(s) to ES"); //$NON-NLS-1$
              }
          } catch (Exception e) {
              logger.warn("Error adding metric to ES"); //$NON-NLS-1$
              return;
          }
      }
docs: Process the next item in the queue.