FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
netdata/python.d/example.chart.py at master · jackycheng86/netdata · GitHub
jackycheng86
/
netdata
Public
forked from
ktsaou/netdata
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
netdata
/
python.d
/
example.chart.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (28 loc) · 981 Bytes
Breadcrumbs
netdata
/
python.d
/
example.chart.py
Copy path
File metadata and controls
36 lines (28 loc) · 981 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# -*- coding: utf-8 -*-
# Description: example netdata python.d module
# Author: Pawel Krupa (paulfantom)
import
os
import
random
from
base
import
SimpleService
NAME
=
os
.
path
.
basename
(
__file__
).
replace
(
".chart.py"
,
""
)
# default module values
# update_every = 4
priority
=
90000
retries
=
60
class
Service
(
SimpleService
):
def
__init__
(
self
,
configuration
=
None
,
name
=
None
):
super
(
self
.
__class__
,
self
).
__init__
(
configuration
=
configuration
,
name
=
name
)
def
check
(
self
):
return
True
def
create
(
self
):
self
.
chart
(
"example.python_random"
,
''
,
'A random number'
,
'random number'
,
'random'
,
'random'
,
'line'
,
self
.
priority
,
self
.
update_every
)
self
.
dimension
(
'random1'
)
self
.
commit
()
return
True
def
update
(
self
,
interval
):
self
.
begin
(
"example.python_random"
,
interval
)
self
.
set
(
"random1"
,
random
.
randint
(
0
,
100
))
self
.
end
()
self
.
commit
()
return
True
Back
|
FazBrowse Home
|
New Git URL