Skip to content

Instantly share code, notes, and snippets.

@yukim
Created June 28, 2012 18:27
Show Gist options
  • Save yukim/3013075 to your computer and use it in GitHub Desktop.
Save yukim/3013075 to your computer and use it in GitHub Desktop.
Cassandra Metrics (CASSANDRA-4009)

Cassandra Metrics

ATTENTION!: This page describes new metrics(CASSANDRA-4009) planned in upcoming version 1.2, which is still under development.

Overview

Apache Cassandra version 1.1 introduced metrics using Codahale's Metrics library. The library enables easier exposure of metrics and integration with other systems. What you can get from metrics are basically the same with 1.1 but reimplemented and put them in order using Metrics library. You can still query using old JMX paths, but they are deprecated and may be removed in future version.

As of version 1.2, Cassandra exposes following group of metrics.

  • Cache
  • Client Request
  • ColumnFamily
  • Commit Log
  • Compaction
  • Connection
  • Dropped Message
  • Streaming
  • Storage
  • Thread Pool

Cache (5 metrics/cache)

Cache metrics are created per cache type (key cache, row cache).

Codahale Metric Name

This section shows defined MetricName properties.

group: org.apache.cassandra.metrics
type: Cache
scope: KeyCache|RowCache
name: name of metric

JMX Object Name

This section shows JMX ObjectName for easy category.

org.apache.cassandra.metrics:type=Cache,scope=(Cache type),name=(Metric name)

Metrics

CapacityInBytes : Cache capacity in bytes.

Hits : Cache hit count.

HitRate : Cache hit rate.

Requests : Cache request count.

Size : Cache size in bytes.

Client Request (4 metrics/request type)

Metrics for read/range slice/write client request.

Codahale Metric Name

group: org.apache.cassandra.metrics
type: ClientRequest
scope: Read|Write|RangeSlice
name: name of metric

JMX Object Name

org.apache.cassandra.metrics:type=ClientRequest,scope=(Read|Write|RangeSlice),name=(Metric name)

Metrics

Latency : Latency statistics.

TotalLatency : Total latecy in micro seconds.

Timeouts : Total number of timeout requests. More precisely, total number of TimeoutException thrown.

Unavailables : Total number of unavailable requests. More precisely, total number of UnavailableException thrown.

ColumnFamily (23 metrics/ColumnFamily)

ColumnFamily metrics are created per ColumnFamily.

Codahale Metric Name

group: org.apache.cassandra.metrics
type: ColumnFamily|IndexColumnFamily
scope: (Keyspace name).(ColumnFamily name)
name: name of metric

If ColumnFamily is for secondary index, then type will be IndexColumnFamily.

JMX Object Name

org.apache.cassandra.metrics:type=(ColumnFamily|IndexColumnFamily),keyspace=(Keyspace name),scope=(ColumnFamily Name),name=(Metric name)

Metrics

BloomFilterDiskSpaceUsed : Disk space used by bloom filter.

BloomFilterFalsePositives : Number of false positives for bloom filter.

BloomFilterFalseRatio : False positive ratio of bloom filter.

CompressionRatio : Current compression ratio for all SSTables.

EstimatedRowSizeHistogram : Histogram of estimated row size (in bytes).

EstimatedColumnCountHistogram : Histogram of estimated number of columns.

LiveDiskSpaceUsed : Disk space used by 'live' SSTables.

LiveSSTableCount : Number of 'livw' SSTables.

MaxRowSize : Size of the largest compacted row.

MeanRowSize : Mean size of compacted rows.

MemtableColumnsCount : Total number of columns present in memtable.

MemtableDataSize : Total amount of data stored in memtable, including column related overhead.

MemtableSwitchCount : Number of times flushing has resulted in memtable being switched out.

MinRowSize : Size of the smallest compacted row.

PendingTasks : Estimated number of tasks pending.

ReadLatency : Read latency statistics.

ReadTotalLatency : Total latecy in micro seconds for reads.

RecentBloomFilterFalsePositives : Number of false positives since last check.

RecentBloomFilterFalseRatio : False positive ratio since last check.

