Skip to content

add network throughput aggregation #14364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ydb/core/protos/node_whiteboard.proto
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ message TSystemStateInfo {
optional double CoresUsed = 39;
optional uint32 CoresTotal = 40;
optional float NetworkUtilization = 41;
optional uint64 NetworkWriteThroughput = 42;
}

message TEvSystemStateRequest {
Expand Down
10 changes: 9 additions & 1 deletion ydb/core/tablet/node_whiteboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class TNodeWhiteboardService : public TActorBootstrapped<TNodeWhiteboardService>
i64 MaxClockSkewWithPeerUs;
ui32 MaxClockSkewPeerId;
float MaxNetworkUtilization = 0.0;
ui64 SumNetworkWriteThroughput = 0;
NKikimrWhiteboard::TSystemStateInfo SystemStateInfo;
THolder<NTracing::ITraceCollection> TabletIntrospectionData;

Expand Down Expand Up @@ -568,6 +569,7 @@ class TNodeWhiteboardService : public TActorBootstrapped<TNodeWhiteboardService>
}
// TODO: need better way to calculate network utilization
MaxNetworkUtilization = std::max(MaxNetworkUtilization, ev->Get()->Record.GetUtilization());
SumNetworkWriteThroughput += nodeStateInfo.GetWriteThroughput();
nodeStateInfo.MergeFrom(ev->Get()->Record);
nodeStateInfo.SetChangeTime(currentChangeTime);
}
Expand Down Expand Up @@ -1095,6 +1097,7 @@ class TNodeWhiteboardService : public TActorBootstrapped<TNodeWhiteboardService>
}

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

{
SystemStateInfo.SetNetworkWriteThroughput(SumNetworkWriteThroughput / UPDATE_PERIOD.Seconds());
SumNetworkWriteThroughput = 0;
}

UpdateSystemState(ctx);
ctx.Schedule(TDuration::Seconds(15), new TEvPrivate::TEvUpdateRuntimeStats());
ctx.Schedule(UPDATE_PERIOD, new TEvPrivate::TEvUpdateRuntimeStats());
}

void Handle(TEvPrivate::TEvCleanupDeadTablets::TPtr &, const TActorContext &ctx) {
Expand Down
2 changes: 2 additions & 0 deletions ydb/core/viewer/protos/viewer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ message TClusterInfo {
uint64 Hosts = 60;
uint64 Tenants = 61;
double NetworkUtilization = 62;
uint64 NetworkWriteThroughput = 63;
}

enum ETenantType {
Expand Down Expand Up @@ -400,6 +401,7 @@ message TTenant {
uint32 CoresTotal = 50;
optional NKikimrMemory.TMemoryStats MemoryStats = 51;
float NetworkUtilization = 52;
uint64 NetworkWriteThroughput = 53;
}

message TTenants {
Expand Down
Loading
Loading