Method

ShellPerfLogdefine_statistic

Declaration [src]

void
shell_perf_log_define_statistic (
  ShellPerfLog* perf_log,
  const char* name,
  const char* description,
  const char* signature
)

Description [src]

Defines a statistic. A statistic is a numeric value that is stored by the performance log and recorded periodically or when shell_perf_log_collect_statistics() is called explicitly.

Code that defines a statistic should update it by calling the update function for the particular data type of the statistic, such as shell_perf_log_update_statistic_i(). This can be done at any time, but would normally done inside a function registered with shell_perf_log_add_statistics_callback(). These functions are called immediately before statistics are recorded.

Parameters

name

Type: const char*

Name of the statistic and of the corresponding event. This should follow the same guidelines as for shell_perf_log_define_event()

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
description

Type: const char*

Human readable description of the statistic.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
signature

Type: const char*

The type of the data stored for statistic. Must currently be ‘i’ or ‘x’.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.