HttpEntity entity = response.getEntity();
if (metrics != null) {
for (MeasurementScheduleRequest request : metrics) {
if (request.getName().equals("connectTime")) {
report.addData(new MeasurementDataNumeric(request, (double) connectTime));
} else if (request.getName().equals("readTime")) {
report.addData(new MeasurementDataNumeric(request, (double) readTime));
} else if (request.getName().equals("contentLength")) {
if (entity != null) {
report.addData(new MeasurementDataNumeric(request, (double) entity.getContentLength()));
}
} else if (request.getName().equals("contentAge")) {
if (contentDate != null) {
report.addData(new MeasurementDataNumeric(request,
(double) (System.currentTimeMillis() - contentDate.getTime())));
}
}
}
}