Constructors
Synopses
Declared in <balm_stopwatchscopedguard.h>
Initialize this scoped guard to record an elapsed time to the specified metricId from the optionally specified manager. Optionally specify the timeUnits in which to report elapsed time. If timeUnits is not provided, the elapsed time will be reported in seconds. If manager is 0, the DefaultMetricsManager singleton instance is used. If no manager is supplied and the default instance has not been created, this object will be inactive (i.e., it will not record any values); similarly, if the metric's associated category is disabled (i.e., metricId.category()‐>enabled() is false), then this object will be inactive. The behavior is undefined unless unless metricId is a valid id returned by the MetricRepository object owned by the indicated metrics manager. Note that timeUnits indicates the scale of the double value reported by this guard, but does not affect the precision of the elapsed time measurement.
StopwatchScopedGuard(
MetricId const& metricId,
MetricsManager* manager = 0);
Initialize this scoped guard to record elapsed time using the specified collector. Optionally specify the timeUnits in which to report elapsed time. If collector is 0 or`collector‐>category().enabled() == false`, this object will be inactive (i.e., will not record any values). The behavior is undefined unless collector == 0 || collector‐>metricId().isValid(). Note that timeUnits indicates the scale of the double value reported by this guard, but does not affect the precision of the elapsed time measurement.
explicit
StopwatchScopedGuard(
Collector* collector,
Units timeUnits = k_SECONDS);
Initialize this scoped guard to record elapsed time using the specified metric. Optionally specify the timeUnits in which to report elapsed time. If metric‐>isActive() is false, this object will also be inactive (i.e., will not record any values). The behavior is undefined unless metric is a valid address of a Metric object. Note that timeUnits indicates the scale of the double value reported by this guard, but does not affect the precision of the elapsed time measurement.
explicit
StopwatchScopedGuard(
Metric* metric,
Units timeUnits = k_SECONDS);
Same as the preceding overload, using the specified timeUnits.
StopwatchScopedGuard(
MetricId const& metricId,
Units timeUnits,
MetricsManager* manager = 0);
Initialize this scoped guard to record an elapsed time to the metric, identified by the specified category and name, from the optionally specified manager. Optionally specify the timeUnits in which to report elapsed time. If timeUnits is not provided, the elapsed time will be reported in seconds. If manager is 0, use the DefaultMetricsManager instance. If no manager is supplied, and the default instance has not been created, this object will be inactive (i.e., it will not record any values); similarly, if the identified category is disabled, then this object will be inactive. The behavior is undefined unless category and name are null‐terminated. Note that timeUnits indicates the scale of the double value reported by this guard, but does not affect the precision of the elapsed time measurement.
StopwatchScopedGuard(
char const* category,
char const* name,
MetricsManager* manager = 0);
Create a scoped guard for the specified category, name, and timeUnits, optionally using the specified manager.
StopwatchScopedGuard(
char const* category,
char const* name,
Units timeUnits,
MetricsManager* manager = 0);
Created with MrDocs