From ef94cc0517bb9d373ae5a2028e1fc8ffbd927693 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Tue, 1 May 2012 11:59:02 +0300 Subject: [PATCH] use nanoTime instead of millis --- .../data/support/AbstractConcurrentMapFieldDataCache.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/cache/field/data/support/AbstractConcurrentMapFieldDataCache.java b/src/main/java/org/elasticsearch/index/cache/field/data/support/AbstractConcurrentMapFieldDataCache.java index ec03389e750..07ce023a1cb 100644 --- a/src/main/java/org/elasticsearch/index/cache/field/data/support/AbstractConcurrentMapFieldDataCache.java +++ b/src/main/java/org/elasticsearch/index/cache/field/data/support/AbstractConcurrentMapFieldDataCache.java @@ -121,12 +121,12 @@ public abstract class AbstractConcurrentMapFieldDataCache extends AbstractIndexC fieldData = fieldDataCache.getIfPresent(fieldName); if (fieldData == null) { try { - long time = System.currentTimeMillis(); + long time = System.nanoTime(); fieldData = FieldData.load(type, reader, fieldName); fieldDataCache.put(fieldName, fieldData); - long took = System.currentTimeMillis() - time; + long took = System.nanoTime() - time; if (logger.isTraceEnabled()) { - logger.trace("loaded field [{}] for reader [{}], took [{}], took_millis [{}]", fieldName, reader, TimeValue.timeValueMillis(took), took); + logger.trace("loaded field [{}] for reader [{}], took [{}], took_millis [{}]", fieldName, reader, TimeValue.timeValueNanos(took), took / 1000); } } catch (OutOfMemoryError e) { logger.warn("loading field [" + fieldName + "] caused out of memory failure", e);