BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balm_metricsample.h
Go to the documentation of this file.
1/// @file balm_metricsample.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// balm_metricsample.h -*-C++-*-
8#ifndef INCLUDED_BALM_METRICSAMPLE
9#define INCLUDED_BALM_METRICSAMPLE
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup balm_metricsample balm_metricsample
15/// @brief Provide a container for a sample of collected metric records.
16/// @addtogroup bal
17/// @{
18/// @addtogroup balm
19/// @{
20/// @addtogroup balm_metricsample
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#balm_metricsample-purpose"> Purpose</a>
25/// * <a href="#balm_metricsample-classes"> Classes </a>
26/// * <a href="#balm_metricsample-description"> Description </a>
27/// * <a href="#balm_metricsample-alternative-systems-for-telemetry"> Alternative Systems for Telemetry </a>
28/// * <a href="#balm_metricsample-thread-safety"> Thread Safety </a>
29/// * <a href="#balm_metricsample-usage"> Usage </a>
30/// * <a href="#balm_metricsample-example-1-basic-usage"> Example 1: Basic Usage </a>
31///
32/// # Purpose {#balm_metricsample-purpose}
33/// Provide a container for a sample of collected metric records.
34///
35/// # Classes {#balm_metricsample-classes}
36///
37/// - balm::MetricSampleGroup: a group of records describing the same time period
38/// - balm::MetricSample: a sample of collected metric records
39///
40/// @see balm_publisher, balm_metricrecord
41///
42/// # Description {#balm_metricsample-description}
43/// This component provides a container used to store a sample of
44/// recorded metric information. A `balm::MetricSample` contains a collection
45/// of addresses to (external) `balm::MetricRecord` objects containing the
46/// aggregated record values for a series of metrics. The records in a sample
47/// are broken into a series of groups, each group is represented by a
48/// `balm::MetricSampleGroup` object. Each `balm::MetricSampleGroup` contains
49/// a sequence of records and an elapsed time value, indicating the time period
50/// over which those records were collected. Finally, a `balm::MetricSample`
51/// object contains a timestamp value used to indicate when the sample was
52/// taken.
53///
54/// ## Alternative Systems for Telemetry {#balm_metricsample-alternative-systems-for-telemetry}
55///
56///
57/// Bloomberg software may alternatively use the GUTS telemetry API, which is
58/// integrated into Bloomberg infrastructure.
59///
60/// ## Thread Safety {#balm_metricsample-thread-safety}
61///
62///
63/// `balm::MetricSample` and `balm::MetricSampleGroup` are both *const*
64/// *thread-safe*, meaning that accessors may be invoked concurrently from
65/// different threads, but it is not safe to access or modify an object in one
66/// thread while another thread modifies the same object.
67///
68/// ## Usage {#balm_metricsample-usage}
69///
70///
71/// This section illustrates intended use of this component.
72///
73/// ### Example 1: Basic Usage {#balm_metricsample-example-1-basic-usage}
74///
75///
76/// The following example demonstrates how to create and use a metric sample.
77/// We start by initializing several `balm::MetricRecord` values, which we will
78/// add to the sample. Note that in this example we create the `balm::MetricId`
79/// objects by hand; however, in practice ids should be obtained from a
80/// `balm::MetricRegistry` object (such as the one owned by a
81/// `balm::MetricsManager`).
82/// @code
83/// bslma::Allocator *allocator = bslma::Default::allocator(0);
84///
85/// balm::Category myCategory("MyCategory");
86/// balm::MetricDescription descA(&myCategory, "MetricA");
87/// balm::MetricDescription descB(&myCategory, "MetricB");
88/// balm::MetricDescription descC(&myCategory, "MetricC");
89///
90/// balm::MetricId metricA(&descA);
91/// balm::MetricId metricB(&descB);
92/// balm::MetricId metricC(&descC);
93///
94/// const int TZ = 0; // UTC time zone offset
95///
96/// bdlt::DatetimeTz timeStamp(bdlt::Datetime(2008, 3, 26, 13, 30, 0, 0), TZ);
97/// balm::MetricRecord recordA(metricA, 0, 0, 0, 0);
98/// balm::MetricRecord recordB(metricB, 1, 2, 3, 4);
99/// balm::MetricRecord recordC(metricC, 4, 3, 2, 1);
100/// @endcode
101/// Now we create the two arrays of metric records whose addresses we will
102/// later add to the metric sample:
103/// @code
104/// balm::MetricRecord buffer1[] = { recordA, recordB };
105/// bsl::vector<balm::MetricRecord> buffer2(allocator);
106/// buffer2.push_back(recordC);
107/// @endcode
108/// Next we create a `balm::MetricSample` object, `sample`, and set its
109/// timestamp property. Then we add two groups of records (containing the
110/// addresses of our two record arrays) to the sample we have created. Since
111/// the records were not actually collected over a period of time, we supply an
112/// arbitrary elapsed time value of 1 second and 2 seconds (respectively) for
113/// the two groups added to the sample. Note that these arrays must remain
114/// valid for the lifetime of `sample`.
115/// @code
116/// balm::MetricSample sample(allocator);
117/// sample.setTimeStamp(timeStamp);
118/// sample.appendGroup(buffer1,
119/// sizeof(buffer1) / sizeof(*buffer1),
120/// bsls::TimeInterval(1.0));
121/// sample.appendGroup(buffer2.data(),
122/// static_cast<int>(buffer2.size()),
123/// bsls::TimeInterval(2.0));
124/// @endcode
125/// We can verify the basic properties of our sample:
126/// @code
127/// assert(timeStamp == sample.timeStamp());
128/// assert(2 == sample.numGroups());
129/// assert(3 == sample.numRecords());
130/// assert(bsls::TimeInterval(1) == sample.sampleGroup(0).elapsedTime());
131/// assert(buffer1 == sample.sampleGroup(0).records());
132/// assert(2 == sample.sampleGroup(0).numRecords());
133/// assert(bsls::TimeInterval(2) == sample.sampleGroup(1).elapsedTime());
134/// assert(buffer2.data() == sample.sampleGroup(1).records());
135/// assert(1 == sample.sampleGroup(1).numRecords());
136/// @endcode
137/// Finally we can obtain an iterator over the sample's sequence of groups. In
138/// this simple example, we iterate over the groups of records in the sample
139/// and, for each group, iterate over the records in that group, writing those
140/// records to the console.
141/// @code
142/// balm::MetricSample::const_iterator sampleIt = sample.begin();
143/// for ( ; sampleIt != sample.end(); ++sampleIt) {
144/// balm::MetricSampleGroup::const_iterator groupIt = sampleIt->begin();
145/// for ( ; groupIt != sampleIt->end(); ++groupIt) {
146/// bsl::cout << *groupIt << bsl::endl;
147/// }
148/// }
149/// @endcode
150/// The output will look like:
151/// @code
152/// [ MyCategory.MetricA: 0 0 0 0 ]
153/// [ MyCategory.MetricB: 1 2 3 4 ]
154/// [ MyCategory.MetricC: 4 3 2 1 ]
155/// @endcode
156/// @}
157/** @} */
158/** @} */
159
160/** @addtogroup bal
161 * @{
162 */
163/** @addtogroup balm
164 * @{
165 */
166/** @addtogroup balm_metricsample
167 * @{
168 */
169
170#include <balscm_version.h>
171
172#include <balm_metricrecord.h>
173
174#include <bdlt_datetimetz.h>
175
176#include <bsls_timeinterval.h>
177
178#include <bslma_allocator.h>
179
181
182#include <bsl_iosfwd.h>
183#include <bsl_vector.h>
184
185
186
187namespace balm {
188 // =======================
189 // class MetricSampleGroup
190 // =======================
191
192/// This class provides an *in-core* value-semantic representation of a
193/// group of metric record values. This class contains the address of an
194/// array of (externally managed) `MetricRecord` objects, the number of
195/// records in that array, and an elapsed time value (used to indicate the
196/// time span over which the metric values were aggregated).
197///
198/// See @ref balm_metricsample
200
201 // DATA
202 const MetricRecord *d_records_p; // array of records (held, not
203 // owned)
204
205 int d_numRecords; // number of records in array
206
207 bsls::TimeInterval d_elapsedTime; // interval described by records
208
209 public:
210 // PUBLIC TYPES
211
212 /// A `const_iterator` is an alias for an iterator over the
213 /// non-modifiable records referenced in a `MetricSampleGroup`.
215
216 // CREATORS
217
218 /// Create an empty sample group. By default, the `records()` address
219 /// is 0, `numRecords()` is 0, and the `elapsedTime()` is the default-
220 /// constructed `bsls::TimeInterval`.
222
223 /// Create a sample group containing the specified sequence of
224 /// `records` of specified length `numRecords`, recorded over a period
225 /// whose duration is the specified `elapsedTime`. The behavior is
226 /// undefined unless `0 <= numRecords` and `records` points to a
227 /// contiguous sequence of (at least) `numRecords` metric records. Note
228 /// that the contents of `records` is *not* copied and the supplied
229 /// array must remain valid for the productive lifetime of this object
230 /// or until the records are set to a different sequence by calling the
231 /// `setRecords` manipulator.
233 int numRecords,
235
236 /// Create a sample group having the same (in-core) value as the
237 /// specified `original` sample group.
238 MetricSampleGroup(const MetricSampleGroup& original);
239
240 /// Destroy this object.
242
243 // MANIPULATORS
244
245 /// Assign to this sample group the value of the specified `rhs` sample
246 /// group, and return a reference to this modifiable sample group.
247 /// Note that only the pointer to the `MetricRecord` array and the
248 /// length are copied, and not the records themselves.
250
251 /// Set the elapsed time (used to indicate the time span over which
252 /// this object's metric records were aggregated) to the specified
253 /// `elapsedTime`.
255
256 /// Set the sequence of records referred to by this sample group to the
257 /// specified sequence of `records` of specified length `numRecords`.
258 /// The behavior is undefined unless `0 <= numRecords`, and `records`
259 /// refers to a contiguous sequence of (at least) `numRecords`. Note
260 /// that the contents of `records` is *not* copied and the supplied
261 /// array must remain valid for the productive lifetime of this object
262 /// or until the records are set to a different sequence by calling the
263 /// `setRecords` manipulator.
264 void setRecords(const MetricRecord *records, int numRecords);
265
266 // ACCESSORS
267
268 /// Return the address of the contiguous sequence of non-modifiable
269 /// records of length `numRecords()`.
270 const MetricRecord *records() const;
271
272 /// Return the number of records (referenced to by `records()`) in this
273 /// object.
274 int numRecords() const;
275
276 /// Return a reference to the non-modifiable elapsed time interval over
277 /// which this object's metric records were aggregated.
278 const bsls::TimeInterval& elapsedTime() const;
279
280 /// Return an iterator positioned at the beginning of the sequence of
281 /// `MetricRecord` objects referenced by this object.
282 const_iterator begin() const;
283
284 /// Return an iterator positioned one past the final `MetricRecord`
285 /// object in the sequence of records referenced by this object.
286 const_iterator end() const;
287
288 /// Format this object to the specified output `stream` at the (absolute
289 /// value of) the optionally specified indentation `level` and return a
290 /// reference to `stream`. If `level` is specified, optionally specify
291 /// `spacesPerLevel`, the number of spaces per indentation level for
292 /// this and all of its nested objects. If `level` is negative,
293 /// suppress indentation of the first line. If `spacesPerLevel` is
294 /// negative, format the entire output on one line, suppressing all but
295 /// the initial indentation (as governed by `level`). If `stream` is
296 /// not valid on entry, this operation has no effect.
297 bsl::ostream& print(bsl::ostream& stream,
298 int level = 0,
299 int spacesPerLevel = 4) const;
300};
301
302// FREE OPERATORS
303
304/// Return `true` if the specified `lhs` and `rhs` sample groups have the
305/// same value, and `false` otherwise. Two sample groups have the same
306/// value if the respective record sequence-addresses, number of records,
307/// and elapsed time are the same.
308bool operator==(const MetricSampleGroup& lhs,
309 const MetricSampleGroup& rhs);
310
311/// Return `true` if the specified `lhs` and `rhs` sample groups do not
312/// have the same value, and `false` otherwise. Two sample groups do not
313/// have the same value if any of the respective record-sequence addresses,
314/// number of records, or elapsed time, are not the same.
315bool operator!=(const MetricSampleGroup& lhs,
316 const MetricSampleGroup& rhs);
317
318/// Write a formatted description of the specified `rhs` to the specified
319/// `stream` and return a reference to the modifiable `stream`.
320bsl::ostream& operator<<(bsl::ostream& stream,
321 const MetricSampleGroup& rhs);
322
323 // ==================
324 // class MetricSample
325 // ==================
326
327/// This class provides an *in-core* value-semantic representation of a
328/// sample of metric values. The class contains a collection of addresses
329/// to (external) `MetricRecord` objects holding the values for their
330/// respective metrics (aggregated over some period of time). The metric
331/// records contained by a sample are broken into a series of groups, which
332/// are represented by `MetricSampleGroup` objects. Each group contains a
333/// sequence of records and an elapsed time value, indicating the period of
334/// time over which those records were taken. This class also provides a
335/// timestamp value, used to indicate when the sample was collected. The
336/// class provides a method, `appendGroups`, that appends a group of metric
337/// records to the sample. Arrays supplied using `appendGroups` must be
338/// valid for the productive lifetime of the `MetricSample` object or until
339/// they are removed by calling `removeAllRecords`.
340///
341/// See @ref balm_metricsample
343
344 // PRIVATE TYPES
346
347 // DATA
348 bdlt::DatetimeTz d_timeStamp; // time the records were
349 // collected
350
351 bsl::vector<SampleGroup> d_records; // vector of groups of records
352
353 int d_numRecords; // total number of records
354
355 // FRIENDS
356 friend bool operator==(const MetricSample& lhs,
357 const MetricSample& rhs);
358
359 public:
360 // PUBLIC TYPES
361
362 /// A `const_iterator` is an alias for an iterator over the
363 /// non-modifiable sample groups contained in a `MetricSample`.
365
366 // PUBLIC TRAITS
368
369 // CREATORS
370
371 /// Create an empty metric sample. Optionally specify a
372 /// `basicAllocator` used to supply memory. If `basicAllocator` is 0,
373 /// the currently installed default allocator is used.
374 MetricSample(bslma::Allocator *basicAllocator = 0);
375
376 /// Create a metric sample containing the same value as the specified
377 /// `original` sample. Optionally specify a `basicAllocator` used to
378 /// supply memory. If `basicAllocator` is 0, the currently installed
379 /// default allocator is used. Note that copying the contained
380 /// `MetricSampleGroup` objects copies only the pointers to their
381 /// respective `MetricRecord` arrays, and does not copy the records
382 /// themselves; hence, these record arrays must remain valid for the
383 /// productive lifetimes of all copied objects or until the records are
384 /// removed by calling `removeAllRecords`.
385 MetricSample(const MetricSample& original,
386 bslma::Allocator *basicAllocator = 0);
387
388 /// Destroy this metric sample.
390
391 // MANIPULATORS
392
393 /// Assign to this sample the value of the specified `rhs` sample and
394 /// return a reference to this modifiable sample. Note that copying
395 /// the `MetricSampleGroup` objects contained in `rhs` copies only the
396 /// pointers to their respective `MetricRecord` arrays, and does not
397 /// copy records themselves; hence, these record arrays must remain
398 /// valid for the productive lifetimes of all copied objects or until
399 /// records are removed by calling `removeAllRecords`.
401
402 /// Set the timestamp (used to indicate when the sample was taken) to
403 /// the specified `timeStamp`.
405
406 /// Append the specified `group` of records to the sequence of groups
407 /// maintained by this sample. If `group.numRecords()` is 0 this method
408 /// has no effect. The behavior is undefined unless
409 /// `group.elapsedTime() > bsls::TimeInterval(0, 0)`. Note that the
410 /// `MetricRecord` objects referred to by `records` are *not* copied:
411 /// hence, the supplied array must remain valid for the productive
412 /// lifetime of this object or until the group is removed by calling
413 /// `removeAllRecords()`.
414 void appendGroup(const MetricSampleGroup& group);
415
416 /// Append to the sequence of groups maintained by this sample a new
417 /// group containing the specified sequence of `records` of specified
418 /// length `numRecords` measuring the specified `elapsedTime`. The
419 /// behavior is undefined unless `0 <= numRecords`, `records` refers to
420 /// a contiguous sequence of size (at least) `numRecords`, and
421 /// `elapsedTime > bsls::TimeInterval(0, 0)`. Note that `records` is
422 /// *not* copied: hence, the supplied array must remain valid for the
423 /// lifetime of this object or until the records are removed by calling
424 /// `removeAllRecords()`. This method is functionally equivalent to:
425 /// @code
426 /// appendGroup(MetricSampleGroup(records, numRecords, elapsedTime));
427 /// @endcode
428 void appendGroup(const MetricRecord *records,
429 int numRecords,
430 const bsls::TimeInterval& elapsedTime);
431
432 /// Remove all metric records from this sample.
433 void removeAllRecords();
434
435 // ACCESSORS
436
437 /// Return a reference to the non-modifiable `MetricSampleGroup` object
438 /// at the specified `index` in this sample. The behavior is undefined
439 /// unless `0 <= index < numGroups()`. Note that the returned
440 /// reference will remain valid until this sample is modified by
441 /// invoking `appendGroup` or `removeAllRecords()`.
442 const MetricSampleGroup& sampleGroup(int index) const;
443
444 /// Return a reference to the non-modifiable timestamp for this sample.
445 const bdlt::DatetimeTz& timeStamp() const;
446
447 /// Return an iterator positioned at the beginning of the sequence of
448 /// `MetricSampleGroup` objects contained by this object. Note that the
449 /// iterator will remain valid until this sample is modified by invoking
450 /// either `appendGroups` or `removeAllRecords()`.
451 const_iterator begin() const;
452
453 /// Return an iterator positioned one one past the final
454 /// `MetricSampleGroup` object in the sequence of sample groups
455 /// contained by this object. Note that the iterator will remain valid
456 /// until this sample is modified by invoking `appendGroup` or
457 /// `removeAllRecords()`.
458 const_iterator end() const;
459
460 /// Return the number of record groups (i.e., `MetricSampleGroup`
461 /// objects) that are contained in this object.
462 int numGroups() const;
463
464 /// Return the total number of records in this sample (i.e., the sum of
465 /// the lengths of all the appended record groups).
466 int numRecords() const;
467
468 /// Format this object to the specified output `stream` at the (absolute
469 /// value of) the optionally specified indentation `level` and return a
470 /// reference to `stream`. If `level` is specified, optionally specify
471 /// `spacesPerLevel`, the number of spaces per indentation level for
472 /// this and all of its nested objects. If `level` is negative,
473 /// suppress indentation of the first line. If `spacesPerLevel` is
474 /// negative, format the entire output on one line, suppressing all but
475 /// the initial indentation (as governed by `level`). If `stream` is
476 /// not valid on entry, this operation has no effect.
477 bsl::ostream& print(bsl::ostream& stream,
478 int level = 0,
479 int spacesPerLevel = 4) const;
480};
481
482// FREE OPERATORS
483
484/// Return `true` if the specified `lhs` and `rhs` samples have the same
485/// value, and `false` otherwise. Two samples have the same value if they
486/// have the same timestamp value, contain the same number of record
487/// groups, and if the respective groups of records at each index position
488/// have the same value.
489bool operator==(const MetricSample& lhs, const MetricSample& rhs);
490
491/// Return `true` if the specified `lhs` and `rhs` samples do not have the
492/// same value, and `false` otherwise. Two samples do not have the same
493/// value if they have different values for their timestamps, or number of
494/// record groups, or if any of the groups of records at corresponding
495/// indices have different values.
496bool operator!=(const MetricSample& lhs, const MetricSample& rhs);
497
498/// Write a formatted description of the specified `rhs` to the specified
499/// `stream` and return a reference to the modifiable `stream`.
500bsl::ostream& operator<<(bsl::ostream& stream, const MetricSample& rhs);
501
502// ============================================================================
503// INLINE DEFINITIONS
504// ============================================================================
505
506 // -----------------------
507 // class MetricSampleGroup
508 // -----------------------
509
510// CREATORS
511inline
513: d_records_p(0)
514, d_numRecords(0)
515, d_elapsedTime()
516{
517}
518
519inline
521 int numRecords,
522 const bsls::TimeInterval& elapsedTime)
523: d_records_p(records)
524, d_numRecords(numRecords)
525, d_elapsedTime(elapsedTime)
526{
527}
528
529inline
531: d_records_p(original.d_records_p)
532, d_numRecords(original.d_numRecords)
533, d_elapsedTime(original.d_elapsedTime)
534{
535}
536
537// MANIPULATORS
538inline
540{
541 d_records_p = rhs.d_records_p;
542 d_numRecords = rhs.d_numRecords;
543 d_elapsedTime = rhs.d_elapsedTime;
544 return *this;
545}
546
547inline
549{
550 d_elapsedTime = elapsedTime;
551}
552
553inline
555 int numRecords)
556{
557 d_records_p = records;
558 d_numRecords = numRecords;
559}
560
561// ACCESSORS
562inline
564{
565 return d_records_p;
566}
567
568inline
570{
571 return d_numRecords;
572}
573
574inline
576{
577 return d_elapsedTime;
578}
579
580inline
582{
583 return d_records_p;
584}
585
586inline
588{
589 return d_records_p + d_numRecords;
590}
591
592} // close package namespace
593
594// FREE OPERATORS
595inline
596bool balm::operator==(const MetricSampleGroup& lhs,
597 const MetricSampleGroup& rhs)
598{
599 return lhs.records() == rhs.records()
600 && lhs.numRecords() == rhs.numRecords()
601 && lhs.elapsedTime() == rhs.elapsedTime();
602}
603
604inline
605bool balm::operator!=(const MetricSampleGroup& lhs,
606 const MetricSampleGroup& rhs)
607{
608 return !(lhs == rhs);
609}
610
611inline
612bsl::ostream& balm::operator<<(bsl::ostream& stream,
613 const MetricSampleGroup& rhs)
614{
615 return rhs.print(stream, 0, -1);
616}
617
618namespace balm {
619 // ------------------
620 // class MetricSample
621 // ------------------
622
623// CREATORS
624inline
626: d_timeStamp()
627, d_records(basicAllocator)
628, d_numRecords(0)
629{
630}
631
632inline
636
637// MANIPULATORS
638inline
640{
641 d_timeStamp = timeStamp;
642}
643
644inline
646{
647 if (0 < group.numRecords()) {
648 d_records.push_back(group);
649 d_numRecords += group.numRecords();
650 }
651}
652
653inline
655 int numRecords,
656 const bsls::TimeInterval& elapsedTime)
657{
658 if (0 < numRecords) {
659 d_records.push_back(SampleGroup(records, numRecords, elapsedTime));
660 d_numRecords += numRecords;
661 }
662}
663
664inline
666{
667 d_records.clear();
668 d_numRecords = 0;
669}
670
671// ACCESSORS
672inline
674{
675 return d_records[index];
676}
677
678inline
680{
681 return d_timeStamp;
682}
683
684inline
686{
687 return d_records.begin();
688}
689
690inline
692{
693 return d_records.end();
694}
695
696inline
698{
699 return static_cast<int>(d_records.size());
700}
701
702inline
704{
705 return d_numRecords;
706}
707} // close package namespace
708
709// FREE OPERATORS
710inline
711bool balm::operator==(const MetricSample& lhs, const MetricSample& rhs)
712{
713 return lhs.d_timeStamp == rhs.d_timeStamp
714 && lhs.d_records == rhs.d_records;
715}
716
717inline
718bool balm::operator!=(const MetricSample& lhs, const MetricSample& rhs)
719{
720 return !(lhs == rhs);
721}
722
723inline
724bsl::ostream& balm::operator<<(bsl::ostream& stream, const MetricSample& rhs)
725{
726 return rhs.print(stream, 0, -1);
727}
728
729
730
731#endif
732
733// ----------------------------------------------------------------------------
734// Copyright 2015 Bloomberg Finance L.P.
735//
736// Licensed under the Apache License, Version 2.0 (the "License");
737// you may not use this file except in compliance with the License.
738// You may obtain a copy of the License at
739//
740// http://www.apache.org/licenses/LICENSE-2.0
741//
742// Unless required by applicable law or agreed to in writing, software
743// distributed under the License is distributed on an "AS IS" BASIS,
744// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
745// See the License for the specific language governing permissions and
746// limitations under the License.
747// ----------------------------- END-OF-FILE ----------------------------------
748
749/** @} */
750/** @} */
751/** @} */
Definition balm_metricrecord.h:217
Definition balm_metricsample.h:199
const_iterator end() const
Definition balm_metricsample.h:587
const MetricRecord * const_iterator
Definition balm_metricsample.h:214
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
void setElapsedTime(const bsls::TimeInterval &elapsedTime)
Definition balm_metricsample.h:548
~MetricSampleGroup()=default
Destroy this object.
MetricSampleGroup & operator=(const MetricSampleGroup &rhs)
Definition balm_metricsample.h:539
const MetricRecord * records() const
Definition balm_metricsample.h:563
const bsls::TimeInterval & elapsedTime() const
Definition balm_metricsample.h:575
void setRecords(const MetricRecord *records, int numRecords)
Definition balm_metricsample.h:554
const_iterator begin() const
Definition balm_metricsample.h:581
MetricSampleGroup()
Definition balm_metricsample.h:512
int numRecords() const
Definition balm_metricsample.h:569
Definition balm_metricsample.h:342
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
BSLMF_NESTED_TRAIT_DECLARATION(MetricSample, bslma::UsesBslmaAllocator)
friend bool operator==(const MetricSample &lhs, const MetricSample &rhs)
void removeAllRecords()
Remove all metric records from this sample.
Definition balm_metricsample.h:665
const_iterator end() const
Definition balm_metricsample.h:691
void setTimeStamp(const bdlt::DatetimeTz &timeStamp)
Definition balm_metricsample.h:639
MetricSample & operator=(const MetricSample &rhs)
void appendGroup(const MetricSampleGroup &group)
Definition balm_metricsample.h:645
const_iterator begin() const
Definition balm_metricsample.h:685
const MetricSampleGroup & sampleGroup(int index) const
Definition balm_metricsample.h:673
const bdlt::DatetimeTz & timeStamp() const
Return a reference to the non-modifiable timestamp for this sample.
Definition balm_metricsample.h:679
~MetricSample()
Destroy this metric sample.
Definition balm_metricsample.h:633
MetricSample(const MetricSample &original, bslma::Allocator *basicAllocator=0)
int numGroups() const
Definition balm_metricsample.h:697
int numRecords() const
Definition balm_metricsample.h:703
bsl::vector< MetricSampleGroup >::const_iterator const_iterator
Definition balm_metricsample.h:364
MetricSample(bslma::Allocator *basicAllocator=0)
Definition balm_metricsample.h:625
Definition bdlt_datetimetz.h:308
Definition bslstl_vector.h:1025
VALUE_TYPE const * const_iterator
Definition bslstl_vector.h:1058
Definition bslma_allocator.h:457
Definition bsls_timeinterval.h:301
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition balm_bdlmmetricsadapter.h:141
bool operator==(const IntegerMetric &lhs, const IntegerMetric &rhs)
bsl::ostream & operator<<(bsl::ostream &stream, const Category &rhs)
bool operator!=(const IntegerMetric &lhs, const IntegerMetric &rhs)
Definition bslma_usesbslmaallocator.h:343