@@ -4,15 +4,14 @@ Hello World Example
4
4
5
5
A minimal example to see sqlalchemy-collectd do something.
6
6
7
-
8
7
Step One - Run collectd as a console app
9
8
========================================
10
9
11
10
In one terminal window, run collectd as an interactive application with
12
11
the -f flag::
13
12
14
- # cd examples/helloworld
15
- # collectd -f -C collectdconsole.conf
13
+ # cd examples/helloworld
14
+ # collectd -f -C collectdconsole.conf
16
15
17
16
The ``collectdconsole.conf `` includes a relative path to the
18
17
sqlalchemy-collectd checkout as the module path.
@@ -23,28 +22,39 @@ Step Two - Run the demo program
23
22
This program uses a SQLite database for starters. It spins up
24
23
five processes with 20 threads each::
25
24
26
- # python run_queries.py
25
+ # python run_queries.py
27
26
28
27
Step Three - watch collectd console
29
28
===================================
30
29
31
30
Output looks something like::
32
31
33
- $ collectd -f -C collectdconsole.conf
34
- [2018-02-11 18:29:35] plugin_load: plugin "logfile" successfully loaded.
35
- [2018-02-11 18:29:35] [info] plugin_load: plugin "write_log" successfully loaded.
36
- [2018-02-11 18:29:35] [info] plugin_load: plugin "python" successfully loaded.
37
- [2018-02-11 18:29:35] [info] sqlalchemy_collectd plugin version 0.0.1
38
- [2018-02-11 18:29:35] [info] Python version: 3.6.4 (default, Jan 23 2018, 22:28:37)
39
- [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)]
40
- [2018-02-11 18:29:35] [info] Initialization complete, entering read-loop.
41
- [2018-02-11 18:29:45] [info] write_log values:
42
- [{"values":[0],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"run_queries.py","type":"count","type_instance":"checkedin"}]
43
- [2018-02-11 18:29:45] [info] write_log values:
44
- [{"values":[0],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"run_queries.py","type":"count","type_instance":"detached"}]
45
- [2018-02-11 18:29:45] [info] write_log values:
46
- [{"values":[6],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"run_queries.py","type":"count","type_instance":"numprocs"}]
47
- [2018-02-11 18:29:45] [info] write_log values:
48
- [{"values":[6],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"run_queries.py","type":"count","type_instance":"numpools"}]
49
- [2018-02-11 18:29:45] [info] write_log values:
50
- [{"values":[28],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"host","type":"count","type_instance":"checkedout"}]
32
+ $ collectd -f -C collectdconsole.conf
33
+ [2018-02-11 18:29:35] plugin_load: plugin "logfile" successfully loaded.
34
+ [2018-02-11 18:29:35] [info] plugin_load: plugin "write_log" successfully loaded.
35
+ [2018-02-11 18:29:35] [info] plugin_load: plugin "python" successfully loaded.
36
+ [2018-02-11 18:29:35] [info] sqlalchemy_collectd plugin version 0.0.1
37
+ [2018-02-11 18:29:35] [info] Python version: 3.6.4 (default, Jan 23 2018, 22:28:37)
38
+ [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)]
39
+ [2018-02-11 18:29:35] [info] Initialization complete, entering read-loop.
40
+ [2018-02-11 18:29:45] [info] write_log values:
41
+ [{"values":[0],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"run_queries.py","type":"count","type_instance":"checkedin"}]
42
+ [2018-02-11 18:29:45] [info] write_log values:
43
+ [{"values":[0],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"run_queries.py","type":"count","type_instance":"detached"}]
44
+ [2018-02-11 18:29:45] [info] write_log values:
45
+ [{"values":[6],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"run_queries.py","type":"count","type_instance":"numprocs"}]
46
+ [2018-02-11 18:29:45] [info] write_log values:
47
+ [{"values":[6],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"run_queries.py","type":"count","type_instance":"numpools"}]
48
+ [2018-02-11 18:29:45] [info] write_log values:
49
+ [{"values":[28],"dstypes":["gauge"],"dsnames":["value"],"time":1518391784.793,"interval":10.000,"host":"photon2","plugin":"sqlalchemy","plugin_instance":"host","type":"count","type_instance":"checkedout"}]
50
+
51
+ Step Four - Try out Connmon
52
+ ===========================
53
+
54
+ The **connmon ** console client is an optional feature that connects to the
55
+ SQLAlchemy-collectd plugin running inside the collectd server to print live
56
+ stats. Once the above steps are all running, try out the client::
57
+
58
+ # connmon
59
+
60
+
0 commit comments