aboutsummaryrefslogtreecommitdiffstats
path: root/library/go/yandex/unistat/aggr
diff options
context:
space:
mode:
authorhcpp <hcpp@ydb.tech>2023-11-08 12:09:41 +0300
committerhcpp <hcpp@ydb.tech>2023-11-08 12:56:14 +0300
commita361f5b98b98b44ea510d274f6769164640dd5e1 (patch)
treec47c80962c6e2e7b06798238752fd3da0191a3f6 /library/go/yandex/unistat/aggr
parent9478806fde1f4d40bd5a45e7cbe77237dab613e9 (diff)
downloadydb-a361f5b98b98b44ea510d274f6769164640dd5e1.tar.gz
metrics have been added
Diffstat (limited to 'library/go/yandex/unistat/aggr')
-rw-r--r--library/go/yandex/unistat/aggr/aggr.go64
-rw-r--r--library/go/yandex/unistat/aggr/ya.make5
2 files changed, 69 insertions, 0 deletions
diff --git a/library/go/yandex/unistat/aggr/aggr.go b/library/go/yandex/unistat/aggr/aggr.go
new file mode 100644
index 0000000000..515c5c0335
--- /dev/null
+++ b/library/go/yandex/unistat/aggr/aggr.go
@@ -0,0 +1,64 @@
+package aggr
+
+import "github.com/ydb-platform/ydb/library/go/yandex/unistat"
+
+// Histogram returns delta histogram aggregation (dhhh).
+func Histogram() unistat.Aggregation {
+ return unistat.StructuredAggregation{
+ AggregationType: unistat.Delta,
+ Group: unistat.Hgram,
+ MetaGroup: unistat.Hgram,
+ Rollup: unistat.Hgram,
+ }
+}
+
+// AbsoluteHistogram returns absolute histogram aggregation (ahhh).
+func AbsoluteHistogram() unistat.Aggregation {
+ return unistat.StructuredAggregation{
+ AggregationType: unistat.Absolute,
+ Group: unistat.Hgram,
+ MetaGroup: unistat.Hgram,
+ Rollup: unistat.Hgram,
+ }
+}
+
+// Counter returns counter aggregation (dmmm)
+func Counter() unistat.Aggregation {
+ return unistat.StructuredAggregation{
+ AggregationType: unistat.Delta,
+ Group: unistat.Sum,
+ MetaGroup: unistat.Sum,
+ Rollup: unistat.Sum,
+ }
+}
+
+// Absolute returns value aggregation (ammm)
+func Absolute() unistat.Aggregation {
+ return unistat.StructuredAggregation{
+ AggregationType: unistat.Absolute,
+ Group: unistat.Sum,
+ MetaGroup: unistat.Sum,
+ Rollup: unistat.Sum,
+ }
+}
+
+// SummAlias corresponds to _summ suffix
+type SummAlias struct{}
+
+func (s SummAlias) Suffix() string {
+ return "summ"
+}
+
+// SummAlias corresponds to _hgram suffix
+type HgramAlias struct{}
+
+func (s HgramAlias) Suffix() string {
+ return "hgram"
+}
+
+// SummAlias corresponds to _max suffix
+type MaxAlias struct{}
+
+func (s MaxAlias) Suffix() string {
+ return "max"
+}
diff --git a/library/go/yandex/unistat/aggr/ya.make b/library/go/yandex/unistat/aggr/ya.make
new file mode 100644
index 0000000000..21d6599197
--- /dev/null
+++ b/library/go/yandex/unistat/aggr/ya.make
@@ -0,0 +1,5 @@
+GO_LIBRARY()
+
+SRCS(aggr.go)
+
+END()