mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 09:58:50 +08:00
Merge pull request #4922 from Daniel-B-Smith/proxies-status-json
Add a backwards-compatible 'proxies' field to status json
This commit is contained in:
commit
513d4df25f
@ -530,7 +530,7 @@
|
||||
"hz":0.0,
|
||||
"counter":0,
|
||||
"roughness":0.0
|
||||
},
|
||||
},
|
||||
"low_priority_reads":{ // measures number of incoming low priority read requests
|
||||
"hz":0.0,
|
||||
"counter":0,
|
||||
@ -702,7 +702,8 @@
|
||||
"auto_resolvers":1,
|
||||
"auto_logs":3,
|
||||
"backup_worker_enabled":1,
|
||||
"commit_proxies":5 // this field will be absent if a value has not been explicitly set
|
||||
"commit_proxies":5, // this field will be absent if a value has not been explicitly set
|
||||
"proxies":6 // this field will be absent if a value has not been explicitly set
|
||||
},
|
||||
"data":{
|
||||
"least_operating_space_bytes_log_server":0,
|
||||
|
@ -338,14 +338,26 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const {
|
||||
result["regions"] = getRegionJSON();
|
||||
}
|
||||
|
||||
// Add to the `proxies` count for backwards compatibility with tools built before 7.0.
|
||||
int32_t proxyCount = -1;
|
||||
if (desiredTLogCount != -1 || isOverridden("logs")) {
|
||||
result["logs"] = desiredTLogCount;
|
||||
}
|
||||
if (commitProxyCount != -1 || isOverridden("commit_proxies")) {
|
||||
result["commit_proxies"] = commitProxyCount;
|
||||
if (proxyCount != -1) {
|
||||
proxyCount += commitProxyCount;
|
||||
} else {
|
||||
proxyCount = commitProxyCount;
|
||||
}
|
||||
}
|
||||
if (grvProxyCount != -1 || isOverridden("grv_proxies")) {
|
||||
result["grv_proxies"] = grvProxyCount;
|
||||
if (proxyCount != -1) {
|
||||
proxyCount += grvProxyCount;
|
||||
} else {
|
||||
proxyCount = grvProxyCount;
|
||||
}
|
||||
}
|
||||
if (resolverCount != -1 || isOverridden("resolvers")) {
|
||||
result["resolvers"] = resolverCount;
|
||||
@ -371,6 +383,9 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const {
|
||||
if (autoDesiredTLogCount != CLIENT_KNOBS->DEFAULT_AUTO_LOGS || isOverridden("auto_logs")) {
|
||||
result["auto_logs"] = autoDesiredTLogCount;
|
||||
}
|
||||
if (proxyCount != -1) {
|
||||
result["proxies"] = proxyCount;
|
||||
}
|
||||
|
||||
result["backup_worker_enabled"] = (int32_t)backupWorkerEnabled;
|
||||
result["perpetual_storage_wiggle"] = perpetualStorageWiggleSpeed;
|
||||
|
@ -755,6 +755,7 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema(
|
||||
"auto_logs":3,
|
||||
"commit_proxies":5,
|
||||
"grv_proxies":1,
|
||||
"proxies":6,
|
||||
"backup_worker_enabled":1,
|
||||
"perpetual_storage_wiggle":0
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user