summaryrefslogtreecommitdiffstats
path: root/staging_vespalib/src/vespa/vespalib/metrics/bucket.h
diff options
context:
space:
mode:
Diffstat (limited to 'staging_vespalib/src/vespa/vespalib/metrics/bucket.h')
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/bucket.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/bucket.h b/staging_vespalib/src/vespa/vespalib/metrics/bucket.h
new file mode 100644
index 00000000000..c35be945343
--- /dev/null
+++ b/staging_vespalib/src/vespa/vespalib/metrics/bucket.h
@@ -0,0 +1,40 @@
+// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#pragma once
+
+#include <mutex>
+#include "stable_store.h"
+#include "metric_identifier.h"
+#include "counter.h"
+#include "gauge.h"
+#include "clock.h"
+#include "counter_aggregator.h"
+#include "gauge_aggregator.h"
+#include "current_samples.h"
+
+namespace vespalib {
+namespace metrics {
+
+// internal
+struct Bucket {
+ InternalTimeStamp startTime;
+ InternalTimeStamp endTime;
+ std::vector<CounterAggregator> counters;
+ std::vector<GaugeAggregator> gauges;
+
+ void merge(const CurrentSamples &other);
+ void merge(const Bucket &other);
+
+ Bucket(InternalTimeStamp started, InternalTimeStamp ended)
+ : startTime(started),
+ endTime(ended),
+ counters(),
+ gauges()
+ {}
+ ~Bucket() {}
+ Bucket(Bucket &&) = default;
+ Bucket(const Bucket &) = default;
+ Bucket& operator= (Bucket &&) = default;
+};
+
+} // namespace vespalib::metrics
+} // namespace vespalib