Add new metrics for bytes queried, keys queried, mutation bytes, mutations, and durable lag to the storage role in status.

This commit is contained in:
A.J. Beamon 2018-09-27 14:33:21 -07:00
parent 31b297e756
commit 118e21c446
2 changed files with 43 additions and 6 deletions

View File

@ -85,15 +85,40 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema(
]
},
"data_version":12341234,
"durable_version":12341234,
"data_lag": {
"seconds":5.0,
"versions":12341234
},
"durable_lag": {
"seconds":5.0,
"versions":12341234
},
"id":"eb84471d68c12d1d26f692a50000003f",
"finished_queries":{
"hz":0.0,
"counter":0,
"roughness":0.0
},
"bytes_queried":{
"hz":0.0,
"counter":0,
"roughness":0.0
},
"keys_queried":{
"hz":0.0,
"counter":0,
"roughness":0.0
},
"mutation_bytes":{
"hz":0.0,
"counter":0,
"roughness":0.0
},
"mutations":{
"hz":0.0,
"counter":0,
"roughness":0.0
}
}
],

24
fdbserver/Status.actor.cpp Executable file → Normal file
View File

@ -406,18 +406,25 @@ struct RolesInfo {
obj["id"] = iface.id().shortString();
obj["role"] = role;
try {
obj.setKeyRawNumber("stored_bytes",metrics.getValue("BytesStored"));
obj.setKeyRawNumber("kvstore_used_bytes",metrics.getValue("KvstoreBytesUsed"));
obj.setKeyRawNumber("kvstore_free_bytes",metrics.getValue("KvstoreBytesFree"));
obj.setKeyRawNumber("kvstore_available_bytes",metrics.getValue("KvstoreBytesAvailable"));
obj.setKeyRawNumber("kvstore_total_bytes",metrics.getValue("KvstoreBytesTotal"));
obj.setKeyRawNumber("stored_bytes", metrics.getValue("BytesStored"));
obj.setKeyRawNumber("kvstore_used_bytes", metrics.getValue("KvstoreBytesUsed"));
obj.setKeyRawNumber("kvstore_free_bytes", metrics.getValue("KvstoreBytesFree"));
obj.setKeyRawNumber("kvstore_available_bytes", metrics.getValue("KvstoreBytesAvailable"));
obj.setKeyRawNumber("kvstore_total_bytes", metrics.getValue("KvstoreBytesTotal"));
obj["input_bytes"] = StatusCounter(metrics.getValue("BytesInput")).getStatus();
obj["durable_bytes"] = StatusCounter(metrics.getValue("BytesDurable")).getStatus();
obj.setKeyRawNumber("query_queue_max",metrics.getValue("QueryQueueMax"));
obj.setKeyRawNumber("query_queue_max", metrics.getValue("QueryQueueMax"));
obj["finished_queries"] = StatusCounter(metrics.getValue("FinishedQueries")).getStatus();
obj["bytes_queried"] = StatusCounter(metrics.getValue("BytesQueried")).getStatus();
obj["keys_queried"] = StatusCounter(metrics.getValue("BytesQueried")).getStatus();
obj["mutation_bytes"] = StatusCounter(metrics.getValue("MutationBytes")).getStatus();
obj["mutations"] = StatusCounter(metrics.getValue("Mutations")).getStatus();
Version version = parseInt64(metrics.getValue("Version"));
Version durableVersion = parseInt64(metrics.getValue("DurableVersion"));
obj["data_version"] = version;
obj["durable_version"] = durableVersion;
int64_t versionLag = parseInt64(metrics.getValue("VersionLag"));
if(maxTLogVersion > 0) {
@ -434,7 +441,12 @@ struct RolesInfo {
dataLagSeconds = versionLag / (double)SERVER_KNOBS->VERSIONS_PER_SECOND;
dataLag["seconds"] = dataLagSeconds;
JsonBuilderObject durableLag;
durableLag["versions"] = version - durableVersion;
durableLag["seconds"] = (version - durableVersion) / (double)SERVER_KNOBS->VERSIONS_PER_SECOND;
obj["data_lag"] = dataLag;
obj["durable_lag"] = durableLag;
} catch (Error& e) {
if(e.code() != error_code_attribute_not_found)