Observability

What the server is spending its time on: the slow log, latency monitoring and hot keys.

19 commands in KiviDB 1.2.2. Every command.

  • HOTKEYS: HOTKEYS finds the keys that cost the server the most over a period: the CPU time spent on the commands that name them, the network bytes those commands read and wrote, or both.
    • HOTKEYS GET: Returns the current or latest session: whether it is still running, its settings, its totals, and the top keys by CPU time (by-cpu-time-us) and by network bytes (by-net-bytes).
    • HOTKEYS HELP: Lists the HOTKEYS subcommands, with their arguments and a line on what each does: START and its options, STOP, GET, RESET and HELP itself.
    • HOTKEYS RESET: Discards the results of a stopped HOTKEYS session, so that HOTKEYS GET returns nil again.
    • HOTKEYS START: Starts a session that tracks, per key, the metrics named: CPU (CPU time) and NET (network bytes).
    • HOTKEYS STOP: Stops the running HOTKEYS session.
  • LATENCY: The latency monitor: it records, for each kind of event, the times it took longer than latency-monitor-threshold milliseconds, which is 0, off, by default.
    • LATENCY DOCTOR: Reports, in words, the events whose latest samples were slow: as warnings from 100 ms, as critical from 500 ms.
    • LATENCY GRAPH: Draws an event's samples as a small text chart, with the highest and lowest.
    • LATENCY HELP: Lists the LATENCY subcommands, with their arguments and a line on what each does: DOCTOR, GRAPH, HISTORY, LATEST, RESET, HISTOGRAM and HELP itself.
    • LATENCY HISTOGRAM: Returns, for each command named, or every command called, its number of calls and how many of them took less than each power of two of microseconds.
    • LATENCY HISTORY: Returns the samples the latency monitor has recorded for one event, oldest first: for each, the Unix time in seconds and how many milliseconds it took.
    • LATENCY LATEST: Returns each event's latest sample: the event, the Unix time, the milliseconds it took, and the most any of its samples took.
    • LATENCY RESET: Clears what the latency monitor has recorded: the samples of every event, or, with names, of those events only.
  • SLOWLOG: The slow log: the commands that took longer than slowlog-log-slower-than microseconds to run, up to slowlog-max-len entries (128 by default).
    • SLOWLOG GET: Returns the newest entries of the slow log: 10, count, or all of them with -1.
    • SLOWLOG HELP: Lists the SLOWLOG subcommands, with their arguments and a line on what each does: GET, with the fields of an entry, LEN, RESET and HELP itself.
    • SLOWLOG LEN: Returns how many entries the slow log holds now.
    • SLOWLOG RESET: Empties the slow log: SLOWLOG GET and SLOWLOG LEN start again from nothing.