Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fs and tablets counters #2756

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cloud/filestore/libs/storage/tablet/tablet_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ class TIndexTabletActor final
{
bool Initialized{false};

std::atomic<i64> FsCount{0};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

э, что еще за FsCount у конкретной таблетки? он же должен быть равен единице
не надо его тут

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Он не будет репортиться в метрики соответствующей фс. Так же как и следующий. будет только в аггрегированном виде в component=storage

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет, выглядит странно

void TStorageServiceActor::HandleUpdateStats(
- почему ты не можешь вот в этой ф-ции посчитать TabletCount и FileSystemCount (название FsCount тоже ну, блин, режет глаз - у нас везде FileSystem)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я не понимаю, зачем считать руками то что за меня могут посчитать автоматически в storage (придется пробрасывать в сервис информацию о том является ли таблетка шардом или нет и еще пересчитывать с учетом media kind). Зачем тащить в сервис то что ему совершенно не нужно?

std::atomic<i64> FsShardCount{0};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

просто ShardCount

std::atomic<i64> TotalBytesCount{0};
std::atomic<i64> UsedBytesCount{0};
std::atomic<i64> AggregateUsedBytesCount{0};
Expand Down Expand Up @@ -323,7 +325,8 @@ class TIndexTabletActor final
const TNodeIndexCacheStats& nodeIndexCacheStats,
const TNodeToSessionCounters& nodeToSessionCounters,
const TMiscNodeStats& miscNodeStats,
const TInMemoryIndexStateStats& inMemoryIndexStateStats);
const TInMemoryIndexStateStats& inMemoryIndexStateStats,
bool isShard);
void UpdatePerformanceMetrics(
TInstant now,
const TDiagnosticsConfig& diagConfig,
Expand Down
14 changes: 11 additions & 3 deletions cloud/filestore/libs/storage/tablet/tablet_actor_counters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ void TIndexTabletActor::TMetrics::Register(
metrType) \
// REGISTER_LOCAL

REGISTER_AGGREGATABLE_SUM(FsCount, EMetricType::MT_ABSOLUTE);
REGISTER_AGGREGATABLE_SUM(TotalBytesCount, EMetricType::MT_ABSOLUTE);
REGISTER_AGGREGATABLE_SUM(UsedBytesCount, EMetricType::MT_ABSOLUTE);
REGISTER_AGGREGATABLE_SUM(
Expand Down Expand Up @@ -476,8 +477,13 @@ void TIndexTabletActor::TMetrics::Update(
const TNodeIndexCacheStats& nodeIndexCacheStats,
const TNodeToSessionCounters& nodeToSessionCounters,
const TMiscNodeStats& miscNodeStats,
const TInMemoryIndexStateStats& inMemoryIndexStateStats)
const TInMemoryIndexStateStats& inMemoryIndexStateStats,
bool isShard)
{
auto fsCounter = isShard ? 0 : 1;
NMetrics::Store(FsCount, fsCounter);
NMetrics::Store(FsShardCount, 1 - fsCounter);

const ui32 blockSize = fileSystem.GetBlockSize();

Store(TotalBytesCount, fileSystem.GetBlocksCount() * blockSize);
Expand Down Expand Up @@ -695,7 +701,8 @@ void TIndexTabletActor::RegisterStatCounters(TInstant now)
CalculateNodeIndexCacheStats(),
GetNodeToSessionCounters(),
GetMiscNodeStats(),
GetInMemoryIndexStateStats());
GetInMemoryIndexStateStats(),
IsShard());

Metrics.Register(fsId, storageMediaKind);
}
Expand Down Expand Up @@ -745,7 +752,8 @@ void TIndexTabletActor::HandleUpdateCounters(
CalculateNodeIndexCacheStats(),
GetNodeToSessionCounters(),
GetMiscNodeStats(),
GetInMemoryIndexStateStats());
GetInMemoryIndexStateStats(),
IsShard());
SendMetricsToExecutor(ctx);

UpdateCountersScheduled = false;
Expand Down
Loading