diff options
author | Pim van den Berg | 2014-05-03 19:17:16 +0200 |
---|---|---|
committer | Pim van den Berg | 2014-05-12 21:32:24 +0200 |
commit | 0a547add2f4cc264380d2dab2c472efe5a1d7094 (patch) | |
tree | 55bb43a3e31c5814848d61eea92c8438e4a37886 /plugin/zfs_arc.php | |
parent | type/base: set default title to "Plugin Type (PluginInstance) (Category)" (diff) | |
download | apt-panopticon_cgp-0a547add2f4cc264380d2dab2c472efe5a1d7094.zip apt-panopticon_cgp-0a547add2f4cc264380d2dab2c472efe5a1d7094.tar.gz apt-panopticon_cgp-0a547add2f4cc264380d2dab2c472efe5a1d7094.tar.bz2 apt-panopticon_cgp-0a547add2f4cc264380d2dab2c472efe5a1d7094.tar.xz |
graph.php: use JSON plugins instead of including PHP plugin files
A couple of big changes here. A lot of logic moved to graph.php.
The PHP plugin files have been rewritten to JSON. In these JSON files
*everything* is optional. Also *NOT* having a JSON plugin file won't
block you from having a graph. The JSON will just make the graphs
prettier (by having a title, y-axis title, legend, colors, etc..).
The Collectd types.db file is parsed and used to determine RRD content.
When things are not defined in the JSON it will fallback to a default.
Diffstat (limited to 'plugin/zfs_arc.php')
-rw-r--r-- | plugin/zfs_arc.php | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/plugin/zfs_arc.php b/plugin/zfs_arc.php deleted file mode 100644 index 5c25c3a..0000000 --- a/plugin/zfs_arc.php +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | <?php | ||
2 | # Collectd zfs_arc plugin | ||
3 | |||
4 | require_once 'conf/common.inc.php'; | ||
5 | require_once 'type/Default.class.php'; | ||
6 | |||
7 | ## LAYOUT | ||
8 | # zfs_arc/ | ||
9 | # zfs_arc/arc_counts-hits.rrd | ||
10 | # zfs_arc/arc_counts-misses.rrd | ||
11 | # zfs_arc/arc_l2_bytes.rrd | ||
12 | # zfs_arc/arc_l2_size.rrd | ||
13 | # zfs_arc/arc_ratio-L1.rrd | ||
14 | # zfs_arc/arc_ratio-L2.rrd | ||
15 | # zfs_arc/arc_size.rrd | ||
16 | |||
17 | $obj = new Type_Default($CONFIG, $_GET); | ||
18 | $obj->rrd_format = '%5.1lf%s'; | ||
19 | |||
20 | switch($obj->args['type']) { | ||
21 | case 'arc_counts': | ||
22 | $obj->data_sources = array( | ||
23 | 'demand_data', | ||
24 | 'demand_metadata', | ||
25 | 'prefetch_data', | ||
26 | 'prefetch_metadata', | ||
27 | ); | ||
28 | $obj->colors = array( | ||
29 | 'hits-demand_data' => 'ff0000', | ||
30 | 'misses-demand_data' => '880000', | ||
31 | 'hits-demand_metadata' => '00ff00', | ||
32 | 'misses-demand_metadata' => '00aa00', | ||
33 | 'hits-prefetch_data' => '0000ff', | ||
34 | 'misses-prefetch_data' => '00f0f0', | ||
35 | 'hits-prefetch_metadata' => 'ff00ff', | ||
36 | 'misses-prefetch_metadata' => '888800', | ||
37 | ); | ||
38 | $obj->legend = array( | ||
39 | 'hits-demand_data' => 'data hits', | ||
40 | 'misses-demand_data' => 'metadata misses', | ||
41 | 'hits-demand_metadata' => 'metadata hits', | ||
42 | 'misses-demand_metadata' => 'metadata misses', | ||
43 | 'hits-prefetch_data' => 'prefetch data hits', | ||
44 | 'misses-prefetch_data' => 'prefetch data misses', | ||
45 | 'hits-prefetch_metadata' => 'prefetch metadata hits', | ||
46 | 'misses-prefetch_metadata' => 'prefetch metadata misses', | ||
47 | ); | ||
48 | $obj->rrd_title = 'arc counts'; | ||
49 | $obj->rrd_vertical = 'count'; | ||
50 | break; | ||
51 | case 'arc_size': | ||
52 | $obj->data_sources = array('current','target','minlimit','maxlimit'); | ||
53 | $obj->order = array( | ||
54 | 'current', | ||
55 | 'target', | ||
56 | 'minlimit', | ||
57 | 'maxlimit', | ||
58 | ); | ||
59 | $obj->rrd_title = 'Arc size'; | ||
60 | $obj->rrd_vertical = 'bytes'; | ||
61 | break; | ||
62 | case 'arc_l2_bytes': | ||
63 | $obj->data_sources = array( | ||
64 | 'write', | ||
65 | 'read', | ||
66 | ); | ||
67 | $obj->legend = array( | ||
68 | 'write' => 'Write', | ||
69 | 'read' => 'Read', | ||
70 | ); | ||
71 | $obj->colors = array( | ||
72 | 'write' => 'ff0000', | ||
73 | 'read' => '0000ff', | ||
74 | ); | ||
75 | $obj->rrd_title = 'Arc L2 bytes'; | ||
76 | $obj->rrd_vertical = 'bytes'; | ||
77 | break; | ||
78 | case 'arc_l2_size': | ||
79 | $obj->data_sources = array( | ||
80 | 'value', | ||
81 | ); | ||
82 | $obj->legend = array( | ||
83 | 'value' => 'Bytes', | ||
84 | ); | ||
85 | $obj->colors = array( | ||
86 | 'value' => '0000ff', | ||
87 | ); | ||
88 | $obj->rrd_title = 'Arc L2 size'; | ||
89 | $obj->rrd_vertical = 'bytes'; | ||
90 | break; | ||
91 | case 'arc_ratio': | ||
92 | $obj->data_sources = array('value'); | ||
93 | $obj->rrd_title = 'Arc ratio'; | ||
94 | $obj->rrd_vertical = 'ratio'; | ||
95 | break; | ||
96 | } | ||
97 | $obj->rrd_graph(); | ||