[#BloombergLP-balm-MetricSample] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::MetricSample :relfileprefix: ../../ :mrdocs: This class provides an _in‐core_ value‐semantic representation of a sample of metric values. == Synopsis Declared in `<balm_metricsample.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class MetricSample; ---- == Description The class contains a collection of addresses to (external) `MetricRecord` objects holding the values for their respective metrics (aggregated over some period of time). The metric records contained by a sample are broken into a series of groups, which are represented by `MetricSampleGroup` objects. Each group contains a sequence of records and an elapsed time value, indicating the period of time over which those records were taken. This class also provides a timestamp value, used to indicate when the sample was collected. The class provides a method, `appendGroups`, that appends a group of metric records to the sample. Arrays supplied using `appendGroups` must be valid for the productive lifetime of the `MetricSample` object or until they are removed by calling `removeAllRecords`. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/MetricSample/const_iterator.adoc[`const_iterator`] | A `const_iterator` is an alias for an iterator over the non‐modifiable sample groups contained in a `MetricSample`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/MetricSample/2constructor-0f.adoc[`MetricSample`] [.small]#[constructor]# | Constructors | xref:BloombergLP/balm/MetricSample/2destructor.adoc[`~MetricSample`] [.small]#[destructor]# | Destroy this metric sample. | xref:BloombergLP/balm/MetricSample/operator_assign.adoc[`operator=`] | Assign to this sample the value of the specified `rhs` sample. | xref:BloombergLP/balm/MetricSample/appendGroup-0c.adoc[`appendGroup`] | `appendGroup` overloads | xref:BloombergLP/balm/MetricSample/begin.adoc[`begin`] | Return an iterator positioned at the beginning of the sequence of `MetricSampleGroup` objects contained by this object. | xref:BloombergLP/balm/MetricSample/end.adoc[`end`] | Return an iterator positioned one past the final `MetricSampleGroup` object in the sequence of sample groups contained by this object. | xref:BloombergLP/balm/MetricSample/numGroups.adoc[`numGroups`] | Return the number of record groups (i.e., `MetricSampleGroup` objects) that are contained in this object. | xref:BloombergLP/balm/MetricSample/numRecords.adoc[`numRecords`] | Return the total number of records in this sample (i.e., the sum of the lengths of all the appended record groups). | xref:BloombergLP/balm/MetricSample/print.adoc[`print`] | Format this object to the specified output stream. | xref:BloombergLP/balm/MetricSample/removeAllRecords.adoc[`removeAllRecords`] | Remove all metric records from this sample. | xref:BloombergLP/balm/MetricSample/sampleGroup.adoc[`sampleGroup`] | Return a reference to the non‐modifiable `MetricSampleGroup` object at the specified `index` in this sample. | xref:BloombergLP/balm/MetricSample/setTimeStamp.adoc[`setTimeStamp`] | Set the timestamp (used to indicate when the sample was taken) to the specified `timeStamp`. | xref:BloombergLP/balm/MetricSample/timeStamp.adoc[`timeStamp`] | Return a reference to the non‐modifiable timestamp for this sample. | xref:BloombergLP/balm/MetricSample/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<MetricSample, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/balm/operator_eq-0d.adoc[BloombergLP::balm::operator==]` | Return `true` if the specified `lhs` and `rhs` samples have the same value, and `false` otherwise. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/operator_not_eq-0d.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` samples do not have the same value, and `false` otherwise. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#