TableMetrics (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.metrics

## Class TableMetrics

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

-     public class TableMetrics
      extends java.lang.Object

  Metrics for `ColumnFamilyStore`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TableMetrics.Sampler`
    `static class` | `TableMetrics.TableHistogram`
    `static class` | `TableMetrics.TableTimer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.util.Map<java.lang.String,java.lang.String>` | `all` Stores all metric names created that can be used when unregistering, optionally mapped to an alias name.
    `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.
    `static java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Set<com.codahale.metrics.Metric>>` | `allTableMetrics` stores metrics that will be rolled into a single global metric
    `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
    `com.codahale.metrics.Counter` | `bytesFlushed` Total number of bytes flushed since server [re]start
    `LatencyMetrics` | `casCommit` CAS Commit metrics
    `LatencyMetrics` | `casPrepare` CAS Prepare metrics
    `LatencyMetrics` | `casPropose` CAS Propose metrics
    `TableMetrics.TableHistogram` | `colUpdateTimeDeltaHistogram` Column update time delta on this CF
    `com.codahale.metrics.Counter` | `compactionBytesWritten` Total number of bytes written by compaction since server [re]start
    `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.Counter` | `droppedMutations` Dropped Mutations Count
    `static long[]` | `EMPTY`
    `com.codahale.metrics.Gauge<long[]>` | `estimatedColumnCountHistogram` Histogram of estimated number of columns.
    `com.codahale.metrics.Gauge<java.lang.Long>` | `estimatedPartitionCount` Approximate number of keys in table.
    `com.codahale.metrics.Gauge<long[]>` | `estimatedPartitionSizeHistogram` Histogram of estimated partition size (in bytes).
    `static com.codahale.metrics.Gauge<java.lang.Double>` | `globalPercentRepaired`
    `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 table
    `TableMetrics.TableHistogram` | `liveScannedHistogram` Live rows 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>` | `maxPartitionSize` Size of the largest compacted partition
    `com.codahale.metrics.Gauge<java.lang.Long>` | `meanPartitionSize` Size of the smallest compacted partition
    `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 partitions overwritten.
    `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 partitions overwritten.
    `com.codahale.metrics.Counter` | `memtableSwitchCount` Number of times flush has resulted in the memtable being switched out.
    `com.codahale.metrics.Gauge<java.lang.Long>` | `minPartitionSize` Size of the smallest compacted partition
    `com.codahale.metrics.Gauge<java.lang.Integer>` | `pendingCompactions` Estimate of number of pending compactios for this table
    `com.codahale.metrics.Counter` | `pendingFlushes` Estimated number of tasks pending for this table
    `com.codahale.metrics.Gauge<java.lang.Double>` | `percentRepaired` percent of the data that is repaired
    `LatencyMetrics` | `rangeLatency` (Local) range slice metrics
    `LatencyMetrics` | `readLatency` (Local) read metrics
    `com.codahale.metrics.Meter` | `readRepairRequests`
    `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<TableMetrics.Sampler,TopKSampler<java.nio.ByteBuffer>>` | `samplers`
    `com.codahale.metrics.Meter` | `shortReadProtectionRequests`
    `com.codahale.metrics.Counter` | `speculativeRetries`
    `TableMetrics.TableHistogram` | `sstablesPerReadHistogram` Histogram of the number of sstable data files accessed per read
    `TableMetrics.TableHistogram` | `tombstoneScannedHistogram` Tombstones scanned in queries on this CF
    `com.codahale.metrics.Counter` | `totalDiskSpaceUsed` Total disk space used by SSTables belonging to this table, including obsolete ones waiting to be GC'd
    `com.codahale.metrics.Gauge<java.lang.Long>` | `trueSnapshotsSize` Disk space used by snapshot files which
    `TableMetrics.TableTimer` | `viewLockAcquireTime` time taken acquiring the partition lock for materialized view updates for this table
    `TableMetrics.TableTimer` | `viewReadTime` time taken during the local read of a materialized view update
    `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
    `TableMetrics(ColumnFamilyStore cfs)` Creates metrics for given `ColumnFamilyStore`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected com.codahale.metrics.Counter` | `createTableCounter(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 com.codahale.metrics.Counter` | `createTableCounter(java.lang.String name, java.lang.String alias)`
    `protected <T extends java.lang.Number> com.codahale.metrics.Gauge<T>` | `createTableGauge(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>` | `createTableGauge(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 <G,T> com.codahale.metrics.Gauge<T>` | `createTableGauge(java.lang.String name, java.lang.String alias, com.codahale.metrics.Gauge<T> gauge, com.codahale.metrics.Gauge<G> globalGauge)`
    `protected TableMetrics.TableHistogram` | `createTableHistogram(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
    `protected TableMetrics.TableHistogram` | `createTableHistogram(java.lang.String name, java.lang.String alias, com.codahale.metrics.Histogram keyspaceHistogram, boolean considerZeroes)`
    `protected TableMetrics.TableTimer` | `createTableTimer(java.lang.String name, java.lang.String alias, com.codahale.metrics.Timer keyspaceTimer)`
    `protected TableMetrics.TableTimer` | `createTableTimer(java.lang.String name, com.codahale.metrics.Timer keyspaceTimer)`
    `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

    - #### EMPTY

          public static final long[] EMPTY

    - #### 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 partitions overwritten.

    - #### 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 partitions overwritten.

    - #### 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

    - #### estimatedPartitionSizeHistogram

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

      Histogram of estimated partition size (in bytes).

    - #### estimatedPartitionCount

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

      Approximate number of keys in table.

    - #### estimatedColumnCountHistogram

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

      Histogram of estimated number of columns.

    - #### sstablesPerReadHistogram

          public final TableMetrics.TableHistogram 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 table

    - #### bytesFlushed

          public final com.codahale.metrics.Counter bytesFlushed

      Total number of bytes flushed since server [re]start

    - #### compactionBytesWritten

          public final com.codahale.metrics.Counter compactionBytesWritten

      Total number of bytes written by compaction since server [re]start

    - #### pendingCompactions

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

      Estimate of number of pending compactios for this table

    - #### 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 table

    - #### totalDiskSpaceUsed

          public final com.codahale.metrics.Counter totalDiskSpaceUsed

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

    - #### minPartitionSize

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

      Size of the smallest compacted partition

    - #### maxPartitionSize

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

      Size of the largest compacted partition

    - #### meanPartitionSize

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

      Size of the smallest compacted partition

    - #### 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 TableMetrics.TableHistogram tombstoneScannedHistogram

      Tombstones scanned in queries on this CF

    - #### liveScannedHistogram

          public final TableMetrics.TableHistogram liveScannedHistogram

      Live rows scanned in queries on this CF

    - #### colUpdateTimeDeltaHistogram

          public final TableMetrics.TableHistogram colUpdateTimeDeltaHistogram

      Column update time delta on this CF

    - #### viewLockAcquireTime

          public final TableMetrics.TableTimer viewLockAcquireTime

      time taken acquiring the partition lock for materialized view updates for this table

    - #### viewReadTime

          public final TableMetrics.TableTimer viewReadTime

      time taken during the local read of a materialized view update

    - #### 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

    - #### percentRepaired

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

      percent of the data that is repaired

    - #### 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

    - #### droppedMutations

          public final com.codahale.metrics.Counter droppedMutations

      Dropped Mutations Count

    - #### 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

    - #### globalPercentRepaired

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

    - #### readRepairRequests

          public final com.codahale.metrics.Meter readRepairRequests

    - #### shortReadProtectionRequests

          public final com.codahale.metrics.Meter shortReadProtectionRequests

    - #### samplers

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

    - #### allTableMetrics

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

      stores metrics that will be rolled into a single global metric

    - #### all

          public static final java.util.Map<java.lang.String,java.lang.String> all

      Stores all metric names created that can be used when unregistering, optionally mapped to an alias name.

  - ### Constructor Detail

    - #### TableMetrics

          public TableMetrics(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.

    - #### createTableGauge

          protected <T extends java.lang.Number> com.codahale.metrics.Gauge<T> createTableGauge(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

    - #### createTableGauge

          protected <G,T> com.codahale.metrics.Gauge<T> createTableGauge(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

    - #### createTableGauge

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

    - #### createTableCounter

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

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

    - #### createTableCounter

          protected com.codahale.metrics.Counter createTableCounter(java.lang.String name,
                                                                    java.lang.String alias)

    - #### createTableHistogram

          protected TableMetrics.TableHistogram createTableHistogram(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

    - #### createTableHistogram

          protected TableMetrics.TableHistogram createTableHistogram(java.lang.String name,
                                                                     java.lang.String alias,
                                                                     com.codahale.metrics.Histogram keyspaceHistogram,
                                                                     boolean considerZeroes)

    - #### createTableTimer

          protected TableMetrics.TableTimer createTableTimer(java.lang.String name,
                                                             com.codahale.metrics.Timer keyspaceTimer)

    - #### createTableTimer

          protected TableMetrics.TableTimer createTableTimer(java.lang.String name,
                                                             java.lang.String alias,
                                                             com.codahale.metrics.Timer keyspaceTimer)

Copyright © 2018 The Apache Software Foundation