Skip to content

Commit

Permalink
Merge fbdd8b5 into ce3201c
Browse files Browse the repository at this point in the history
  • Loading branch information
alexd65536 authored Sep 10, 2024
2 parents ce3201c + fbdd8b5 commit 13bab15
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ydb/core/tablet/private/aggregated_counters.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class TAggregatedHistogramCounters {
TVector<TCountersByTabletIdMap> CountersByTabletId; // each index is map from tablet to counter value
};

class TAggregatedLabeledCounters {
class TAggregatedLabeledCounters : public TThrRefBase {
public:
//
TAggregatedLabeledCounters(ui32 count, const ui8* aggrFunc, const char * const * names, const ui8* types, const TString& groupNames);
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tablet/private/labeled_db_counters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void TPQCounters::Apply(ui64 tabletId, const NKikimr::TTabletLabeledCountersBase
}
}

auto& el = LabeledCountersByGroup.InsertIfAbsent(group, new TAggregatedLabeledCounters(
auto el = LabeledCountersByGroup.InsertIfAbsent(group, new TAggregatedLabeledCounters(
labeledCounters->GetCounters().Size(), labeledCounters->GetAggrFuncs(),
labeledCounters->GetNames(), labeledCounters->GetTypes(), groupNames));

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tablet/private/labeled_db_counters.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace NKikimr::NPrivate {

class TPQCounters : public ILabeledCounters {
protected:
TConcurrentRWHashMap<TString, TAutoPtr<TAggregatedLabeledCounters>, 256> LabeledCountersByGroup;
TConcurrentRWHashMap<TString, TIntrusivePtr<TAggregatedLabeledCounters>, 256> LabeledCountersByGroup;
NMonitoring::TDynamicCounterPtr Group;

public:
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/util/concurrent_rw_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ class TConcurrentRWHashMap {
return false;
}

V& InsertIfAbsent(const K& key, const V& value) {
V InsertIfAbsent(const K& key, const V& value) {
TBucket& bucket = GetBucketForKey(key);
TWriteGuard guard(bucket.RWLock);

return bucket.Map.insert(std::make_pair(key, value)).first->second;
}

template <typename Callable>
V& InsertIfAbsentWithInit(const K& key, Callable initFunc) {
V InsertIfAbsentWithInit(const K& key, Callable initFunc) {
TBucket& bucket = GetBucketForKey(key);
TWriteGuard guard(bucket.RWLock);

Expand Down

0 comments on commit 13bab15

Please sign in to comment.