SSTablesPerReadHistogram : Histogram of the number of SSTables accessed per read.

TotalDiskSpaceUsed : Total disk space used by SSTables including obsolete ones waiting to be GC'd.

WriteLatency : Write latency statistics.

WriteTotalLatency : Total latecy in micro seconds for writes.

Commit Log (3 metrics)

Codahale Metric Name

group: org.apache.cassandra.metrics
type: CommitLog
name: name of metric

JMX Object Name

org.apache.cassandra.metrics:type=CommitLog,name=(Metric name)

Metrics

CompletedTasks : Approximate number of completed task.

PendingTasks : Approximate number of pending task.

TotalCommitLogSize : Current data size of all commit log segments.

Compaction (4 metrics)

Codahale Metric Name

group: org.apache.cassandra.metrics
type: Compaction
name: name of metric

JMX Object Name

org.apache.cassandra.metrics:type=Compaction,name=(Metric name)

Metrics

CompletedTasks : Estimated number of completed compaction tasks.

PendingTasks : Estimated number of pending compaction tasks.

BytesCompacted : Number of bytes compacted since node started.

TotalCompactionsCompleted : Estimated number of completed compaction tasks.

Connection (1 global metrics, 6 metrics / connection)

Codahale Metric Name

group: org.apache.cassandra.metrics
type: Connection
scope: IP address (if not global metrics)
name: name of metric

JMX Object Name

org.apache.cassandra.metrics:type=Connection,name=(Metric name)
org.apache.cassandra.metrics:type=Connection,scope=(IP address),name=(Metric name)

Metrics (Global)

TotalTimeouts : Total number of timeouts occurred for this node.

Metrics (Per connection)

CommandPendingTasks : Number of messages to send.

CommandCompletedTasks : Number of messages sent.

CommandDroppedTasks : Number of messages dropped.

ResponsePendingTasks : Number of messages to respond.

ResponseCompletedTasks : Number of messages responded.

Timeout : Number of timeouts occurred for this connection.

Dropped Message (1 metrics/droppable message)

Codahale Metric Name

group: org.apache.cassandra.metrics
type: DroppedMessage
scope: Verb of droppable message
name: name of metric

JMX Object Name

org.apache.cassandra.metrics:type=DroppedMessage,scope=(Verb),name=(Metric name)

Metrics

Dropped : Total number of dropped message for this verb.

Streaming (3 global metrics, 2 metrics / connection)

Codahale Metric Name

group: org.apache.cassandra.metrics
type: Streaming
scope: IP address (if not global metrics)
name: name of metric

JMX Object Name

org.apache.cassandra.metrics:type=Streaming,name=(Metric name)
org.apache.cassandra.metrics:type=Streaming,scope=(IP address),name=(Metric name)

Metrics (Global)

ActiveOutboundStreams : Currently active outbound streams.

TotalIncomingBytes : Total incoming bytes received since node started.

TotalOutgoingBytes : Total outgoing bytes sent since node started.

Metrics (Per connection)

IncomingBytes : Incoming bytes received from specific node.

OutgoingBytes : Outgoing bytes sent to specific node.

Storage (1 metric)

Codahale Metric Name

group: org.apache.cassandra.metrics
type: Storage
name: name of metric

JMX Object Name

org.apache.cassandra.metrics:type=Storage,name=(Metric name)

Metrics

Load : Total disk space used (in bytes) for this node.

Thread Pool (5 metrics/thread pool)

Codahale Metric Name

group: org.apache.cassandra.metrics
type: ThreadPool
scope: name of thread pool

(path) is either internal or request, based on the usage of thread pool.

JMX Object Name

org.apache.cassandra.metrics:type=ThreadPool,path=(type),scope=(Thread pool name),name=(Metric name)

Metrics

ActiveTasks : Approximate number of tasks thread pool is actively executing.

CompletedTasks : Approximate total number of tasks thread pool has completed execution.

CurrentlyBlockedTasks : Number of currently blocked tasks.

PendingTasks : Approximate number of pending tasks thread pool has.

TotalBlockedTasks : Total number of blocked tasks since node start up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment