Skip to content
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

do not treat initial tablet metrics values as 0 #4396

Merged
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
6 changes: 3 additions & 3 deletions ydb/core/tablet/tablet_metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ namespace {
if (value.IsValueReady()) {
auto val = !value.IsValueObsolete(now) ? value.GetValue() : 0;
ui32 levelVal = val / significantChange;
auto& lit = levels[groupId];
if (lit != levelVal || force) {
lit = levelVal;
auto [lit, inserted] = levels.insert({groupId, 0});
if (inserted || lit->second != levelVal || force) {
lit->second = levelVal;
haveChanges = true;
// N.B. keep going so all levels are properly updated
}
Expand Down
10 changes: 5 additions & 5 deletions ydb/core/tablet/tablet_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ class TResourceMetricsSendState {
const ui64 TabletId;
const ui32 FollowerId;
const TActorId Launcher;
ui32 LevelCPU = 0;
ui32 LevelMemory = 0;
ui32 LevelNetwork = 0;
ui32 LevelStorage = 0;
ui32 LevelIops = 0;
std::optional<ui32> LevelCPU;
std::optional<ui32> LevelMemory;
std::optional<ui32> LevelNetwork;
std::optional<ui32> LevelStorage;
std::optional<ui32> LevelIops;
THashMap<std::pair<TChannel, TGroupId>, ui32> LevelReadThroughput;
THashMap<std::pair<TChannel, TGroupId>, ui32> LevelWriteThroughput;
THashMap<std::pair<TChannel, TGroupId>, ui32> LevelReadIops;
Expand Down
Loading