get should report time in millis, but return in nanoseconds

This commit is contained in:
Shay Banon 2011-11-14 10:40:05 +02:00
parent 62d67e6c2d
commit b43c8fe128
1 changed files with 2 additions and 1 deletions

View File

@ -54,6 +54,7 @@ import org.elasticsearch.search.lookup.SourceLookup;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import static org.elasticsearch.common.collect.Maps.*;
@ -81,7 +82,7 @@ public class ShardGetService extends AbstractIndexShardComponent {
}
public GetStats stats() {
return new GetStats(existsMetric.count(), existsMetric.sum(), missingMetric.count(), missingMetric.sum());
return new GetStats(existsMetric.count(), TimeUnit.NANOSECONDS.toMillis(existsMetric.sum()), missingMetric.count(), TimeUnit.NANOSECONDS.toMillis(missingMetric.sum()));
}
// sadly, to overcome cyclic dep, we need to do this and inject it ourselves...