Comparing Methods for Providing Statistic Values

Whether you use the sstore_data_attach() or sstore_data_update() API depends on the data type, the frequency of additions, and the importance of the time stamp of each value.

Table 1-1 sstore_data_attach() and sstore_data_update() Comparison

Feature sstore_data_attach() sstore_data_update()

Architecture

Writes statistic values to memory space that is shared between the application and the statistics store.

Writes statistic values directly to the statistics store.

Statistic data type

Integer, especially a counter

Any type

Initial data value

0

Specified value

Time stamp

When the data is requested by the statistics store client

When the data is collected by the application

Use sstore_data_attach() if the statistic values are integer and if the time the value was collected is not needed. Statistic value time stamps in this case are the time that the statistics store retrieves the values from the shared memory area. The sstore_data_attach() method is also recommended if you need to make large numbers of data updates per time period.

Use sstore_data_update() if the statistic values are not numeric or if the exact time the data was collected is needed. You must use the sstore_data_update() method if multiple statistic values must be updated simultaneously such that each statistic value must have the same time stamp.

See the following sections for more information about sstore_data_attach(), sstore_data_update(), sstore_data_bulk_update(), and sstore_data_attach_histogram(). See also the sstore_data_attach(3SSTORE) man page and the sstore_data_read(3SSTORE) man page.