Go to main content

man pages section 3: Extended Library Functions, Volume 4

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

sstore_info_iter_next (3SSTORE)

Name

sstore_info_read, sstore_info_iter_next - Read meta information about statistics store identifiers.

Synopsis

    cc [ flag... ] file... -lsstore [ library... ]
     #include <libsstore.h>

     sstore_err_t sstore_info_read(sstore_handle_t hdl,
         const char **ids, uint32_t id_count,
         sstore_range_t range, sstore_iter_t *iterp);

     sstore_err_t sstore_info_iter_next(sstore_handle_t hdl,
         sstore_iter_t iter, char **idp, uint64_t *timep,
         sstore_value_t *valp);
  

Parameters

hdl

Handle to libsstore

ids

Array of statistics store identifiers

id_count

Total number of statistics store identifiers

range

Time range or data range.

Passing NULL for range implies:

  • start-time = SS_TIME_NOW

  • end-time = SS_TIME_NOW

  • step = 1

iterp

Address to store the starting address of the iterator.

iter

Iterator returned from data_read().

idp

Address to store the starting address of the statistics store identifier.

timep

Address to store the time in microseconds since epoch.

valp

Address to store the handle to a typed value.

Description

sstore_info_read() retrieves the metadata associated with the given identifiers and range. The retrieved data is returned in the form of an iterator that can be used to read the information records. When all the information records have been read from the iterator, use sstore_iter_free(3SSTORE) to free the iterator.

sstore_info_iter_next() retrieves the next information record of the iteration. Each information record consists of a statistics store identifier, a time stamp, and a value. The reference pointers passed to this call are populated if the call succeeds. The identifier, the time stamp, and the value populated on success do not need to be freed. They will be freed on the next call to sstore_info_iter_next().

Return Values

Upon successful completion, sstore_info_read() and sstore_info_iter_next() return ESSTORE_OK. Otherwise, they return an error code, which is also cached in the given libsstore handle.

Errors

The sstore_info_read() function will fail if:

ESSTORE_ARG_INVALID

One of the following reasons:

  • All the ssids are invalid.

  • All the ssids are inactive.

  • The range is not valid.

  • The fmt is not valid.

  • Required arguments are missing.

ESSTORE_HANDLE_INVALID

The handle is invalid

ESSTORE_RETRY

The statistics store daemon is busy. Retry later

ESSTORE_CONNECTION_FAILED

Failed to connect to the statistics store daemon

ESSTORE_TOO_BIG

The total size of all the resulting statistics records is larger than the maximum size limit set in libsstore.

ESSTORE_NOMEM

No memory is available.

The sstore_info_iter_next() function will fail if:

ESSTORE_ARG_INVALID

Some arguments are invalid.

ESSTORE_HANDLE_INVALID

The handle is invalid

ESSTORE_ITER_DONE

No more records left to iterate.

Warnings

Possible warning codes for sstore_info_read() are as follows:

SS_WARN_INVALID

An ssid is invalid.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
Safe

See Also

libsstore(3LIB), sstore_alloc(3SSTORE), sstore_err_action(3SSTORE), sstore_range_alloc(3SSTORE), attributes(7), ssid(7)