Dashboard Metrics

From MemCP
Revision as of 11:59, 28 August 2026 by Wikiservice (talk | contribs) (Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Dashboard Metrics

Generated from MemCP commit c42e19eba on 27 August 2026. See Full SCM API documentation.

The Dashboard Metrics module exposes process-local observations used by operational displays and diagnostics. Metrics cover CPU activity, active connections, recent connection peaks, and request rate.

Values describe the current MemCP process and recent in-memory sampling windows; they are not durable monitoring history and do not aggregate a multi-node cluster. Export or poll them through an external monitoring system when long-term retention and alerting are required.

cpu_usage

Returns current CPU usage as a percentage (0-100)

Allowed number of parameters: 0–0

Parameters

This function has no parameters.

Returns

  • value (number)

active_connections

Returns the current number of active HTTP connections

Allowed number of parameters: 0–0

Parameters

This function has no parameters.

Returns

  • value (int)

max_connections

Returns the maximum number of HTTP connections over the last 10 minutes

Allowed number of parameters: 0–0

Parameters

This function has no parameters.

Returns

  • value (int)

requests_per_second

Returns the average number of HTTP requests per second over the last 10 seconds

Allowed number of parameters: 0–0

Parameters

This function has no parameters.

Returns

  • value (number)

newcachemap

Creates a new cachemap. Returns a threadsafe key-value function with LRU eviction under memory pressure: (cachemap key value) sets, (cachemap key) gets, (cachemap) lists keys, (cachemap "get_or_compute" key producer) computes one value for concurrent misses of the same key.

Allowed number of parameters: 0–0

Parameters

This function has no parameters.

Returns

  • cachemap (func): thread-safe cache accessor
    • Parameters
      • key_or_operation (any): cache key, or get_or_compute (optional)
      • value_or_key (any): value to store, or key for get_or_compute (optional)
      • producer (func): zero-argument value producer used by get_or_compute (optional)
        • Returns
          • value (any)
    • Returns
      • result (any): cached value, previous value, or key list depending on the operation