Up: STStats: The Telemetry Container   [Contents]


B.7.1.1 Metric Accessors

Borrowed get_* entries are valid only under the affinity-thread rules documented in starter/stats.h. Prefer st_stats_get_full or st_stats_dup for snapshots across threads.

Function: const STStatsEntry * st_stats_get_vmsize (const STStats *self)

Reads the Virtual memory size entry.

self

Stats object.

Returns: Borrowed STStatsEntry pointer.

Function: void st_stats_set_vmsize (STStats *self, const STStatsEntry *v)

Replaces the Virtual memory size entry and may queue the changed signal.

self

Stats object.

v

New entry contents.

Returns: Nothing.

Function: const STStatsEntry * st_stats_get_vmrss (const STStats *self)

Reads the Resident set size entry.

self

Stats object.

Returns: Borrowed STStatsEntry pointer.

Function: void st_stats_set_vmrss (STStats *self, const STStatsEntry *v)

Replaces the Resident set size entry and may queue the changed signal.

self

Stats object.

v

New entry contents.

Returns: Nothing.

Function: const STStatsEntry * st_stats_get_vmswap (const STStats *self)

Reads the Swap usage entry.

self

Stats object.

Returns: Borrowed STStatsEntry pointer.

Function: void st_stats_set_vmswap (STStats *self, const STStatsEntry *v)

Replaces the Swap usage entry and may queue the changed signal.

self

Stats object.

v

New entry contents.

Returns: Nothing.

Function: const STStatsEntry * st_stats_get_io_read (const STStats *self)

Reads the Bytes read entry.

self

Stats object.

Returns: Borrowed STStatsEntry pointer.

Function: void st_stats_set_io_read (STStats *self, const STStatsEntry *v)

Replaces the Bytes read entry and may queue the changed signal.

self

Stats object.

v

New entry contents.

Returns: Nothing.

Function: const STStatsEntry * st_stats_get_io_write (const STStats *self)

Reads the Bytes written entry.

self

Stats object.

Returns: Borrowed STStatsEntry pointer.

Function: void st_stats_set_io_write (STStats *self, const STStatsEntry *v)

Replaces the Bytes written entry and may queue the changed signal.

self

Stats object.

v

New entry contents.

Returns: Nothing.

Function: const STStatsEntry * st_stats_get_priority (const STStats *self)

Reads the Process priority / nice entry.

self

Stats object.

Returns: Borrowed STStatsEntry pointer.

Function: void st_stats_set_priority (STStats *self, const STStatsEntry *v)

Replaces the Process priority / nice entry and may queue the changed signal.

self

Stats object.

v

New entry contents.

Returns: Nothing.

Function: const STStatsEntry * st_stats_get_threads (const STStats *self)

Reads the Thread count entry.

self

Stats object.

Returns: Borrowed STStatsEntry pointer.

Function: void st_stats_set_threads (STStats *self, const STStatsEntry *v)

Replaces the Thread count entry and may queue the changed signal.

self

Stats object.

v

New entry contents.

Returns: Nothing.

Function: const STStatsEntry * st_stats_get_icswitch (const STStats *self)

Reads the Involuntary context switches entry.

self

Stats object.

Returns: Borrowed STStatsEntry pointer.

Function: void st_stats_set_icswitch (STStats *self, const STStatsEntry *v)

Replaces the Involuntary context switches entry and may queue the changed signal.

self

Stats object.

v

New entry contents.

Returns: Nothing.

Function: const STStatsEntry * st_stats_get_cpu (const STStats *self)

Reads the CPU usage percentage entry.

self

Stats object.

Returns: Borrowed STStatsEntry pointer.

Function: void st_stats_set_cpu (STStats *self, const STStatsEntry *v)

Replaces the CPU usage percentage entry and may queue the changed signal.

self

Stats object.

v

New entry contents.

Returns: Nothing.

Function: void st_stats_get_full (const STStats *self, const gchar **name, STStatsEntry *vmsize, STStatsEntry *vmrss, STStatsEntry *vmswap, STStatsEntry *io_read, STStatsEntry *io_write, STStatsEntry *priority, STStatsEntry *threads, STStatsEntry *icswitch, STStatsEntry *cpu)

Copies a consistent snapshot of all metrics into caller-provided storage. Any out-parameter may be NULL to skip that field.

self

Stats object.

name

Out: borrowed name pointer, or NULL to skip.

vmsize

Out: virtual size entry, or NULL.

vmrss

Out: RSS entry, or NULL.

vmswap

Out: swap entry, or NULL.

io_read

Out: I/O read entry, or NULL.

io_write

Out: I/O write entry, or NULL.

priority

Out: priority entry, or NULL.

threads

Out: threads entry, or NULL.

icswitch

Out: context-switch entry, or NULL.

cpu

Out: CPU entry, or NULL.

Returns: Nothing.

Function: void st_stats_set_full (STStats *self, const gchar *name, const STStatsEntry *vmsize, const STStatsEntry *vmrss, const STStatsEntry *vmswap, const STStatsEntry *io_read, const STStatsEntry *io_write, const STStatsEntry *priority, const STStatsEntry *threads, const STStatsEntry *icswitch, const STStatsEntry *cpu)

Replaces name and metric entries in one call. Pass NULL for fields you do not wish to supply.

self

Stats object.

name

New label, or NULL.

vmsize

New virtual size, or NULL.

vmrss

New RSS, or NULL.

vmswap

New swap, or NULL.

io_read

New I/O read, or NULL.

io_write

New I/O write, or NULL.

priority

New priority, or NULL.

threads

New threads, or NULL.

icswitch

New context switches, or NULL.

cpu

New CPU, or NULL.

Returns: Nothing.

Signal: STStats changed ()

Emitted on the notify context when metrics update (coalesced).


Up: STStats: The Telemetry Container   [Contents]