Skip to content

Commit

Permalink
issue-654: limiting the number of volume MetaHistory records displaye…
Browse files Browse the repository at this point in the history
…d on volume monpage (#859)
  • Loading branch information
qkrorlqr authored Mar 29, 2024
1 parent 9df9e81 commit fd6bbe9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cloud/blockstore/config/storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -948,4 +948,7 @@ message TStorageServiceConfig
// Timeout for attempts to acquire the shadow disk when writes to the source
// disk are not blocked (in ms).
optional uint32 MaxAcquireShadowDiskTotalTimeoutWhenNonBlocked = 358;

// Max number of volume MetaHistory records displayed on volume monpage.
optional uint32 VolumeMetaHistoryDisplayedRecordLimit = 359;
}
1 change: 1 addition & 0 deletions cloud/blockstore/libs/storage/core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ TDuration MSeconds(ui32 value)
xxx(VolumeHistoryDuration, TDuration, Days(7) )\
xxx(VolumeHistoryCacheSize, ui32, 100 )\
xxx(DeletedCheckpointHistoryLifetime, TDuration, Days(7) )\
xxx(VolumeMetaHistoryDisplayedRecordLimit, ui32, 30 )\
\
xxx(BytesPerPartition, ui64, 512_TB )\
xxx(BytesPerPartitionSSD, ui64, 512_GB )\
Expand Down
1 change: 1 addition & 0 deletions cloud/blockstore/libs/storage/core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ class TStorageConfig

TDuration GetVolumeHistoryDuration() const;
ui32 GetVolumeHistoryCacheSize() const;
ui32 GetVolumeMetaHistoryDisplayedRecordLimit() const;

ui64 GetBytesPerPartition() const;
ui64 GetBytesPerPartitionSSD() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,10 @@ void TVolumeActor::RenderHistory(
}
}
auto it = metaHistory.rbegin();
while (it != metaHistory.rend()) {
ui32 displayedCount = 0;
const ui32 limit =
Config->GetVolumeMetaHistoryDisplayedRecordLimit();
while (it != metaHistory.rend() && displayedCount < limit) {
const auto& item = *it;

TABLER() {
Expand All @@ -627,6 +630,7 @@ void TVolumeActor::RenderHistory(
}

++it;
++displayedCount;
}
}
}
Expand Down

0 comments on commit fd6bbe9

Please sign in to comment.