mihai.leontescu / metrics (public) (License: GPLv3) (since 2018-07-12) (hash sha1)
Metrics for Linux to feed to Graphite in python
Disclaimer: I am not a programmer, I know some things can be done better. I choose to do them so, so I am able to understand them 80 years later :)
List of commits:
Subject Hash Author Date (UTC)
graphana examples 63d6edb628092720782795a1385349fe14fa7e58 mihai.leontescu 2018-07-12 19:34:02
initial commit pre-alpha d4f64fe23a814b563d1df7fea142daae8aaa0a75 mihai.leontescu 2018-07-12 19:29:49
Commit 63d6edb628092720782795a1385349fe14fa7e58 - graphana examples
Author: mihai.leontescu
Author date (UTC): 2018-07-12 19:34
Committer name: mihai.leontescu
Committer date (UTC): 2018-07-12 19:34
Parent(s): d4f64fe23a814b563d1df7fea142daae8aaa0a75
Signing key:
Tree: 471a2619b7683790d7a330c0100c9449f0f8d3fe
File Lines added Lines deleted
graphana_examples/shuttle-system.json 394 0
logs/metrics.log 28 0
File graphana_examples/shuttle-system.json added (mode: 100644) (index 0000000..24db573)
1 {
2 "__inputs": [
3 {
4 "name": "DS_GRAPHITE",
5 "label": "Graphite",
6 "description": "",
7 "type": "datasource",
8 "pluginId": "graphite",
9 "pluginName": "Graphite"
10 }
11 ],
12 "__requires": [
13 {
14 "type": "grafana",
15 "id": "grafana",
16 "name": "Grafana",
17 "version": "5.1.3"
18 },
19 {
20 "type": "panel",
21 "id": "graph",
22 "name": "Graph",
23 "version": "5.0.0"
24 },
25 {
26 "type": "datasource",
27 "id": "graphite",
28 "name": "Graphite",
29 "version": "5.0.0"
30 }
31 ],
32 "annotations": {
33 "list": [
34 {
35 "builtIn": 1,
36 "datasource": "-- Grafana --",
37 "enable": true,
38 "hide": true,
39 "iconColor": "rgba(0, 211, 255, 1)",
40 "name": "Annotations & Alerts",
41 "type": "dashboard"
42 }
43 ]
44 },
45 "editable": true,
46 "gnetId": null,
47 "graphTooltip": 0,
48 "id": null,
49 "links": [],
50 "panels": [
51 {
52 "aliasColors": {
53 "idle": "#e0f9d7",
54 "iowait": "#bf1b00",
55 "perSecond(linux.shuttle.system.cpu.iowait.ticks)": "#bf1b00",
56 "perSecond(linux.shuttle.system.cpu.user.ticks)": "#0a50a1",
57 "perSecond(shuttle.system.cpu.cpu.idle.ticks)": "#9ac48a",
58 "perSecond(shuttle.system.cpu.cpu.iowait.ticks)": "#890f02",
59 "perSecond(shuttle.system.cpu.cpu.irq.ticks)": "#052b51",
60 "perSecond(shuttle.system.cpu.cpu.nice.ticks)": "#511749",
61 "perSecond(shuttle.system.cpu.cpu.system.ticks)": "#f9934e",
62 "perSecond(shuttle.system.cpu.cpu.user.ticks)": "#052b51",
63 "shuttle.system.cpu.cpu.system.ticks": "#0a437c",
64 "system": "#ba43a9",
65 "user": "#0a50a1"
66 },
67 "bars": false,
68 "dashLength": 10,
69 "dashes": false,
70 "datasource": "${DS_GRAPHITE}",
71 "fill": 2,
72 "gridPos": {
73 "h": 10,
74 "w": 12,
75 "x": 0,
76 "y": 0
77 },
78 "id": 4,
79 "legend": {
80 "alignAsTable": true,
81 "avg": false,
82 "current": false,
83 "hideZero": false,
84 "max": false,
85 "min": false,
86 "show": true,
87 "total": false,
88 "values": false
89 },
90 "lines": true,
91 "linewidth": 1,
92 "links": [],
93 "nullPointMode": "null",
94 "percentage": true,
95 "pointradius": 5,
96 "points": false,
97 "renderer": "flot",
98 "seriesOverrides": [
99 {
100 "alias": "perSecond(shuttle.system.cpu.cpu.iowait.ticks)",
101 "yaxis": 1
102 }
103 ],
104 "spaceLength": 10,
105 "stack": true,
106 "steppedLine": false,
107 "targets": [
108 {
109 "refCount": 0,
110 "refId": "B",
111 "target": "alias(perSecond(linux.shuttle.system.cpu.system.ticks, 1000000000000000), 'system')"
112 },
113 {
114 "refCount": 0,
115 "refId": "C",
116 "target": "alias(perSecond(linux.shuttle.system.cpu.user.ticks, 10000000000000000), 'user')",
117 "textEditor": false
118 },
119 {
120 "refCount": 0,
121 "refId": "D",
122 "target": "alias(perSecond(linux.shuttle.system.cpu.iowait.ticks, 10000000000000000), 'iowait')",
123 "textEditor": false
124 },
125 {
126 "refCount": 0,
127 "refId": "E",
128 "target": "alias(perSecond(linux.shuttle.system.cpu.idle.ticks, 10000000000000000), 'idle')",
129 "textEditor": false
130 }
131 ],
132 "thresholds": [],
133 "timeFrom": null,
134 "timeShift": null,
135 "title": "CPU Statistics",
136 "tooltip": {
137 "shared": true,
138 "sort": 0,
139 "value_type": "individual"
140 },
141 "transparent": false,
142 "type": "graph",
143 "xaxis": {
144 "buckets": null,
145 "mode": "time",
146 "name": null,
147 "show": true,
148 "values": []
149 },
150 "yaxes": [
151 {
152 "format": "short",
153 "label": null,
154 "logBase": 1,
155 "max": null,
156 "min": null,
157 "show": true
158 },
159 {
160 "format": "short",
161 "label": null,
162 "logBase": 1,
163 "max": null,
164 "min": null,
165 "show": true
166 }
167 ],
168 "yaxis": {
169 "align": false,
170 "alignLevel": null
171 }
172 },
173 {
174 "aliasColors": {},
175 "bars": false,
176 "dashLength": 10,
177 "dashes": false,
178 "datasource": "${DS_GRAPHITE}",
179 "fill": 1,
180 "gridPos": {
181 "h": 10,
182 "w": 12,
183 "x": 12,
184 "y": 0
185 },
186 "id": 6,
187 "legend": {
188 "alignAsTable": true,
189 "avg": true,
190 "current": true,
191 "max": true,
192 "min": true,
193 "show": true,
194 "total": false,
195 "values": true
196 },
197 "lines": true,
198 "linewidth": 1,
199 "links": [],
200 "nullPointMode": "null",
201 "percentage": false,
202 "pointradius": 5,
203 "points": false,
204 "renderer": "flot",
205 "seriesOverrides": [],
206 "spaceLength": 10,
207 "stack": false,
208 "steppedLine": false,
209 "targets": [
210 {
211 "refCount": 0,
212 "refId": "A",
213 "target": "alias(perSecond(linux.shuttle.system.ctxt.contextswitches, 1000000000000000), 'Context Switches')"
214 },
215 {
216 "refCount": 0,
217 "refId": "B",
218 "target": "alias(perSecond(linux.shuttle.system.processes.processes, 1000000000000000), 'new Processes')"
219 }
220 ],
221 "thresholds": [],
222 "timeFrom": null,
223 "timeShift": null,
224 "title": "Context Switches & Process Spawning",
225 "tooltip": {
226 "shared": true,
227 "sort": 0,
228 "value_type": "individual"
229 },
230 "type": "graph",
231 "xaxis": {
232 "buckets": null,
233 "mode": "time",
234 "name": null,
235 "show": true,
236 "values": []
237 },
238 "yaxes": [
239 {
240 "format": "short",
241 "label": null,
242 "logBase": 1,
243 "max": null,
244 "min": null,
245 "show": true
246 },
247 {
248 "format": "short",
249 "label": null,
250 "logBase": 1,
251 "max": null,
252 "min": null,
253 "show": true
254 }
255 ],
256 "yaxis": {
257 "align": false,
258 "alignLevel": null
259 }
260 },
261 {
262 "aliasColors": {
263 "reads": "#0a50a1",
264 "shuttle.system.disk.sda.write.sectors": "#bf1b00",
265 "writes": "#bf1b00"
266 },
267 "bars": false,
268 "dashLength": 10,
269 "dashes": false,
270 "datasource": "${DS_GRAPHITE}",
271 "fill": 1,
272 "gridPos": {
273 "h": 9,
274 "w": 24,
275 "x": 0,
276 "y": 10
277 },
278 "id": 2,
279 "legend": {
280 "alignAsTable": true,
281 "avg": true,
282 "current": true,
283 "max": true,
284 "min": true,
285 "show": true,
286 "total": true,
287 "values": true
288 },
289 "lines": true,
290 "linewidth": 1,
291 "links": [],
292 "nullPointMode": "null",
293 "percentage": false,
294 "pointradius": 5,
295 "points": false,
296 "renderer": "flot",
297 "seriesOverrides": [],
298 "spaceLength": 10,
299 "stack": false,
300 "steppedLine": false,
301 "targets": [
302 {
303 "refCount": 0,
304 "refId": "A",
305 "target": "alias(scale(perSecond(linux.shuttle.system.disk.sda.read.sectors, 1000000000000), 512), 'reads')"
306 },
307 {
308 "refCount": 0,
309 "refId": "B",
310 "target": "alias(scale(perSecond(linux.shuttle.system.disk.sda.write.sectors, 1000000000000), 512), 'writes')"
311 }
312 ],
313 "thresholds": [],
314 "timeFrom": null,
315 "timeShift": null,
316 "title": "Disk Statistics (sda)",
317 "tooltip": {
318 "shared": true,
319 "sort": 0,
320 "value_type": "individual"
321 },
322 "type": "graph",
323 "xaxis": {
324 "buckets": null,
325 "mode": "time",
326 "name": null,
327 "show": true,
328 "values": []
329 },
330 "yaxes": [
331 {
332 "format": "Bps",
333 "label": null,
334 "logBase": 1,
335 "max": null,
336 "min": null,
337 "show": true
338 },
339 {
340 "format": "Bps",
341 "label": null,
342 "logBase": 1,
343 "max": null,
344 "min": null,
345 "show": true
346 }
347 ],
348 "yaxis": {
349 "align": false,
350 "alignLevel": null
351 }
352 }
353 ],
354 "refresh": "10s",
355 "schemaVersion": 16,
356 "style": "dark",
357 "tags": [],
358 "templating": {
359 "list": []
360 },
361 "time": {
362 "from": "now-5m",
363 "to": "now"
364 },
365 "timepicker": {
366 "refresh_intervals": [
367 "5s",
368 "10s",
369 "30s",
370 "1m",
371 "5m",
372 "15m",
373 "30m",
374 "1h",
375 "2h",
376 "1d"
377 ],
378 "time_options": [
379 "5m",
380 "15m",
381 "1h",
382 "6h",
383 "12h",
384 "24h",
385 "2d",
386 "7d",
387 "30d"
388 ]
389 },
390 "timezone": "",
391 "title": "Shuttle System",
392 "uid": "TH3uEoNik",
393 "version": 20
394 }
File logs/metrics.log changed (mode: 100644) (index 76daac4..bec6dbf)
... ... Thu Jul 12 21:29:13 2018 START: Sending metrics --> Thu Jul 12 21:29:13 2018 OK
189297 189297 Thu Jul 12 21:29:22 2018 START: Sending metrics --> Thu Jul 12 21:29:22 2018 OK Thu Jul 12 21:29:22 2018 START: Sending metrics --> Thu Jul 12 21:29:22 2018 OK
189298 189298 Thu Jul 12 21:29:31 2018 START: Sending metrics --> Thu Jul 12 21:29:32 2018 OK Thu Jul 12 21:29:31 2018 START: Sending metrics --> Thu Jul 12 21:29:32 2018 OK
189299 189299 Thu Jul 12 21:29:41 2018 START: Sending metrics --> Thu Jul 12 21:29:41 2018 OK Thu Jul 12 21:29:41 2018 START: Sending metrics --> Thu Jul 12 21:29:41 2018 OK
189300 Thu Jul 12 21:29:50 2018 START: Sending metrics --> Thu Jul 12 21:29:50 2018 OK
189301 Thu Jul 12 21:29:59 2018 START: Sending metrics --> Thu Jul 12 21:29:59 2018 OK
189302 Thu Jul 12 21:30:08 2018 START: Sending metrics --> Thu Jul 12 21:30:08 2018 OK
189303 Thu Jul 12 21:30:17 2018 START: Sending metrics --> Thu Jul 12 21:30:17 2018 OK
189304 Thu Jul 12 21:30:26 2018 START: Sending metrics --> Thu Jul 12 21:30:26 2018 OK
189305 Thu Jul 12 21:30:35 2018 START: Sending metrics --> Thu Jul 12 21:30:35 2018 OK
189306 Thu Jul 12 21:30:44 2018 START: Sending metrics --> Thu Jul 12 21:30:44 2018 OK
189307 Thu Jul 12 21:30:53 2018 START: Sending metrics --> Thu Jul 12 21:30:53 2018 OK
189308 Thu Jul 12 21:31:02 2018 START: Sending metrics --> Thu Jul 12 21:31:02 2018 OK
189309 Thu Jul 12 21:31:11 2018 START: Sending metrics --> Thu Jul 12 21:31:11 2018 OK
189310 Thu Jul 12 21:31:20 2018 START: Sending metrics --> Thu Jul 12 21:31:20 2018 OK
189311 Thu Jul 12 21:31:29 2018 START: Sending metrics --> Thu Jul 12 21:31:29 2018 OK
189312 Thu Jul 12 21:31:38 2018 START: Sending metrics --> Thu Jul 12 21:31:38 2018 OK
189313 Thu Jul 12 21:31:47 2018 START: Sending metrics --> Thu Jul 12 21:31:47 2018 OK
189314 Thu Jul 12 21:31:56 2018 START: Sending metrics --> Thu Jul 12 21:31:56 2018 OK
189315 Thu Jul 12 21:32:05 2018 START: Sending metrics --> Thu Jul 12 21:32:05 2018 OK
189316 Thu Jul 12 21:32:14 2018 START: Sending metrics --> Thu Jul 12 21:32:14 2018 OK
189317 Thu Jul 12 21:32:23 2018 START: Sending metrics --> Thu Jul 12 21:32:23 2018 OK
189318 Thu Jul 12 21:32:32 2018 START: Sending metrics --> Thu Jul 12 21:32:32 2018 OK
189319 Thu Jul 12 21:32:41 2018 START: Sending metrics --> Thu Jul 12 21:32:41 2018 OK
189320 Thu Jul 12 21:32:50 2018 START: Sending metrics --> Thu Jul 12 21:32:50 2018 OK
189321 Thu Jul 12 21:32:59 2018 START: Sending metrics --> Thu Jul 12 21:32:59 2018 OK
189322 Thu Jul 12 21:33:08 2018 START: Sending metrics --> Thu Jul 12 21:33:08 2018 OK
189323 Thu Jul 12 21:33:17 2018 START: Sending metrics --> Thu Jul 12 21:33:17 2018 OK
189324 Thu Jul 12 21:33:26 2018 START: Sending metrics --> Thu Jul 12 21:33:26 2018 OK
189325 Thu Jul 12 21:33:35 2018 START: Sending metrics --> Thu Jul 12 21:33:35 2018 OK
189326 Thu Jul 12 21:33:44 2018 START: Sending metrics --> Thu Jul 12 21:33:44 2018 OK
189327 Thu Jul 12 21:33:53 2018 START: Sending metrics --> Thu Jul 12 21:33:53 2018 OK
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mihai.leontescu/metrics

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mihai.leontescu/metrics

Clone this repository using git:
git clone git://git.rocketgit.com/user/mihai.leontescu/metrics

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main