Skip to content

Commit b829f53

Browse files
authored
add network throughput aggregation (#14364)
1 parent 35c4c8a commit b829f53

File tree

7 files changed

+77
-49
lines changed

7 files changed

+77
-49
lines changed

ydb/core/protos/node_whiteboard.proto

+1
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ message TSystemStateInfo {
345345
optional double CoresUsed = 39;
346346
optional uint32 CoresTotal = 40;
347347
optional float NetworkUtilization = 41;
348+
optional uint64 NetworkWriteThroughput = 42;
348349
}
349350

350351
message TEvSystemStateRequest {

ydb/core/tablet/node_whiteboard.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class TNodeWhiteboardService : public TActorBootstrapped<TNodeWhiteboardService>
7474
i64 MaxClockSkewWithPeerUs;
7575
ui32 MaxClockSkewPeerId;
7676
float MaxNetworkUtilization = 0.0;
77+
ui64 SumNetworkWriteThroughput = 0;
7778
NKikimrWhiteboard::TSystemStateInfo SystemStateInfo;
7879
THolder<NTracing::ITraceCollection> TabletIntrospectionData;
7980

@@ -568,6 +569,7 @@ class TNodeWhiteboardService : public TActorBootstrapped<TNodeWhiteboardService>
568569
}
569570
// TODO: need better way to calculate network utilization
570571
MaxNetworkUtilization = std::max(MaxNetworkUtilization, ev->Get()->Record.GetUtilization());
572+
SumNetworkWriteThroughput += nodeStateInfo.GetWriteThroughput();
571573
nodeStateInfo.MergeFrom(ev->Get()->Record);
572574
nodeStateInfo.SetChangeTime(currentChangeTime);
573575
}
@@ -1095,6 +1097,7 @@ class TNodeWhiteboardService : public TActorBootstrapped<TNodeWhiteboardService>
10951097
}
10961098

10971099
void Handle(TEvPrivate::TEvUpdateRuntimeStats::TPtr &, const TActorContext &ctx) {
1100+
static constexpr TDuration UPDATE_PERIOD = TDuration::Seconds(15);
10981101
{
10991102
NKikimrWhiteboard::TSystemStateInfo systemStatsUpdate;
11001103
TVector<double> loadAverage = GetLoadAverage();
@@ -1120,8 +1123,13 @@ class TNodeWhiteboardService : public TActorBootstrapped<TNodeWhiteboardService>
11201123
MaxNetworkUtilization = 0;
11211124
}
11221125

1126+
{
1127+
SystemStateInfo.SetNetworkWriteThroughput(SumNetworkWriteThroughput / UPDATE_PERIOD.Seconds());
1128+
SumNetworkWriteThroughput = 0;
1129+
}
1130+
11231131
UpdateSystemState(ctx);
1124-
ctx.Schedule(TDuration::Seconds(15), new TEvPrivate::TEvUpdateRuntimeStats());
1132+
ctx.Schedule(UPDATE_PERIOD, new TEvPrivate::TEvUpdateRuntimeStats());
11251133
}
11261134

11271135
void Handle(TEvPrivate::TEvCleanupDeadTablets::TPtr &, const TActorContext &ctx) {

ydb/core/viewer/protos/viewer.proto

+2
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ message TClusterInfo {
344344
uint64 Hosts = 60;
345345
uint64 Tenants = 61;
346346
double NetworkUtilization = 62;
347+
uint64 NetworkWriteThroughput = 63;
347348
}
348349

349350
enum ETenantType {
@@ -400,6 +401,7 @@ message TTenant {
400401
uint32 CoresTotal = 50;
401402
optional NKikimrMemory.TMemoryStats MemoryStats = 51;
402403
float NetworkUtilization = 52;
404+
uint64 NetworkWriteThroughput = 53;
403405
}
404406

405407
message TTenants {

0 commit comments

Comments
 (0)