BDE 4.39.x 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`.
226 ///
227 /// \pre The behavior is undefined unless `0 <= numRecords` and `records` points to a
228 /// contiguous sequence of (at least) `numRecords` metric records.
229 ///
230 /// \note Note that the contents of `records` is *not* copied and the supplied
231 /// array must remain valid for the productive lifetime of this object
232 /// or until the records are set to a different sequence by calling the
233 /// `setRecords` manipulator.
235 int numRecords,
237
238 /// Create a sample group having the same (in-core) value as the
239 /// specified `original` sample group.
240 MetricSampleGroup(const MetricSampleGroup& original);
241
242 /// Destroy this object.
244
245 // MANIPULATORS
246
247 /// Assign to this sample group the value of the specified `rhs` sample
248 /// group, and return a reference to this modifiable sample group.
249 ///
250 /// \note Note that only the pointer to the `MetricRecord` array and the
251 /// length are copied, and not the records themselves.
253
254 /// Set the elapsed time (used to indicate the time span over which
255 /// this object's metric records were aggregated) to the specified
256 /// `elapsedTime`.
258
259 /// Set the sequence of records referred to by this sample group to the
260 /// specified sequence of `records` of specified length `numRecords`.
261 ///
262 /// \pre The behavior is undefined unless `0 <= numRecords`, and `records`
263 /// refers to a contiguous sequence of (at least) `numRecords`.
264 ///
265 /// \note Note that the contents of `records` is *not* copied and the supplied
266 /// array must remain valid for the productive lifetime of this object
267 /// or until the records are set to a different sequence by calling the
268 /// `setRecords` manipulator.
269 void setRecords(const MetricRecord *records, int numRecords);
270
271 // ACCESSORS
272
273 /// Return the address of the contiguous sequence of non-modifiable
274 /// records of length `numRecords()`.
275 const MetricRecord *records() const;
276
277 /// Return the number of records (referenced to by `records()`) in this
278 /// object.
279 int numRecords() const;
280
281 /// Return a reference to the non-modifiable elapsed time interval over
282 /// which this object's metric records were aggregated.
283 const bsls::TimeInterval& elapsedTime() const;
284
285 /// Return an iterator positioned at the beginning of the sequence of
286 /// `MetricRecord` objects referenced by this object.
287 const_iterator begin() const;
288
289 /// Return an iterator positioned one past the final `MetricRecord`
290 /// object in the sequence of records referenced by this object.
291 const_iterator end() const;
292
293 /// Format this object to the specified output `stream` at the (absolute
294 /// value of) the optionally specified indentation `level` and return a
295 /// reference to `stream`. If `level` is specified, optionally specify
296 /// `spacesPerLevel`, the number of spaces per indentation level for
297 /// this and all of its nested objects. If `level` is negative,
298 /// suppress indentation of the first line. If `spacesPerLevel` is
299 /// negative, format the entire output on one line, suppressing all but
300 /// the initial indentation (as governed by `level`). If `stream` is
301 /// not valid on entry, this operation has no effect.
302 bsl::ostream& print(bsl::ostream& stream,
303 int level = 0,
304 int spacesPerLevel = 4) const;
305};
306
307// FREE OPERATORS
308
309/// Return `true` if the specified `lhs` and `rhs` sample groups have the
310/// same value, and `false` otherwise. Two sample groups have the same
311/// value if the respective record sequence-addresses, number of records,
312/// and elapsed time are the same.
313bool operator==(const MetricSampleGroup& lhs,
314 const MetricSampleGroup& rhs);
315
316/// Return `true` if the specified `lhs` and `rhs` sample groups do not
317/// have the same value, and `false` otherwise. Two sample groups do not
318/// have the same value if any of the respective record-sequence addresses,
319/// number of records, or elapsed time, are not the same.
320bool operator!=(const MetricSampleGroup& lhs,
321 const MetricSampleGroup& rhs);
322
323/// Write a formatted description of the specified `rhs` to the specified
324/// `stream` and return a reference to the modifiable `stream`.
325bsl::ostream& operator<<(bsl::ostream& stream,
326 const MetricSampleGroup& rhs);
327
328 // ==================
329 // class MetricSample
330 // ==================
331
332/// This class provides an *in-core* value-semantic representation of a
333/// sample of metric values. The class contains a collection of addresses
334/// to (external) `MetricRecord` objects holding the values for their
335/// respective metrics (aggregated over some period of time). The metric
336/// records contained by a sample are broken into a series of groups, which
337/// are represented by `MetricSampleGroup` objects. Each group contains a
338/// sequence of records and an elapsed time value, indicating the period of
339/// time over which those records were taken. This class also provides a
340/// timestamp value, used to indicate when the sample was collected. The
341/// class provides a method, `appendGroups`, that appends a group of metric
342/// records to the sample. Arrays supplied using `appendGroups` must be
343/// valid for the productive lifetime of the `MetricSample` object or until
344/// they are removed by calling `removeAllRecords`.
345///
346/// See @ref balm_metricsample
348
349 // PRIVATE TYPES
351
352 // DATA
353 bdlt::DatetimeTz d_timeStamp; // time the records were
354 // collected
355
356 bsl::vector<SampleGroup> d_records; // vector of groups of records
357
358 int d_numRecords; // total number of records
359
360 // FRIENDS
361 friend bool operator==(const MetricSample& lhs,
362 const MetricSample& rhs);
363
364 public:
365 // PUBLIC TYPES
366
367 /// A `const_iterator` is an alias for an iterator over the
368 /// non-modifiable sample groups contained in a `MetricSample`.
370
371 // PUBLIC TRAITS
373
374 // CREATORS
375
376 /// Create an empty metric sample. Optionally specify a
377 /// `basicAllocator` used to supply memory. If `basicAllocator` is 0,
378 /// the currently installed default allocator is used.
379 MetricSample(bslma::Allocator *basicAllocator = 0);
380
381 /// Create a metric sample containing the same value as the specified
382 /// `original` sample. Optionally specify a `basicAllocator` used to
383 /// supply memory. If `basicAllocator` is 0, the currently installed default allocator is used.
384 ///
385 /// \note Note that copying the contained
386 /// `MetricSampleGroup` objects copies only the pointers to their
387 /// respective `MetricRecord` arrays, and does not copy the records
388 /// themselves; hence, these record arrays must remain valid for the
389 /// productive lifetimes of all copied objects or until the records are
390 /// removed by calling `removeAllRecords`.
391 MetricSample(const MetricSample& original,
392 bslma::Allocator *basicAllocator = 0);
393
394 /// Destroy this metric sample.
396
397 // MANIPULATORS
398
399 /// Assign to this sample the value of the specified `rhs` sample and return a reference to this modifiable sample.
400 ///
401 /// \note Note that copying
402 /// the `MetricSampleGroup` objects contained in `rhs` copies only the
403 /// pointers to their respective `MetricRecord` arrays, and does not
404 /// copy records themselves; hence, these record arrays must remain
405 /// valid for the productive lifetimes of all copied objects or until
406 /// records are removed by calling `removeAllRecords`.
408
409 /// Set the timestamp (used to indicate when the sample was taken) to
410 /// the specified `timeStamp`.
412
413 /// Append the specified `group` of records to the sequence of groups
414 /// maintained by this sample. If `group.numRecords()` is 0 this method has no effect.
415 ///
416 /// \pre The behavior is undefined unless `group.elapsedTime() > bsls::TimeInterval(0, 0)`.
417 ///
418 /// \note Note that the
419 /// `MetricRecord` objects referred to by `records` are *not* copied:
420 /// hence, the supplied array must remain valid for the productive
421 /// lifetime of this object or until the group is removed by calling
422 /// `removeAllRecords()`.
423 void appendGroup(const MetricSampleGroup& group);
424
425 /// Append to the sequence of groups maintained by this sample a new
426 /// group containing the specified sequence of `records` of specified
427 /// length `numRecords` measuring the specified `elapsedTime`.
428 ///
429 /// \pre The behavior is undefined unless `0 <= numRecords`, `records` refers to
430 /// a contiguous sequence of size (at least) `numRecords`, and `elapsedTime > bsls::TimeInterval(0, 0)`.
431 ///
432 /// \note Note that `records` is
433 /// *not* copied: hence, the supplied array must remain valid for the
434 /// lifetime of this object or until the records are removed by calling
435 /// `removeAllRecords()`. This method is functionally equivalent to:
436 /// @code
437 /// appendGroup(MetricSampleGroup(records, numRecords, elapsedTime));
438 /// @endcode
439 void appendGroup(const MetricRecord *records,
440 int numRecords,
441 const bsls::TimeInterval& elapsedTime);
442
443 /// Remove all metric records from this sample.
444 void removeAllRecords();
445
446 // ACCESSORS
447
448 /// Return a reference to the non-modifiable `MetricSampleGroup` object
449 /// at the specified `index` in this sample.
450 ///
451 /// \pre The behavior is undefined unless `0 <= index < numGroups()`.
452 /// \note Note that the returned
453 /// reference will remain valid until this sample is modified by
454 /// invoking `appendGroup` or `removeAllRecords()`.
455 const MetricSampleGroup& sampleGroup(int index) const;
456
457 /// Return a reference to the non-modifiable timestamp for this sample.
458 const bdlt::DatetimeTz& timeStamp() const;
459
460 /// Return an iterator positioned at the beginning of the sequence of `MetricSampleGroup` objects contained by this object.
461 ///
462 /// \note Note that the
463 /// iterator will remain valid until this sample is modified by invoking
464 /// either `appendGroups` or `removeAllRecords()`.
465 const_iterator begin() const;
466
467 /// Return an iterator positioned one one past the final
468 /// `MetricSampleGroup` object in the sequence of sample groups contained by this object.
469 ///
470 /// \note Note that the iterator will remain valid
471 /// until this sample is modified by invoking `appendGroup` or
472 /// `removeAllRecords()`.
473 const_iterator end() const;
474
475 /// Return the number of record groups (i.e., `MetricSampleGroup`
476 /// objects) that are contained in this object.
477 int numGroups() const;
478
479 /// Return the total number of records in this sample (i.e., the sum of
480 /// the lengths of all the appended record groups).
481 int numRecords() const;
482
483 /// Format this object to the specified output `stream` at the (absolute
484 /// value of) the optionally specified indentation `level` and return a
485 /// reference to `stream`. If `level` is specified, optionally specify
486 /// `spacesPerLevel`, the number of spaces per indentation level for
487 /// this and all of its nested objects. If `level` is negative,
488 /// suppress indentation of the first line. If `spacesPerLevel` is
489 /// negative, format the entire output on one line, suppressing all but
490 /// the initial indentation (as governed by `level`). If `stream` is
491 /// not valid on entry, this operation has no effect.
492 bsl::ostream& print(bsl::ostream& stream,
493 int level = 0,
494 int spacesPerLevel = 4) const;
495};
496
497// FREE OPERATORS
498
499/// Return `true` if the specified `lhs` and `rhs` samples have the same
500/// value, and `false` otherwise. Two samples have the same value if they
501/// have the same timestamp value, contain the same number of record
502/// groups, and if the respective groups of records at each index position
503/// have the same value.
504bool operator==(const MetricSample& lhs, const MetricSample& rhs);
505
506/// Return `true` if the specified `lhs` and `rhs` samples do not have the
507/// same value, and `false` otherwise. Two samples do not have the same
508/// value if they have different values for their timestamps, or number of
509/// record groups, or if any of the groups of records at corresponding
510/// indices have different values.
511bool operator!=(const MetricSample& lhs, const MetricSample& rhs);
512
513/// Write a formatted description of the specified `rhs` to the specified
514/// `stream` and return a reference to the modifiable `stream`.
515bsl::ostream& operator<<(bsl::ostream& stream, const MetricSample& rhs);
516
517// ============================================================================
518// INLINE DEFINITIONS
519// ============================================================================
520
521 // -----------------------
522 // class MetricSampleGroup
523 // -----------------------
524
525// CREATORS
526inline
528: d_records_p(0)
529, d_numRecords(0)
530, d_elapsedTime()
531{
532}
533
534inline
536 int numRecords,
537 const bsls::TimeInterval& elapsedTime)
538: d_records_p(records)
539, d_numRecords(numRecords)
540, d_elapsedTime(elapsedTime)
541{
542}
543
544inline
546: d_records_p(original.d_records_p)
547, d_numRecords(original.d_numRecords)
548, d_elapsedTime(original.d_elapsedTime)
549{
550}
551
552// MANIPULATORS
553inline
555{
556 d_records_p = rhs.d_records_p;
557 d_numRecords = rhs.d_numRecords;
558 d_elapsedTime = rhs.d_elapsedTime;
559 return *this;
560}
561
562inline
564{
565 d_elapsedTime = elapsedTime;
566}
567
568inline
570 int numRecords)
571{
572 d_records_p = records;
573 d_numRecords = numRecords;
574}
575
576// ACCESSORS
577inline
579{
580 return d_records_p;
581}
582
583inline
585{
586 return d_numRecords;
587}
588
589inline
591{
592 return d_elapsedTime;
593}
594
595inline
597{
598 return d_records_p;
599}
600
601inline
603{
604 return d_records_p + d_numRecords;
605}
606
607} // close package namespace
608
609// FREE OPERATORS
610inline
611bool balm::operator==(const MetricSampleGroup& lhs,
612 const MetricSampleGroup& rhs)
613{
614 return lhs.records() == rhs.records()
615 && lhs.numRecords() == rhs.numRecords()
616 && lhs.elapsedTime() == rhs.elapsedTime();
617}
618
619inline
620bool balm::operator!=(const MetricSampleGroup& lhs,
621 const MetricSampleGroup& rhs)
622{
623 return !(lhs == rhs);
624}
625
626inline
627bsl::ostream& balm::operator<<(bsl::ostream& stream,
628 const MetricSampleGroup& rhs)
629{
630 return rhs.print(stream, 0, -1);
631}
632
633namespace balm {
634 // ------------------
635 // class MetricSample
636 // ------------------
637
638// CREATORS
639inline
641: d_timeStamp()
642, d_records(basicAllocator)
643, d_numRecords(0)
644{
645}
646
647inline
651
652// MANIPULATORS
653inline
655{
656 d_timeStamp = timeStamp;
657}
658
659inline
661{
662 if (0 < group.numRecords()) {
663 d_records.push_back(group);
664 d_numRecords += group.numRecords();
665 }
666}
667
668inline
670 int numRecords,
671 const bsls::TimeInterval& elapsedTime)
672{
673 if (0 < numRecords) {
674 d_records.push_back(SampleGroup(records, numRecords, elapsedTime));
675 d_numRecords += numRecords;
676 }
677}
678
679inline
681{
682 d_records.clear();
683 d_numRecords = 0;
684}
685
686// ACCESSORS
687inline
689{
690 return d_records[index];
691}
692
693inline
695{
696 return d_timeStamp;
697}
698
699inline
701{
702 return d_records.begin();
703}
704
705inline
707{
708 return d_records.end();
709}
710
711inline
713{
714 return static_cast<int>(d_records.size());
715}
716
717inline
719{
720 return d_numRecords;
721}
722} // close package namespace
723
724// FREE OPERATORS
725inline
726bool balm::operator==(const MetricSample& lhs, const MetricSample& rhs)
727{
728 return lhs.d_timeStamp == rhs.d_timeStamp
729 && lhs.d_records == rhs.d_records;
730}
731
732inline
733bool balm::operator!=(const MetricSample& lhs, const MetricSample& rhs)
734{
735 return !(lhs == rhs);
736}
737
738inline
739bsl::ostream& balm::operator<<(bsl::ostream& stream, const MetricSample& rhs)
740{
741 return rhs.print(stream, 0, -1);
742}
743
744
745
746#endif
747
748// ----------------------------------------------------------------------------
749// Copyright 2015 Bloomberg Finance L.P.
750//
751// Licensed under the Apache License, Version 2.0 (the "License");
752// you may not use this file except in compliance with the License.
753// You may obtain a copy of the License at
754//
755// http://www.apache.org/licenses/LICENSE-2.0
756//
757// Unless required by applicable law or agreed to in writing, software
758// distributed under the License is distributed on an "AS IS" BASIS,
759// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
760// See the License for the specific language governing permissions and
761// limitations under the License.
762// ----------------------------- END-OF-FILE ----------------------------------
763
764/** @} */
765/** @} */
766/** @} */
Definition balm_metricrecord.h:217
Definition balm_metricsample.h:199
const_iterator end() const
Definition balm_metricsample.h:602
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:563
~MetricSampleGroup()=default
Destroy this object.
MetricSampleGroup & operator=(const MetricSampleGroup &rhs)
Definition balm_metricsample.h:554
const MetricRecord * records() const
Definition balm_metricsample.h:578
const bsls::TimeInterval & elapsedTime() const
Definition balm_metricsample.h:590
void setRecords(const MetricRecord *records, int numRecords)
Definition balm_metricsample.h:569
const_iterator begin() const
Definition balm_metricsample.h:596
MetricSampleGroup()
Definition balm_metricsample.h:527
int numRecords() const
Definition balm_metricsample.h:584
Definition balm_metricsample.h:347
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:680
const_iterator end() const
Definition balm_metricsample.h:706
void setTimeStamp(const bdlt::DatetimeTz &timeStamp)
Definition balm_metricsample.h:654
MetricSample & operator=(const MetricSample &rhs)
void appendGroup(const MetricSampleGroup &group)
Definition balm_metricsample.h:660
const_iterator begin() const
Definition balm_metricsample.h:700
const MetricSampleGroup & sampleGroup(int index) const
Definition balm_metricsample.h:688
const bdlt::DatetimeTz & timeStamp() const
Return a reference to the non-modifiable timestamp for this sample.
Definition balm_metricsample.h:694
~MetricSample()
Destroy this metric sample.
Definition balm_metricsample.h:648
MetricSample(const MetricSample &original, bslma::Allocator *basicAllocator=0)
int numGroups() const
Definition balm_metricsample.h:712
int numRecords() const
Definition balm_metricsample.h:718
bsl::vector< MetricSampleGroup >::const_iterator const_iterator
Definition balm_metricsample.h:369
MetricSample(bslma::Allocator *basicAllocator=0)
Definition balm_metricsample.h:640
Definition bdlt_datetimetz.h:308
Definition bslstl_vector.h:1120
VALUE_TYPE const * const_iterator
Definition bslstl_vector.h:1153
Definition bslma_allocator.h:545
Definition bsls_timeinterval.h:307
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition balm_bdlmmetricsadapter.h:142
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)
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
ALLOCATOR & lhs
Definition bslstl_string.h:3917
Definition bslma_usesbslmaallocator.h:344