NodeMetrics

class NodeMetrics(node: ServiceNode, meters: MeterRegistry, sampler: NodeSampler)

The gauges of a node that are read, not heard, set in meters from each of the node's samples (sampler):

  • WowMetrics.PARKED_AGGREGATES: how many entries each subscription of each group has parked, as the node's ledgers list them (ServiceNode.parked), counted up to the sampler's cap (wow.node.max-parked): a count past it reads as the cap, so a flood of parked entries costs one bounded read per sample, shared with the node's health. The ledgers are the service's, shared by its nodes, so one node reports them (reportsParked): the one that runs partition 0 of the service's first log group (by context name), or every node of a service without one. Summed across nodes, the count is the service's once.

  • WowMetrics.POSITION, WowMetrics.BACKLOG and WowMetrics.PROGRESS: for each subscription of each log group, in each partition it runs on this node (me.ahoo.wow.runtime.subscription.SubscriptionRuntime.positions), its watermark, the entries of the log after it, and the watermark over the log's head: how far a rebuild (a subscription under a new name, from the beginning) has come.

  • WowMetrics.PAUSED_PARTITIONS and WowMetrics.THROTTLED_PARTITIONS: for each subscription of each log group that runs here, and each intake or other context's topic that has one (ServiceNode.pauses, ServiceNode.throttled), how many of its partitions on this node it has paused on a systemic failure, or throttles on backpressure: 0 while it runs them all, so one series per subscription, not one per partition.

  • WowMetrics.EXECUTOR_IN_FLIGHT, WowMetrics.EXECUTOR_LANES and WowMetrics.APPEND_QUEUE_DEPTH, per context: the commands in its executor, the aggregates with commands in flight, and the appends queued on its partitions, which show a store slowing down before the node refuses commands as busy.

  • WowMetrics.ACCESS_WALK_PENDING and WowMetrics.ACCESS_WALK_WALKED, per context and aggregate type: 1 until the access walk of the type of this node's access schema has completed, and the aggregates it has stamped, as this node last read its log (me.ahoo.wow.runtime.access.AccessWalking.ownWalk); while the log records another schema's walk, which it keeps while a node of that schema is left, 1 and 0. Every node reads the one record, so each node of one schema reports the same.

A gauge a sample no longer takes (a partition handed off to another node, the parked count of a node that no longer reports it) is removed from meters, so it does not report its last value forever. One whose subject is still there but that the sample could not read (a ledger's count or a log's heads failing or slower than the read timeout, NodeSample.unreadParked, NodeSample.unreadHeads) keeps its last value until a sample reads it again, so an alert on it neither clears nor fires by itself; the sampler logs the read's failure as it starts and as it ends.

The sampler's owner starts and closes it; these gauges follow each of its samples.

Constructors

Link copied to clipboard
constructor(node: ServiceNode, meters: MeterRegistry, sampler: NodeSampler)

Types

Link copied to clipboard

Functions

Link copied to clipboard

Whether this node reports the service's parked entries: it runs partition 0 of the service's first log group, by context name, so one node of the service does at a time; every node of a service without a log group does.

Link copied to clipboard
suspend fun sample()

Takes one sample of the node (NodeSampler.sample), which sets every gauge.