summaryrefslogtreecommitdiffstats
path: root/src/go/plugin/go.d/modules/ipfs/charts.go
blob: 1f71c7b40d628f02ee0d002fb3b189a47511bdf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// SPDX-License-Identifier: GPL-3.0-or-later

package ipfs

import (
	"github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module"
)

const (
	prioBandwidth = module.Priority + iota
	prioSwarmPeers
	prioDatastoreSpaceUtilization
	prioRepoSize
	prioRepoObj
	prioRepoPinnedObj
)

var charts = module.Charts{
	bandwidthChart.Copy(),
	peersChart.Copy(),
	datastoreUtilizationChart.Copy(),
	repoSizeChart.Copy(),
	repoObjChart.Copy(),
	repoPinnedObjChart.Copy(),
}

var (
	bandwidthChart = module.Chart{
		ID:       "bandwidth",
		Title:    "IPFS Bandwidth",
		Units:    "bytes/s",
		Fam:      "bandwidth",
		Ctx:      "ipfs.bandwidth",
		Type:     module.Area,
		Priority: prioBandwidth,
		Dims: module.Dims{
			{ID: "in", Algo: module.Incremental},
			{ID: "out", Mul: -1, Algo: module.Incremental},
		},
	}

	peersChart = module.Chart{
		ID:       "peers",
		Title:    "IPFS Peers",
		Units:    "peers",
		Fam:      "peers",
		Ctx:      "ipfs.peers",
		Type:     module.Line,
		Priority: prioSwarmPeers,
		Dims: module.Dims{
			{ID: "peers"},
		},
	}

	datastoreUtilizationChart = module.Chart{
		ID:       "datastore_space_utilization",
		Title:    "IPFS Datastore Space Utilization",
		Units:    "percent",
		Fam:      "size",
		Ctx:      "ipfs.datastore_space_utilization",
		Type:     module.Area,
		Priority: prioDatastoreSpaceUtilization,
		Dims: module.Dims{
			{ID: "used_percent", Name: "used"},
		},
	}
	repoSizeChart = module.Chart{
		ID:       "repo_size",
		Title:    "IPFS Repo Size",
		Units:    "bytes",
		Fam:      "size",
		Ctx:      "ipfs.repo_size",
		Type:     module.Line,
		Priority: prioRepoSize,
		Dims: module.Dims{
			{ID: "size"},
		},
	}

	repoObjChart = module.Chart{
		ID:       "repo_objects",
		Title:    "IPFS Repo Objects",
		Units:    "objects",
		Fam:      "objects",
		Ctx:      "ipfs.repo_objects",
		Type:     module.Line,
		Priority: prioRepoObj,
		Dims: module.Dims{
			{ID: "objects"},
		},
	}
	repoPinnedObjChart = module.Chart{
		ID:       "repo_pinned_objects",
		Title:    "IPFS Repo Pinned Objects",
		Units:    "objects",
		Fam:      "objects",
		Ctx:      "ipfs.repo_pinned_objects",
		Type:     module.Line,
		Priority: prioRepoPinnedObj,
		Dims: module.Dims{
			{ID: "pinned"},
			{ID: "recursive_pins"},
		},
	}
)