MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / MetricStat

Method MetricStat

src/ConsoleMetric.actor.cpp:24–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#include "flow/actorcompiler.h" // This must be the last #include.
23
24MetricStat::MetricStat(std::string mId, IMetricType mType)
25 : mId(std::move(mId)),
26 mType(mType),
27 sum(0),
28 avg(0.0),
29 count(0),
30 max(std::numeric_limits<int64_t>::min()),
31 min(std::numeric_limits<int64_t>::max()),
32 values(std::vector<int64_t>()),
33 percentile25(0),
34 percentile50(0),
35 percentile90(0),
36 percentile99(0),
37 percentile9999(0) {
38 startTimeNanoSeconds = timer_int();
39 switch (mType) {
40 case IMetricType::COUNT:
41 typeName = std::string("COUNT");
42 break;
43 case IMetricType::TIMER:
44 typeName = std::string("TIMER");
45 break;
46 case IMetricType::GAUGE:
47 typeName = std::string("GAUGE");
48 break;
49 case IMetricType::METER:
50 typeName = std::string("METER (rate per second)");
51 break;
52 case IMetricType::HISTOGRAMS:
53 typeName = std::string("HISTOGRAMS");
54 break;
55 }
56}
57
58MetricStat::MetricStat(MetricStat&& other) noexcept
59 : mId(std::move(other.mId)),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected