org.apache.cassandra.metrics

## Class ColumnFamilyMetrics

- java.lang.Object
- - org.apache.cassandra.metrics.ColumnFamilyMetrics

    public class ColumnFamilyMetrics
    extends java.lang.Object

Metrics for `ColumnFamilyStore`.

### Nested Class Summary

Nested Classes
`static class` `ColumnFamilyMetrics.ColumnFamilyHistogram`
`static class` `ColumnFamilyMetrics.Sampler`

### Field Summary

Fields
`static java.util.Set<java.lang.String>` `all` Stores all metric names created that can be used when unregistering
`static java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Set<com.codahale.metrics.Metric>>` `allColumnFamilyMetrics` stores metrics that will be rolled into a single global metric
`com.codahale.metrics.Gauge<java.lang.Long>` `allMemtablesLiveDataSize` Total amount of live data stored in the memtables (2i and pending flush memtables included) that resides off-heap, excluding any data structure overhead
`com.codahale.metrics.Gauge<java.lang.Long>` `allMemtablesOffHeapSize` Total amount of data stored in the memtables (2i and pending flush memtables included) that resides off-heap.
`com.codahale.metrics.Gauge<java.lang.Long>` `allMemtablesOnHeapSize` Total amount of data stored in the memtables (2i and pending flush memtables included) that resides on-heap.
`com.codahale.metrics.Gauge<java.lang.Long>` `bloomFilterDiskSpaceUsed` Disk space used by bloom filter
`com.codahale.metrics.Gauge<java.lang.Long>` `bloomFilterFalsePositives` Number of false positives in bloom filter
`com.codahale.metrics.Gauge<java.lang.Double>` `bloomFilterFalseRatio` False positive ratio of bloom filter
`com.codahale.metrics.Gauge<java.lang.Long>` `bloomFilterOffHeapMemoryUsed` Off heap memory used by bloom filter
`LatencyMetrics` `casCommit` CAS Commit metrics
`LatencyMetrics` `casPrepare` CAS Prepare metrics
`LatencyMetrics` `casPropose` CAS Propose metrics
`ColumnFamilyMetrics.ColumnFamilyHistogram` `colUpdateTimeDeltaHistogram` Column update time delta on this CF
`com.codahale.metrics.Gauge<java.lang.Long>` `compressionMetadataOffHeapMemoryUsed` Off heap memory used by compression meta data
`com.codahale.metrics.Gauge<java.lang.Double>` `compressionRatio` Current compression ratio for all SSTables
`com.codahale.metrics.Timer` `coordinatorReadLatency`
`com.codahale.metrics.Timer` `coordinatorScanLatency`
`com.codahale.metrics.Gauge<long[]>` `estimatedColumnCountHistogram` Histogram of estimated number of columns.
`com.codahale.metrics.Gauge<java.lang.Long>` `estimatedRowCount` Approximate number of keys in table.
`com.codahale.metrics.Gauge<long[]>` `estimatedRowSizeHistogram` Histogram of estimated row size (in bytes).
`static LatencyMetrics` `globalRangeLatency`
`static LatencyMetrics` `globalReadLatency`
`static LatencyMetrics` `globalWriteLatency`
`com.codahale.metrics.Gauge<java.lang.Long>` `indexSummaryOffHeapMemoryUsed` Off heap memory used by index summary
`com.codahale.metrics.Gauge<java.lang.Double>` `keyCacheHitRate` Key cache hit rate for this CF
`com.codahale.metrics.Counter` `liveDiskSpaceUsed` Disk space used by SSTables belonging to this CF
`ColumnFamilyMetrics.ColumnFamilyHistogram` `liveScannedHistogram` Live cells scanned in queries on this CF
`com.codahale.metrics.Gauge<java.lang.Integer>` `liveSSTableCount` Number of SSTables on disk for this CF
`com.codahale.metrics.Gauge<java.lang.Long>` `maxRowSize` Size of the largest compacted row
`com.codahale.metrics.Gauge<java.lang.Long>` `meanRowSize` Size of the smallest compacted row
`com.codahale.metrics.Gauge<java.lang.Long>` `memtableColumnsCount` Total number of columns present in the memtable.
`com.codahale.metrics.Gauge<java.lang.Long>` `memtableLiveDataSize` Total amount of live data stored in the memtable, excluding any data structure overhead
`com.codahale.metrics.Gauge<java.lang.Long>` `memtableOffHeapSize` Total amount of data stored in the memtable that resides off-heap, including column related overhead and overwritten rows.
`com.codahale.metrics.Gauge<java.lang.Long>` `memtableOnHeapSize` Total amount of data stored in the memtable that resides on-heap, including column related overhead and overwritten rows.
`com.codahale.metrics.Counter` `memtableSwitchCount` Number of times flush has resulted in the memtable being switched out.
`com.codahale.metrics.Gauge<java.lang.Long>` `minRowSize` Size of the smallest compacted row
`com.codahale.metrics.Gauge<java.lang.Integer>` `pendingCompactions` Estimate of number of pending compactios for this CF
`com.codahale.metrics.Counter` `pendingFlushes` Estimated number of tasks pending for this column family
`LatencyMetrics` `rangeLatency` (Local) range slice metrics
`LatencyMetrics` `readLatency` (Local) read metrics
`com.codahale.metrics.Gauge<java.lang.Long>` `recentBloomFilterFalsePositives` Number of false positives in bloom filter from last read
`com.codahale.metrics.Gauge<java.lang.Double>` `recentBloomFilterFalseRatio` False positive ratio of bloom filter from last read
`com.codahale.metrics.Counter` `rowCacheHit` Number of row cache hits
`com.codahale.metrics.Counter` `rowCacheHitOutOfRange` Row cache hits, but result out of range
`com.codahale.metrics.Counter` `rowCacheMiss` Number of row cache misses
`java.util.Map<ColumnFamilyMetrics.Sampler,TopKSampler<java.nio.ByteBuffer>>` `samplers`
`com.codahale.metrics.Counter` `speculativeRetries`
`ColumnFamilyMetrics.ColumnFamilyHistogram` `sstablesPerReadHistogram` Histogram of the number of sstable data files accessed per read
`ColumnFamilyMetrics.ColumnFamilyHistogram` `tombstoneScannedHistogram` Tombstones scanned in queries on this CF
`com.codahale.metrics.Counter` `totalDiskSpaceUsed` Total disk space used by SSTables belonging to this CF, including obsolete ones waiting to be GC'd
`com.codahale.metrics.Gauge<java.lang.Long>` `trueSnapshotsSize` Disk space used by snapshot files which
`com.codahale.metrics.Histogram` `waitingOnFreeMemtableSpace` Time spent waiting for free memtable space, either on- or off-heap
`LatencyMetrics` `writeLatency` (Local) write metrics

