The sstore_data_attach() Interface

The sstore_data_attach() interface creates a shared memory region between sstored and the client process. Call sstore_data_attach() only one time during the runtime of the client process.

The sstore_data_attach() interface supports only integer statistic values, particularly counters. The sstore_data_attach() interface creates a shared memory region with one counter for each statistic. The values in this shared memory region are initialized to 0. To update the statistics store, update the shared memory region array element for that statistic. For sstore_data_attach(), updating statistic values typically means incrementing the counter for that statistic.

When these statistic values are requested, sstored attempts to read from the shared memory region once each second, regardless of how quickly the application updates the value.

See Adding Simple Data Values to the Statistics Store for example applications that use sstore_data_attach().