stats_parser()

stats_parser()#

stats_parser() generates a JSON-formatted statistical report by extracting relevant attributes from the given hgobj instance and formatting them into a structured response.

Prototype

json_t *stats_parser(
    hgobj       gobj,
    const char *stats,
    json_t    *kw,
    hgobj       src
);

Parameters

Key

Type

Description

gobj

hgobj

The hgobj instance from which statistics are extracted.

stats

const char *

A string specifying which statistics to retrieve. If NULL, all available statistics are included.

kw

json_t *

A JSON object containing additional parameters. Ownership is transferred to stats_parser().

src

hgobj

The source hgobj that initiated the request.


Return Value

A JSON object containing the formatted statistical report. The caller assumes ownership of the returned object.

Notes

Internally, stats_parser() calls build_stats() to generate the statistical data. The function wraps the generated statistics in a standard command response format before returning.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples