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 metric for total compactions completed #80

Merged
merged 1 commit into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ public boolean apply(SSTableReader sstable)

// update the metrics
cfs.metric.compactionBytesWritten.inc(endsize);
cfs.metric.compactionsCompleted.inc();
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/java/org/apache/cassandra/metrics/TableMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public class TableMetrics
public final Counter bytesFlushed;
/** Total number of bytes written by compaction since server [re]start */
public final Counter compactionBytesWritten;
/** Total number of compactions since server [re]start */
public final Counter compactionsCompleted;
/** Estimate of number of pending compactios for this table */
public final Gauge<Integer> pendingCompactions;
/** Number of SSTables on disk for this CF */
Expand Down Expand Up @@ -411,6 +413,7 @@ public Double getValue()
pendingFlushes = createTableCounter("PendingFlushes");
bytesFlushed = createTableCounter("BytesFlushed");
compactionBytesWritten = createTableCounter("CompactionBytesWritten");
compactionsCompleted = createTableCounter("CompactionsCompleted");
pendingCompactions = createTableGauge("PendingCompactions", new Gauge<Integer>()
{
public Integer getValue()
Expand Down