private void postPortion(Map<String, Object> chunk) {
try {
final String payload = OBJECT_MAPPER.writeValueAsString(chunk);
final Future<Response> future = httpPoster.post(userAgent, payload);
final Response response = future.get(timeout, timeoutUnit);
final int statusCode = response.getStatusCode();
if (statusCode < 200 || statusCode >= 300) {
LOG.error(
"Received an error from Librato API. Code : {}, Message: {}",
statusCode, response.getBody());
}
} catch (Exception e) {
LOG.error("Unable to post to Librato API", e);
}
}