Skip to content

Commit

Permalink
[+] statistics counters
Browse files Browse the repository at this point in the history
  • Loading branch information
Alek5andr-Kotov committed Nov 11, 2024
1 parent 1ed8118 commit 0076dbf
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ydb/core/persqueue/sli_duration_counter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "sli_duration_counter.h"

#include <ydb/core/base/appdata_fwd.h>
#include <ydb/core/base/counters.h>

namespace NKikimr::NPQ {

TPercentileCounter CreateSLIDurationCounter(const NActors::TActorContext& ctx,
const TString& name,
const TVector<ui32>& durations,
const TString& account,
ui32 border)
{
return CreateSLIDurationCounter(GetServiceCounters(AppData(ctx)->Counters, "pqproxy|SLI"),
TVector<NPersQueue::TPQLabelsInfo>{{{{"Account", account}}, {"total"}}},
name,
border,
durations);
}

}
24 changes: 24 additions & 0 deletions ydb/core/persqueue/sli_duration_counter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once

#include "percentile_counter.h"

#include <ydb/library/actors/core/actor.h>

#include <util/generic/string.h>
#include <util/generic/vector.h>
#include <util/system/types.h>

namespace NKikimr::NPQ {

TPercentileCounter CreateSLIDurationCounter(const NActors::TActorContext& ctx,
const TString& name,
const TVector<ui32>& durations,
const TString& account,
ui32 border);

inline
ui64 ToMilliSeconds(TDuration d) {
return d.MilliSeconds();
}

}

0 comments on commit 0076dbf

Please sign in to comment.