StorageService: Add a method to return the uptime

Currently, the nodetool uses the jmx server for the uptime, this is
confusing is what we expect is Scylla uptime.

This patch exposes the API uptime using MBean.

Relates to #154

Signed-off-by: Amnon Heiman <amnon@scylladb.com>

Closes #155
This commit is contained in:
Amnon Heiman 2021-01-31 18:12:29 +02:00 committed by Pekka Enberg
parent ffab41d714
commit 15c1d4f43f
2 changed files with 7 additions and 0 deletions

View File

@ -1749,4 +1749,9 @@ public class StorageService extends MetricsMBean implements StorageServiceMBean,
APIClient.set_query_param(queryParams, "cf", APIClient.join(columnFamilies));
return client.getIntValue("/storage_service/keyspace_scrub/" + keyspaceName, queryParams);
}
@Override
public long getUptime() {
log("getUptime()");
return client.getLongValue("/system/uptime_ms");
}
}

View File

@ -883,4 +883,6 @@ public interface StorageServiceMBean extends NotificationEmitter {
public List<CompositeData> getSSTableInfo(String keyspace, String table);
public List<CompositeData> getSSTableInfo();
/** retun the system uptime */
public long getUptime();
}