summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/modules/tengine/collect.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/go/collectors/go.d.plugin/modules/tengine/collect.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/tengine/collect.go b/src/go/collectors/go.d.plugin/modules/tengine/collect.go
new file mode 100644
index 000000000..83dcba177
--- /dev/null
+++ b/src/go/collectors/go.d.plugin/modules/tengine/collect.go
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package tengine
+
+import (
+ "github.com/netdata/netdata/go/go.d.plugin/pkg/stm"
+)
+
+func (t *Tengine) collect() (map[string]int64, error) {
+ status, err := t.apiClient.getStatus()
+ if err != nil {
+ return nil, err
+ }
+
+ mx := make(map[string]int64)
+ for _, m := range *status {
+ for k, v := range stm.ToMap(m) {
+ mx[k] += v
+ }
+ }
+ return mx, nil
+}