diff --git a/src/main/java/org/elasticsearch/rest/action/cat/RestCountAction.java b/src/main/java/org/elasticsearch/rest/action/cat/RestCountAction.java index e86cea3f6c7..b7186efccbe 100644 --- a/src/main/java/org/elasticsearch/rest/action/cat/RestCountAction.java +++ b/src/main/java/org/elasticsearch/rest/action/cat/RestCountAction.java @@ -26,14 +26,13 @@ import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading; import org.elasticsearch.client.Client; import org.elasticsearch.common.Strings; import org.elasticsearch.common.Table; +import org.elasticsearch.common.table.TimestampedTable; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.rest.*; import org.elasticsearch.rest.action.support.RestActions; import org.elasticsearch.rest.action.support.RestTable; -import org.joda.time.format.DateTimeFormat; -import org.joda.time.format.DateTimeFormatter; import java.io.IOException; @@ -41,8 +40,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; public class RestCountAction extends BaseRestHandler { - private DateTimeFormatter dateFormat = DateTimeFormat.forPattern("HH:mm:ss"); - @Inject protected RestCountAction(Settings settings, Client client, RestController restController) { super(settings, client); @@ -89,17 +86,12 @@ public class RestCountAction extends BaseRestHandler { private Table buildTable(CountResponse response) { - Table table = new Table(); + Table table = new TimestampedTable(); table.startHeaders(); - table.addCell("time(ms)", "desc:time, in milliseconds since epoch UTC, that the count was executed"); - table.addCell("timestamp", "desc:time that the count was executed"); table.addCell("count", "desc:the document count"); table.endHeaders(); - long time = System.currentTimeMillis(); table.startRow(); - table.addCell(time); - table.addCell(dateFormat.print(time)); table.addCell(response.getCount()); table.endRow();