Skip to content

Commit c2972a5

Browse files
authored
Merge 119d2fe into 4381e8c
2 parents 4381e8c + 119d2fe commit c2972a5

39 files changed

+701
-320
lines changed

ydb/core/protos/counters_columnshard.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ enum ECumulativeCounters {
135135
COUNTER_READING_EXPORTED_BLOBS = 79 [(CounterOpts) = {Name: "ReadingExportedBlobs"}];
136136
COUNTER_READING_EXPORTED_BYTES = 80 [(CounterOpts) = {Name: "ReadingExportedBytes"}];
137137
COUNTER_READING_EXPORTED_RANGES = 81 [(CounterOpts) = {Name: "ReadingExportedRanges"}];
138+
COUNTER_PLANNED_TX_COMPLETED = 82 [(CounterOpts) = {Name: "PlannedTxCompleted"}];
139+
COUNTER_IMMEDIATE_TX_COMPLETED = 83 [(CounterOpts) = {Name: "ImmediateTxCompleted"}];
138140
}
139141

140142
enum EPercentileCounters {

ydb/core/tx/columnshard/background_controller.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma once
22
#include "engines/changes/abstract/compaction_info.h"
33
#include "engines/portions/meta.h"
4+
#include <ydb/core/tx/columnshard/counters/statistics_store.h>
5+
#include <ydb/core/base/appdata.h>
46

57
namespace NKikimr::NOlap {
68
class TColumnEngineChanges;
@@ -15,11 +17,15 @@ class TBackgroundController {
1517
using TCurrentCompaction = THashMap<ui64, NOlap::TPlanCompactionInfo>;
1618
TCurrentCompaction ActiveCompactionInfo;
1719

20+
TBackgroundControllerCounters& Stats;
1821
bool ActiveCleanupPortions = false;
1922
bool ActiveCleanupTables = false;
2023
bool ActiveCleanupInsertTable = false;
2124
YDB_READONLY(TMonotonic, LastIndexationInstant, TMonotonic::Zero());
2225
public:
26+
TBackgroundController(TBackgroundControllerCounters& stats) : Stats(stats) {
27+
}
28+
2329
THashSet<NOlap::TPortionAddress> GetConflictTTLPortions() const;
2430
THashSet<NOlap::TPortionAddress> GetConflictCompactionPortions() const;
2531

@@ -29,13 +35,15 @@ class TBackgroundController {
2935
bool StartCompaction(const NOlap::TPlanCompactionInfo& info);
3036
void FinishCompaction(const NOlap::TPlanCompactionInfo& info) {
3137
Y_ABORT_UNLESS(ActiveCompactionInfo.erase(info.GetPathId()));
38+
Stats.OnCompactionFinish(info.GetPathId());
3239
}
3340
const TCurrentCompaction& GetActiveCompaction() const {
3441
return ActiveCompactionInfo;
3542
}
3643
ui32 GetCompactionsCount() const {
3744
return ActiveCompactionInfo.size();
3845
}
46+
TInstant GetLastCompactionFinishInstant(ui64 pathId) const;
3947

4048
void StartIndexing(const NOlap::TColumnEngineChanges& changes);
4149
void FinishIndexing(const NOlap::TColumnEngineChanges& changes);

ydb/core/tx/columnshard/blobs_action/bs/write.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ void TWriteAction::DoOnCompleteTxAfterWrite(NColumnShard::TColumnShard& self, co
1515
ui64 blobsWritten = BlobBatch.GetBlobCount();
1616
ui64 bytesWritten = BlobBatch.GetTotalSize();
1717
if (blobsWroteSuccessfully) {
18-
self.IncCounter(NColumnShard::COUNTER_UPSERT_BLOBS_WRITTEN, blobsWritten);
19-
self.IncCounter(NColumnShard::COUNTER_UPSERT_BYTES_WRITTEN, bytesWritten);
20-
// self.IncCounter(NColumnShard::COUNTER_RAW_BYTES_UPSERTED, insertedBytes);
21-
self.IncCounter(NColumnShard::COUNTER_WRITE_SUCCESS);
18+
self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_UPSERT_BLOBS_WRITTEN, blobsWritten);
19+
self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_UPSERT_BYTES_WRITTEN, bytesWritten);
20+
// self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_RAW_BYTES_UPSERTED, insertedBytes);
21+
self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_WRITE_SUCCESS);
2222
Manager->SaveBlobBatchOnComplete(std::move(BlobBatch));
2323
} else {
24-
self.IncCounter(NColumnShard::COUNTER_WRITE_FAIL);
24+
self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_WRITE_FAIL);
2525
}
2626
}
2727

ydb/core/tx/columnshard/blobs_action/transaction/tx_write.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ bool TTxWrite::Execute(TTransactionContext& txc, const TActorContext&) {
7070

7171
if (!InsertOneBlob(txc, i, writeId)) {
7272
LOG_S_DEBUG(TxPrefix() << "duplicate writeId " << (ui64)writeId << TxSuffix());
73-
Self->IncCounter(COUNTER_WRITE_DUPLICATE);
73+
Self->Stats.GetTabletCounters().IncCounter(COUNTER_WRITE_DUPLICATE);
7474
}
7575
}
7676
}
@@ -140,10 +140,10 @@ void TTxWrite::Complete(const TActorContext& ctx) {
140140
}
141141
for (ui32 i = 0; i < buffer.GetAggregations().size(); ++i) {
142142
const auto& writeMeta = buffer.GetAggregations()[i]->GetWriteMeta();
143-
Self->CSCounters.OnWriteTxComplete(now - writeMeta.GetWriteStartInstant());
144-
Self->CSCounters.OnSuccessWriteResponse();
143+
Self->Stats.GetCSCounters().OnWriteTxComplete(now - writeMeta.GetWriteStartInstant());
144+
Self->Stats.GetCSCounters().OnSuccessWriteResponse();
145145
}
146-
146+
Self->Stats.GetTabletCounters().IncCounter(COUNTER_IMMEDIATE_TX_COMPLETED);
147147
}
148148

149149
}

0 commit comments

Comments
 (0)