forked from ydb-platform/ydb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make local internal CS persistent snapshot pinger (ydb-platform#7431)
- Loading branch information
1 parent
6e750e1
commit 45b73d0
Showing
24 changed files
with
430 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "counters_manager.h" | ||
|
||
namespace NKikimr::NColumnShard { | ||
|
||
} // namespace NKikimr::NColumnShard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "req_tracer.h" | ||
|
||
namespace NKikimr::NColumnShard { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
#include "common/owner.h" | ||
#include <ydb/core/tx/columnshard/common/snapshot.h> | ||
|
||
namespace NKikimr::NColumnShard { | ||
|
||
class TRequestsTracerCounters: public TCommonCountersOwner { | ||
private: | ||
using TBase = TCommonCountersOwner; | ||
NMonitoring::TDynamicCounters::TCounterPtr RequestedMinSnapshotAge; | ||
NMonitoring::TDynamicCounters::TCounterPtr DefaultMinSnapshotAge; | ||
NMonitoring::TDynamicCounters::TCounterPtr SnapshotsCount; | ||
NMonitoring::TDynamicCounters::TCounterPtr SnapshotLock; | ||
NMonitoring::TDynamicCounters::TCounterPtr SnapshotUnlock; | ||
|
||
public: | ||
|
||
TRequestsTracerCounters() | ||
: TBase("cs_requests_tracing") | ||
, RequestedMinSnapshotAge(TBase::GetValue("Snapshots/RequestedAge/Seconds")) | ||
, DefaultMinSnapshotAge(TBase::GetValue("Snapshots/DefaultAge/Seconds")) | ||
, SnapshotsCount(TBase::GetValue("Snapshots/Count")) | ||
, SnapshotLock(TBase::GetDeriviative("Snapshots/Lock")) | ||
, SnapshotUnlock(TBase::GetDeriviative("Snapshots/Unlock")) | ||
{ | ||
|
||
} | ||
|
||
void OnDefaultMinSnapshotInstant(const TInstant instant) const { | ||
DefaultMinSnapshotAge->Set((TInstant::Now() - instant).Seconds()); | ||
} | ||
|
||
void OnSnapshotsInfo(const ui32 count, const std::optional<NOlap::TSnapshot> snapshotPlanStep) const { | ||
if (snapshotPlanStep) { | ||
RequestedMinSnapshotAge->Set((TInstant::Now() - snapshotPlanStep->GetPlanInstant()).Seconds()); | ||
} else { | ||
RequestedMinSnapshotAge->Set(0); | ||
} | ||
SnapshotsCount->Set(count); | ||
|
||
} | ||
|
||
void OnSnapshotLocked() const { | ||
SnapshotLock->Add(1); | ||
} | ||
void OnSnapshotUnlocked() const { | ||
SnapshotUnlock->Add(1); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.