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

CNDB-8187 Add metrics about time spent writing SAI (compaction and flush) #1329

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

eolivelli
Copy link

@eolivelli eolivelli commented Oct 4, 2024

  • Add new table and keyspace metrics to track the time spent in SSTables writing (both compaction and flush).
  • Add a new table metric with the time spent on writing SAI

New Table and Keyspace metrics:

Histogram flushTime
Histogram compactionTime
Histogram storageAttachedIndexRebuildTime

Histogram  storageAttachedIndexWritingTimeForIndexBuild
Histogram  storageAttachedIndexWritingTimeForCompaction
Histogram  storageAttachedIndexWritingTimeForFlush
Histogram  storageAttachedIndexWritingTimeForOther

storageAttachedIndexWritingTimeForXX is the time spent in "StorageAttachedIndexWriter#addRow" for operation type XXX

For MemTable flush:

  • flushTime is the total time
  • storageAttachedIndexWritingTimeForFlush is always smaller than flushTime

For Compaction:

  • compactionTime is the total time
  • storageAttachedIndexWritingTimeForCompaction is always smaller than compactionTime

For IndexBuild:

  • storageAttachedIndexRebuildTime is the total time
  • storageAttachedIndexWritingTimeForIndexBuild is always smaller than storageAttachedIndexRebuildTime

storageAttachedIndexWritingTimeForOther is for anything else (Garbage Collection, Scrub....)

@eolivelli eolivelli closed this Oct 4, 2024
@eolivelli eolivelli reopened this Oct 4, 2024
@eolivelli eolivelli marked this pull request as draft October 4, 2024 11:24
@eolivelli
Copy link
Author

There is still one problem on Compactors: we use StorageAttachedIndexWriter.addRow() even when rebuilding the indexes, we have to disambiguate this case from the other two cases (memtable flush and compaction activities) otherwise it is not possible to correlate correctly storageAttachedIndexWritingTime with the activities that are going on in the node.

@eolivelli eolivelli changed the title CNDB-8187 Add metrics about time spent writing sstables (compaction and flush) and support tracking SAI build time CNDB-8187 Add metrics about time spent writing SAI (compaction and flush) Oct 4, 2024
Copy link

sonarcloud bot commented Oct 4, 2024

public final Histogram storageAttachedIndexWritingTimeForOther;

/** Time spent writing memtables during compaction */
public final Histogram compactionTime;

Choose a reason for hiding this comment

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

CNDB has CompactionTaskMetrics#duration

Copy link
Author

Choose a reason for hiding this comment

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

that's another thing, I initially thought I had to go there, but these metrics are more low level

CompactionTaskMetrics#duration is more about the overall "task", including etcd and other stuff.
I want this metric because it is comparable with the other storageAttachedIndexWritingTimeForCompaction

https://github.com/riptano/cndb/blob/46688e90e2444bde0261a3d499ab6f237a6a306d/cndb-tasks/src/main/java/com/datastax/cndb/compactor/CompactionTaskMetrics.java#L206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants