Interfaces for Providing Statistic Values

Use one of the following interfaces to write data values to the statistics store from your applications:

  • sstore_data_attach

  • sstore_data_update

  • sstore_data_bulk_update

All of these interfaces are available for both C and Python. See the libsstore(3LIB), sstore_data_attach(3SSTORE), libsstore(python), and sstore(3rad) man pages.

All of these interfaces perform the following tasks:

  • Enable any static resources in any of the specified SSIDs that are not currently enabled.

  • Mark affected resources as actively provided.

Use the sstore_data_attach_histogram() interface to record the number of times your statistic values occur within predefined ranges or intervals. The sstore_data_attach_histogram() interface can be used only with one of the three interfaces listed above.

See the libsstore(3LIB) man page for the complete list of statistics store interfaces. Interfaces in the libsstore library provide the following capabilities:

  • List statistic and event identifiers

  • Update values for statistics

  • Read statistic and event value data and metadata

  • Add resources and resource-specific metadata to the statistics store

  • Remove resources

  • Add resource topology to the statistics store by using the metadata argument of sstore_resource_add()

To update data statistic values periodically, consider using an SMF periodic service, probably with the sstore_bulk_update() interface. For more information about periodic services, see Chapter 3, Creating a Service to Run Periodically in Developing System Services in Oracle Solaris 11.4.

Note that updating statistic values does not add the updated value to the statistics store. The statistics store accumulates data values only when requested by a client. The requesting client can be the sstore capture command or sstore_data_read(). The following clients use sstore_data_read() to request statistic values:

  • A sheet that contains the statistic in the System Web Interface

  • An application that calls sstore_data_read()

  • An enabled collection

Updated statistic values continue to be written to the statistics store for a short time after the last request or until the application that is updating the values stops providing updates.