MCPcopy Create free account
hub / github.com/apache/brpc / take_sample

Method take_sample

src/bvar/window.h:61–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 : _owner(owner), _series(Op(var)) {}
60 ~SeriesSampler() {}
61 void take_sample() override {
62 if (series_freq == SERIES_IN_SECOND) {
63 // Get one-second window value for PerSecond<>, otherwise the
64 // "smoother" plot may hide peaks.
65 _series.append(_owner->get_value(1));
66 } else {
67 // Get the value inside the full window. "get_value(1)" is
68 // incorrect when users intend to see aggregated values of
69 // the full window in the plot.
70 _series.append(_owner->get_value());
71 }
72 }
73 void describe(std::ostream& os) { _series.describe(os, NULL); }
74 private:
75 WindowBase* _owner;

Callers

nothing calls this directly

Calls 2

appendMethod · 0.45
get_valueMethod · 0.45

Tested by

no test coverage detected