| 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; |