diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-10 00:12:57 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-10 00:12:57 +0300 |
commit | a864adadcf849b49085a6c20aa414d535e25fcaf (patch) | |
tree | e8a0e042123090607d2c5beb0ef0aa8ca7ec633f /library/cpp/lwtrace/control.h | |
parent | 683b886494d96e8ab3e8b571c91e69eb03cd8606 (diff) | |
download | ydb-a864adadcf849b49085a6c20aa414d535e25fcaf.tar.gz |
intermediate changes
ref:fd45b675f102830e5f7311e0b3c6aaa6ee7d4eaa
Diffstat (limited to 'library/cpp/lwtrace/control.h')
-rw-r--r-- | library/cpp/lwtrace/control.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/library/cpp/lwtrace/control.h b/library/cpp/lwtrace/control.h index 16b24eafd2..b7c47aaec6 100644 --- a/library/cpp/lwtrace/control.h +++ b/library/cpp/lwtrace/control.h @@ -200,6 +200,12 @@ namespace NLWTrace { CyclicDepot.ReadItems(r); DurationDepot.ReadItems(now, duration, r); } + + template <class TReader> + void ExtractItemsFromCyclicDepot(TReader& r) const { + CyclicDepot.ExtractItems(r); + } + void ToProtobuf(TLogPb& pb) const; }; @@ -310,6 +316,18 @@ namespace NLWTrace { } } + template <class TReader> + void ExtractItemsFromCyclicDepot(const TString& id, TReader& reader) { + TGuard<TMutex> g(Mtx); + TTraces::iterator it = Traces.find(id); + if (it == Traces.end()) { + ythrow yexception() << "trace id '" << id << "' is not used"; + } else { + TSession* trace = it->second; + trace->ExtractItemsFromCyclicDepot(reader); + } + } + bool GetDestructiveActionsAllowed() { return DestructiveActionsAllowed; } |