Load into the specified sample a metric sample collected from the indicated categories, and append to records those collected records which are referred to by sample. Optionally specify a sequence of categories of length numCategories. If a sequence of categories is not supplied, a sample is collected from all registered categories. Optionally specify a resetFlag that determines if the collected metrics are reset as part of this operation. This operation will collect aggregated metric values for each enabled category in the indicated categories from registered callbacks as well as from its own CollectorRepository, and then append those values to records and update sample with the addresses of those collected records. If resetFlag is true, the metrics being collected are reset to their default state. This operation also populates the sample with the time interval is computed as the elapsed time since the interval over which the sampled metrics were collected. This last time the metrics were reset (either through a call to the publish or collectSample methods). If category has not previously been reset then this interval is taken to be the elapsed time since the creation of this metrics manager. The behavior is undefined unless 0 <= numCategories, categories refers to a contiguous sequence of (at least) numCategories, and each category in categories appears only once. Note that sample is loaded with the addresses of the metric records appended to records, and modifying records after this call returns may invalidate sample.
Synopsis
Declared in <balm_metricsmanager.h>
void
collectSample(
MetricSample* sample,
bsl::vector<MetricRecord>* records,
bool resetFlag = false);
Created with MrDocs