aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Efimov <xeno@prnwatch.com>2022-03-28 09:27:02 +0300
committerAlexey Efimov <xeno@prnwatch.com>2022-03-28 09:27:02 +0300
commitc6c241a339ed0a257c27486f03db8ab9f6e60d6c (patch)
treed0994e4066d3bb0bc6debf963b6e1ada6928677c
parent48af3ac5acb68ca98e56db49d1d6361e77939d3b (diff)
downloadydb-c6c241a339ed0a257c27486f03db8ab9f6e60d6c.tar.gz
report total number of groups in handler json/storage KIKIMR-14483
ref:8e9d405e47059ec4ab5770738ef37655165273ca
-rw-r--r--ydb/core/viewer/json_storage.h6
-rw-r--r--ydb/core/viewer/protos/viewer.proto2
2 files changed, 8 insertions, 0 deletions
diff --git a/ydb/core/viewer/json_storage.h b/ydb/core/viewer/json_storage.h
index fa9380776e..1f8382158e 100644
--- a/ydb/core/viewer/json_storage.h
+++ b/ydb/core/viewer/json_storage.h
@@ -480,12 +480,15 @@ public:
}
}
}
+ ui64 foundGroups = 0;
+ ui64 totalGroups = 0;
for (const auto& [poolName, poolInfo] : StoragePoolInfo) {
if (!FilterStoragePools.empty() && FilterStoragePools.count(poolName) == 0) {
continue;
}
NKikimrViewer::TStoragePoolInfo* pool = StorageInfo.AddStoragePools();
for (TString groupId : poolInfo.Groups) {
+ ++totalGroups;
if (!FilterGroupIds.empty() && !BinarySearch(FilterGroupIds.begin(), FilterGroupIds.end(), groupId)) {
continue;
}
@@ -503,6 +506,7 @@ public:
case EWith::Everything:
break;
}
+ ++foundGroups;
pool->AddGroups()->SetGroupId(groupId);
auto itHiveGroup = BSGroupHiveIndex.find(groupId);
if (itHiveGroup != BSGroupHiveIndex.end()) {
@@ -554,6 +558,8 @@ public:
RemapPDisk(json, protoFrom, jsonSettings);
};
}
+ StorageInfo.SetTotalGroups(totalGroups);
+ StorageInfo.SetFoundGroups(foundGroups);
TProtoToJson::ProtoToJson(json, StorageInfo, JsonSettings);
Send(Initiator, new NMon::TEvHttpInfoRes(Viewer->GetHTTPOKJSON(Event->Get()) + json.Str(), 0, NMon::IEvHttpInfoRes::EContentType::Custom));
PassAway();
diff --git a/ydb/core/viewer/protos/viewer.proto b/ydb/core/viewer/protos/viewer.proto
index 9f6c822a89..3308c62187 100644
--- a/ydb/core/viewer/protos/viewer.proto
+++ b/ydb/core/viewer/protos/viewer.proto
@@ -386,6 +386,8 @@ message TStoragePoolInfo {
message TStorageInfo {
EFlag Overall = 1;
repeated TStoragePoolInfo StoragePools = 2;
+ uint64 TotalGroups = 3;
+ uint64 FoundGroups = 4;
}
message TNodeInfo {