Skip to content
Open
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: 6 additions & 0 deletions ydb/core/tablet_flat/flat_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4077,6 +4077,12 @@ void TExecutor::ForceSendCounters() {
}

float TExecutor::GetRejectProbability() const {
float rejectProbability = CalcRejectProbability();
Counters->Simple()[TExecutorCounters::REJECT_PROBABILITY] = rejectProbability * 100;
return rejectProbability;
}

float TExecutor::CalcRejectProbability() const {
// Limit number of in-flight TXs
if (Stats->TxInFly > ui64(MaxTxInFly)) {
HadRejectProbabilityByTxInFly = true;
Expand Down
2 changes: 2 additions & 0 deletions ydb/core/tablet_flat/flat_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,8 @@ class TExecutor
void RenderHtmlCounters(TStringStream& str) const;
void RenderJsonCounters(TStringStream& str) const;

float CalcRejectProbability() const;

public:
void Describe(IOutputStream &out) const override
{
Expand Down
1 change: 1 addition & 0 deletions ydb/core/tablet_flat/flat_executor_counters.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ namespace NTabletFlatExecutor {
XX(DB_REMOVED_COMMITTED_TXS, "DbRemovedCommittedTxs") \
XX(TABLET_LAST_START_TIME_US, "LastStartTimeUs") \
XX(CACHE_TOTAL_TRY_KEEP_IN_MEMORY, "CacheTotalTryKeepInMemory") \
XX(REJECT_PROBABILITY, "RejectProbability") \

// don't change order!
#define FLAT_EXECUTOR_CUMULATIVE_COUNTERS_MAP(XX) \
Expand Down
Loading