8#ifndef INCLUDED_BALM_STOPWATCHSCOPEDGUARD
9#define INCLUDED_BALM_STOPWATCHSCOPEDGUARD
196#include <balscm_version.h>
244#ifndef BDE_OMIT_INTERNAL_DEPRECATED
375StopwatchScopedGuard::StopwatchScopedGuard(
Metric *metric,
378, d_timeUnits(timeUnits)
379, d_collector_p(metric->isActive() ? metric->collector() : 0)
387StopwatchScopedGuard::StopwatchScopedGuard(
Collector *collector,
390, d_timeUnits(timeUnits)
391, d_collector_p((collector && collector->metricId().category()->enabled())
401StopwatchScopedGuard::StopwatchScopedGuard(
const MetricId& metricId,
404, d_timeUnits(k_SECONDS)
408 d_collector_p = (collector &&
417StopwatchScopedGuard::StopwatchScopedGuard(
const MetricId& metricId,
421, d_timeUnits(timeUnits)
425 d_collector_p = (collector &&
434StopwatchScopedGuard::StopwatchScopedGuard(
const char *category,
438, d_timeUnits(k_SECONDS)
443 d_collector_p = (collector &&
453StopwatchScopedGuard::StopwatchScopedGuard(
const char *category,
458, d_timeUnits(timeUnits)
481 return 0 != d_collector_p
bool enabled() const
Definition balm_category.h:359
Definition balm_collector.h:152
const MetricId & metricId() const
Definition balm_collector.h:310
void update(double value)
Definition balm_collector.h:273
Definition balm_metricid.h:162
const Category * category() const
Definition balm_metricid.h:330
Definition balm_metric.h:251
static Collector * lookupCollector(const char *category, const char *name, MetricsManager *manager=0)
Definition balm_metric.h:468
Definition balm_metricsmanager.h:490
Definition balm_stopwatchscopedguard.h:233
~StopwatchScopedGuard()
Definition balm_stopwatchscopedguard.h:470
Units
Definition balm_stopwatchscopedguard.h:237
@ k_MICROSECONDS
Definition balm_stopwatchscopedguard.h:241
@ BAEM_NANOSECONDS
Definition balm_stopwatchscopedguard.h:245
@ BAEM_MICROSECONDS
Definition balm_stopwatchscopedguard.h:246
@ MICROSECONDS
Definition balm_stopwatchscopedguard.h:250
@ BAEM_MILLISECONDS
Definition balm_stopwatchscopedguard.h:247
@ SECONDS
Definition balm_stopwatchscopedguard.h:252
@ BAEM_SECONDS
Definition balm_stopwatchscopedguard.h:248
@ NANOSECONDS
Definition balm_stopwatchscopedguard.h:249
@ k_SECONDS
Definition balm_stopwatchscopedguard.h:243
@ k_MILLISECONDS
Definition balm_stopwatchscopedguard.h:242
@ k_NANOSECONDS
Definition balm_stopwatchscopedguard.h:240
@ MILLISECONDS
Definition balm_stopwatchscopedguard.h:251
bool isActive() const
Definition balm_stopwatchscopedguard.h:479
Definition bsls_stopwatch.h:149
void start(bool collectCpuTimes=false)
Definition bsls_stopwatch.h:354
double elapsedTime() const
Definition bsls_stopwatch.h:433
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition balm_bdlmmetricsadapter.h:142