BenchPipeline

class BenchPipeline(sections: () -> Map<String, Map<String, Number>>?) : AutoCloseable

The saga pipeline's depths and the append queue's calls, logged once a second as bench-pipeline {json} at WARN, only with bench.pipeline.enabled=true (off by default, so every other run measures a node that counts none of it): where a command's chain queues between one commit and the next, which the executor's in-flight count does not see. One line a second for the node, the shape of bench-signals' and bench-query-limits': {"t": <seconds since start>, "<section>": {"<field>": <number>, …}, …}, every value a number, so a reader takes a section it knows and passes over one it does not. A section is left out while the node has nothing for it.

  • appendDepth, now, summed over the contexts: queued, the appends not taken into a batch yet (the wow.log.append_queue.depth gauge's read); handedGroups and handedStreams, the lanes' groups handed to the committers and not yet taken into a call.

  • appendCalls, cumulative from this line's first read: calls to the log, the streams they carried, and the calls full at their cap (mergeMax merged). Streams over calls between two lines is the mean call of that second.

  • appendClock, cumulative from this line's first read, in microseconds summed over the calls (the queue's CallClock): the calls clocked, each one's call from its group taken to the log's call returned and its complete from there to its outcomes handed back and its committer free; over the marked calls (those whose log marks the instants only it sees, PostgreSQL's and MongoDB's groups), enter to the log's call, hop to the thread of its blocking work, acquire to its connection (MongoDB's driver checks one out within each command, so none there), bind to its first statement or command sent (its tables found, its statement prepared, its streams' parameters bound and encoded; on MongoDB its documents built and sequenced), statement to its last result read, release to its connection given back, and hopBack to the call returned, which sum to their call; and, over the commanded calls (MongoDB's, whose driver reports each command's time to this line's listener), command, the driver's own time of the commands within statement, so statement less command is the driver's work around them (a command's encoding, a connection's check-out); and, of bind, where the log tells (MongoDB's group), encode, the streams' documents built, and lookup, the lookups of an aggregate's last sequence it did not remember, so bind less both is the sequencing, and bindCommand over bindCommands, the driver's time of the commands sent while building (its counter writes and lookups). Each between two lines, over that second's calls, is the mean of a call's step.

  • snapshotClock, cumulative from this line's first read, the same for the snapshot subscriptions' writes (each subscription's SnapshotWrites, a write one saveAll of a leader's batch): the saves the leaders took and the snapshots they wrote (an aggregate's highest version a write), writing now (the leaders in a store's call), allowed now (how many may lead: the store's writes in flight, or its catch-up count while the writes are behind), and the clock's fields. A write's call runs from its batch taken to the store's call returned (a failed batch's saves again alone among it), complete to its saves ended; on PostgreSQL the transaction's commit is in release. Of the entries handled without a view, the loads of their snapshots in loadCalls of the store, and the tails, the log's reads of a rebuild or of an aggregate's first stream: the round trips a snapshot written cost.

  • handoff, cumulative from the node's start: the entries the tails delivered from memory and their storeReads.

  • window and windowMax, now, per subscription: the entries its workers took above their watermarks, summed over the partitions and the largest one partition's, against its in-flight bound (wow.subscription.max-in-flight).

  • pool, now, the store's connection pool: on PostgreSQL, HikariCP's active and idle connections, the threads waiting for one and its max (its public pool MXBean; the server sets no size, so HikariCP's default of 10 is every append, snapshot write, checkpoint, tail read and load of the node); on MongoDB, the check-outs waiting and a server pool's max (MongoPoolGauge, which the client is built with). pool.<bean> for each, when there are several.

  • outcomes, cumulative from the node's start: what the node names to its observers, counted by BenchOutcomes, the line's one observer: the commands that arrived and were refused, the forwards taken from peers and those that failed by outcome, the executions, the appends' outcomes and the state cache's.

Every read is of an atomic or volatile field, with no lock taken on the path a command or an entry runs. The append queue counts its calls and handed groups only once read (PartitionAppendQueue.counts): an atomic add per call and per group, none per append; while read, each call also carries its marks (StoreCallMarks, nine clock reads) in its coroutine context, which the log marks and the queue sums, thirteen adds a call. The snapshot writes count the same way, once read (SnapshotSubscription.writeCounts): three adds and a clock a write, none per save. With the line on, the server's MongoDB client is built with the command listener (commandClock), which the driver then calls for every command of the node; it adds to a call's marks only while the call holds them. The hand-off's channels have no depth to read without a count on every entry, and the throttle's waiters are behind its monitor, so neither is here; the throttled partitions are the partitionThrottled less partitionUnthrottled of bench-signals.

The node's queues are Wow's internal API, which an application does not use (the architecture's internal opt-in rule): this class is the benchmark server's one exception, a reader of the node it measures that calls nothing on its write path. No other class of the server names those types, so a change to them breaks this file alone.

Constructors

Link copied to clipboard
constructor(sections: () -> Map<String, Map<String, Number>>?)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard

The sections as one JSON object, in their order; null when there are none.

Link copied to clipboard
fun start()