### Constructor Summary

Constructors
Constructor and Description
`ColumnFamilyMetrics(ColumnFamilyStore cfs)` Creates metrics for given `ColumnFamilyStore`.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected com.codahale.metrics.Counter` `createColumnFamilyCounter(java.lang.String name)` Creates a counter that will also have a global counter thats the sum of all counters across different column families
`protected <T extends java.lang.Number> com.codahale.metrics.Gauge<T>` `createColumnFamilyGauge(java.lang.String name, com.codahale.metrics.Gauge<T> gauge)` Create a gauge that will be part of a merged version of all column families.
`protected <G,T> com.codahale.metrics.Gauge<T>` `createColumnFamilyGauge(java.lang.String name, com.codahale.metrics.Gauge<T> gauge, com.codahale.metrics.Gauge<G> globalGauge)` Create a gauge that will be part of a merged version of all column families.
`protected ColumnFamilyMetrics.ColumnFamilyHistogram` `createColumnFamilyHistogram(java.lang.String name, com.codahale.metrics.Histogram keyspaceHistogram, boolean considerZeroes)` Create a histogram-like interface that will register both a CF, keyspace and global level histogram and forward any updates to both
`void` `release()` Release all associated metrics.
`void` `updateSSTableIterated(int count)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### memtableOnHeapSize

    public final com.codahale.metrics.Gauge<java.lang.Long> memtableOnHeapSize

Total amount of data stored in the memtable that resides on-heap, including column related overhead and overwritten rows.

#### memtableOffHeapSize

    public final com.codahale.metrics.Gauge<java.lang.Long> memtableOffHeapSize

Total amount of data stored in the memtable that resides off-heap, including column related overhead and overwritten rows.

#### memtableLiveDataSize

    public final com.codahale.metrics.Gauge<java.lang.Long> memtableLiveDataSize

Total amount of live data stored in the memtable, excluding any data structure overhead

#### allMemtablesOnHeapSize

    public final com.codahale.metrics.Gauge<java.lang.Long> allMemtablesOnHeapSize

Total amount of data stored in the memtables (2i and pending flush memtables included) that resides on-heap.

#### allMemtablesOffHeapSize

    public final com.codahale.metrics.Gauge<java.lang.Long> allMemtablesOffHeapSize

Total amount of data stored in the memtables (2i and pending flush memtables included) that resides off-heap.

#### allMemtablesLiveDataSize

    public final com.codahale.metrics.Gauge<java.lang.Long> allMemtablesLiveDataSize

Total amount of live data stored in the memtables (2i and pending flush memtables included) that resides off-heap, excluding any data structure overhead

#### memtableColumnsCount

    public final com.codahale.metrics.Gauge<java.lang.Long> memtableColumnsCount

Total number of columns present in the memtable.

#### memtableSwitchCount

    public final com.codahale.metrics.Counter memtableSwitchCount

Number of times flush has resulted in the memtable being switched out.

#### compressionRatio

    public final com.codahale.metrics.Gauge<java.lang.Double> compressionRatio

Current compression ratio for all SSTables

#### estimatedRowSizeHistogram

    public final com.codahale.metrics.Gauge<long[]> estimatedRowSizeHistogram

Histogram of estimated row size (in bytes).

#### estimatedRowCount

    public final com.codahale.metrics.Gauge<java.lang.Long> estimatedRowCount

Approximate number of keys in table.

#### estimatedColumnCountHistogram

    public final com.codahale.metrics.Gauge<long[]> estimatedColumnCountHistogram

Histogram of estimated number of columns.

#### sstablesPerReadHistogram

    public final ColumnFamilyMetrics.ColumnFamilyHistogram sstablesPerReadHistogram

Histogram of the number of sstable data files accessed per read

#### readLatency

    public final LatencyMetrics readLatency

(Local) read metrics

#### rangeLatency

    public final LatencyMetrics rangeLatency

(Local) range slice metrics

#### writeLatency

    public final LatencyMetrics writeLatency

(Local) write metrics

#### pendingFlushes

    public final com.codahale.metrics.Counter pendingFlushes

Estimated number of tasks pending for this column family

#### pendingCompactions

    public final com.codahale.metrics.Gauge<java.lang.Integer> pendingCompactions

Estimate of number of pending compactios for this CF

#### liveSSTableCount

    public final com.codahale.metrics.Gauge<java.lang.Integer> liveSSTableCount

Number of SSTables on disk for this CF

#### liveDiskSpaceUsed

    public final com.codahale.metrics.Counter liveDiskSpaceUsed

Disk space used by SSTables belonging to this CF

#### totalDiskSpaceUsed

    public final com.codahale.metrics.Counter totalDiskSpaceUsed

Total disk space used by SSTables belonging to this CF, including obsolete ones waiting to be GC'd

#### minRowSize

    public final com.codahale.metrics.Gauge<java.lang.Long> minRowSize

Size of the smallest compacted row

#### maxRowSize

    public final com.codahale.metrics.Gauge<java.lang.Long> maxRowSize

Size of the largest compacted row

#### meanRowSize

    public final com.codahale.metrics.Gauge<java.lang.Long> meanRowSize

Size of the smallest compacted row

#### bloomFilterFalsePositives

    public final com.codahale.metrics.Gauge<java.lang.Long> bloomFilterFalsePositives

Number of false positives in bloom filter

#### recentBloomFilterFalsePositives

    public final com.codahale.metrics.Gauge<java.lang.Long> recentBloomFilterFalsePositives

Number of false positives in bloom filter from last read

#### bloomFilterFalseRatio

    public final com.codahale.metrics.Gauge<java.lang.Double> bloomFilterFalseRatio

False positive ratio of bloom filter

#### recentBloomFilterFalseRatio

    public final com.codahale.metrics.Gauge<java.lang.Double> recentBloomFilterFalseRatio

False positive ratio of bloom filter from last read

#### bloomFilterDiskSpaceUsed

    public final com.codahale.metrics.Gauge<java.lang.Long> bloomFilterDiskSpaceUsed

Disk space used by bloom filter

#### bloomFilterOffHeapMemoryUsed

    public final com.codahale.metrics.Gauge<java.lang.Long> bloomFilterOffHeapMemoryUsed

Off heap memory used by bloom filter

#### indexSummaryOffHeapMemoryUsed

    public final com.codahale.metrics.Gauge<java.lang.Long> indexSummaryOffHeapMemoryUsed

Off heap memory used by index summary

#### compressionMetadataOffHeapMemoryUsed

    public final com.codahale.metrics.Gauge<java.lang.Long> compressionMetadataOffHeapMemoryUsed

Off heap memory used by compression meta data

#### keyCacheHitRate

    public final com.codahale.metrics.Gauge<java.lang.Double> keyCacheHitRate

Key cache hit rate for this CF

#### tombstoneScannedHistogram

    public final ColumnFamilyMetrics.ColumnFamilyHistogram tombstoneScannedHistogram

Tombstones scanned in queries on this CF

#### liveScannedHistogram

    public final ColumnFamilyMetrics.ColumnFamilyHistogram liveScannedHistogram

Live cells scanned in queries on this CF

#### colUpdateTimeDeltaHistogram

    public final ColumnFamilyMetrics.ColumnFamilyHistogram colUpdateTimeDeltaHistogram

Column update time delta on this CF

#### trueSnapshotsSize

    public final com.codahale.metrics.Gauge<java.lang.Long> trueSnapshotsSize

Disk space used by snapshot files which

#### rowCacheHitOutOfRange

    public final com.codahale.metrics.Counter rowCacheHitOutOfRange

Row cache hits, but result out of range

#### rowCacheHit

    public final com.codahale.metrics.Counter rowCacheHit

Number of row cache hits

#### rowCacheMiss

    public final com.codahale.metrics.Counter rowCacheMiss

Number of row cache misses

#### casPrepare

    public final LatencyMetrics casPrepare

CAS Prepare metrics

#### casPropose

    public final LatencyMetrics casPropose

CAS Propose metrics

#### casCommit

    public final LatencyMetrics casCommit

CAS Commit metrics

#### coordinatorReadLatency

    public final com.codahale.metrics.Timer coordinatorReadLatency

#### coordinatorScanLatency

    public final com.codahale.metrics.Timer coordinatorScanLatency

#### waitingOnFreeMemtableSpace

    public final com.codahale.metrics.Histogram waitingOnFreeMemtableSpace

Time spent waiting for free memtable space, either on- or off-heap

#### speculativeRetries

    public final com.codahale.metrics.Counter speculativeRetries

#### globalReadLatency

    public static final LatencyMetrics globalReadLatency

#### globalWriteLatency

    public static final LatencyMetrics globalWriteLatency

#### globalRangeLatency

    public static final LatencyMetrics globalRangeLatency

#### samplers

    public final java.util.Map<ColumnFamilyMetrics.Sampler,TopKSampler<java.nio.ByteBuffer>> samplers

#### allColumnFamilyMetrics

    public static final java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Set<com.codahale.metrics.Metric>> allColumnFamilyMetrics

stores metrics that will be rolled into a single global metric

#### all

    public static final java.util.Set<java.lang.String> all

Stores all metric names created that can be used when unregistering

### Constructor Detail

#### ColumnFamilyMetrics

    public ColumnFamilyMetrics(ColumnFamilyStore cfs)

Creates metrics for given `ColumnFamilyStore`.

Parameters:
  `cfs` - ColumnFamilyStore to measure metrics

### Method Detail

#### updateSSTableIterated

    public void updateSSTableIterated(int count)

#### release

    public void release()

Release all associated metrics.

#### createColumnFamilyGauge

    protected <T extends java.lang.Number> com.codahale.metrics.Gauge<T> createColumnFamilyGauge(java.lang.String name,
                                                                                                 com.codahale.metrics.Gauge<T> gauge)

Create a gauge that will be part of a merged version of all column families. The global gauge will merge each CF gauge by adding their values

#### createColumnFamilyGauge

    protected <G,T> com.codahale.metrics.Gauge<T> createColumnFamilyGauge(java.lang.String name,
                                                                          com.codahale.metrics.Gauge<T> gauge,
                                                                          com.codahale.metrics.Gauge<G> globalGauge)

Create a gauge that will be part of a merged version of all column families. The global gauge is defined as the globalGauge parameter

#### createColumnFamilyCounter

    protected com.codahale.metrics.Counter createColumnFamilyCounter(java.lang.String name)

Creates a counter that will also have a global counter thats the sum of all counters across different column families

#### createColumnFamilyHistogram

    protected ColumnFamilyMetrics.ColumnFamilyHistogram createColumnFamilyHistogram(java.lang.String name,
                                                                                    com.codahale.metrics.Histogram keyspaceHistogram,
                                                                                    boolean considerZeroes)

Create a histogram-like interface that will register both a CF, keyspace and global level histogram and forward any updates to both