aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxenoxeno <xeno@ydb.tech>2023-10-19 14:02:15 +0300
committerxenoxeno <xeno@ydb.tech>2023-10-19 14:42:05 +0300
commitc9b7da28978d2ef37df7504cd8cb0ae9c7f9a355 (patch)
tree0d51e592e6f0ad4d67a754bfa1d7dbf775a6728a
parentbc9bf98d406f1786bc879a38d42edd98b1be12cc (diff)
downloadydb-c9b7da28978d2ef37df7504cd8cb0ae9c7f9a355.tar.gz
make stable order of pdisks, vdisks and tablets KIKIMR-19773
-rw-r--r--ydb/core/viewer/json_nodes.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/ydb/core/viewer/json_nodes.h b/ydb/core/viewer/json_nodes.h
index cd3cb87bc99..85252209cf8 100644
--- a/ydb/core/viewer/json_nodes.h
+++ b/ydb/core/viewer/json_nodes.h
@@ -795,6 +795,31 @@ public:
}
}
+ for (NKikimrViewer::TNodeInfo& nodeInfo : *result.MutableNodes()) {
+ if (Storage) {
+ {
+ auto cont(*nodeInfo.MutablePDisks());
+ std::sort(cont.begin(), cont.end(), [](const NKikimrWhiteboard::TPDiskStateInfo& a, const NKikimrWhiteboard::TPDiskStateInfo& b) -> bool {
+ return a.GetPath() < b.GetPath();
+ });
+ }
+ {
+ auto cont(*nodeInfo.MutableVDisks());
+ std::sort(cont.begin(), cont.end(), [](const NKikimrWhiteboard::TVDiskStateInfo& a, const NKikimrWhiteboard::TVDiskStateInfo& b) -> bool {
+ return VDiskIDFromVDiskID(a.GetVDiskId()) < VDiskIDFromVDiskID(b.GetVDiskId());
+ });
+ }
+ }
+ if (Tablets) {
+ {
+ auto cont(*nodeInfo.MutableTablets());
+ std::sort(cont.begin(), cont.end(), [](const NKikimrViewer::TTabletStateInfo& a, const NKikimrViewer::TTabletStateInfo& b) -> bool {
+ return a.GetType() < b.GetType();
+ });
+ }
+ }
+ }
+
TStringStream json;
TProtoToJson::ProtoToJson(json, result, JsonSettings);
Send(Initiator, new NMon::TEvHttpInfoRes(Viewer->GetHTTPOKJSON(Event->Get(), std::move(json.Str())), 0, NMon::IEvHttpInfoRes::EContentType::Custom));