Resources

class Resources(processes: Map<String, Long>, containers: List<String>, mongoContainer: String?, postgresContainer: String?, postgresDatabase: String, kafkaContainer: String?)

The cost of a run, captured beside it over its measured phase:

  • each server JVM (processes, name to pid): its CPU time and resident memory every second (/proc on Linux, ps elsewhere), its garbage collector and heap from jstat -gc, one sampling process per JVM, and the bytes it allocated (Allocations), so the results give bytes per operation beside CPU;

  • each container (containers): its CPU and memory from one docker stats stream;

  • the stores' operation counters: MongoDB's serverStatus().opcounters (mongoContainer) and PostgreSQL's pg_stat_database of postgresDatabase with pg_stat_wal (postgresContainer), each from one session that prints them every second, and the end offsets of every Kafka topic (kafkaContainer).

Nothing starts inside the measured phase (B.O-2): prepare, at the warm-up, starts every sampling process, opens the allocation connections and reads the Kafka offsets once (kafka-get-offsets is a JVM of its own); start and stop only read what is already running, and complete, after the drain, reads the Kafka offsets again. The stores' counters at the phase's edges are the samples nearest to them; PostgreSQL's also give a per-second series of commits and WAL writes and flushes (B.O-3). The samplers are a few percent of a core; the results say what they were.

Constructors

Link copied to clipboard
constructor(processes: Map<String, Long>, containers: List<String>, mongoContainer: String?, postgresContainer: String?, postgresDatabase: String, kafkaContainer: String?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

What stop captured, once it has; complete adds the Kafka offsets.

Functions

Link copied to clipboard
fun complete()

After the drain: the Kafka offsets again (a JVM of its own, so outside the measured phase), added to stopped.

Link copied to clipboard

Every process's cumulative CPU seconds, read as cpu reads them.

Link copied to clipboard
fun prepare()

Starts every sampling process and opens the allocation connections, at the warm-up: the first attach starts a JVM's management agent, and mongosh, psql and jstat take a moment to start, none of which may land in the measured phase. The Kafka offsets are read last, once.

Link copied to clipboard
fun start()

The measured phase starts: reads what prepare started, and launches nothing.

Link copied to clipboard
fun stop(): Map<String, Any?>

The measured phase ends: gives back what the samplers captured over it, for the results.