diff options
Diffstat (limited to '')
-rw-r--r-- | plugin/zfs_arc.php | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/plugin/zfs_arc.php b/plugin/zfs_arc.php index 4a2592b..d40912d 100644 --- a/plugin/zfs_arc.php +++ b/plugin/zfs_arc.php | |||
@@ -14,16 +14,19 @@ require_once 'inc/collectd.inc.php'; | |||
14 | # zfs_arc/arc_ratio-L1.rrd | 14 | # zfs_arc/arc_ratio-L1.rrd |
15 | # zfs_arc/arc_ratio-L2.rrd | 15 | # zfs_arc/arc_ratio-L2.rrd |
16 | # zfs_arc/arc_size.rrd | 16 | # zfs_arc/arc_size.rrd |
17 | |||
17 | $obj = new Type_Default($CONFIG); | 18 | $obj = new Type_Default($CONFIG); |
18 | $obj->width = $width; | 19 | $obj->width = $width; |
19 | $obj->heigth = $heigth; | 20 | $obj->heigth = $heigth; |
21 | $obj->rrd_format = '%5.1lf%s'; | ||
22 | |||
20 | switch($obj->args['type']) { | 23 | switch($obj->args['type']) { |
21 | case 'arc_counts': | 24 | case 'arc_counts': |
22 | $obj->data_sources = array( | 25 | $obj->data_sources = array( |
23 | 'demand_data', | 26 | 'demand_data', |
24 | 'demand_metadata', | 27 | 'demand_metadata', |
25 | 'prefetch_data', | 28 | 'prefetch_data', |
26 | 'prefetch_metadata' | 29 | 'prefetch_metadata', |
27 | ); | 30 | ); |
28 | $obj->colors = array( | 31 | $obj->colors = array( |
29 | 'hits-demand_data' => 'ff0000', | 32 | 'hits-demand_data' => 'ff0000', |
@@ -33,7 +36,7 @@ switch($obj->args['type']) { | |||
33 | 'hits-prefetch_data' => '0000ff', | 36 | 'hits-prefetch_data' => '0000ff', |
34 | 'misses-prefetch_data' => '00f0f0', | 37 | 'misses-prefetch_data' => '00f0f0', |
35 | 'hits-prefetch_metadata' => 'ff00ff', | 38 | 'hits-prefetch_metadata' => 'ff00ff', |
36 | 'misses-prefetch_metadata' => '888800' | 39 | 'misses-prefetch_metadata' => '888800', |
37 | ); | 40 | ); |
38 | $obj->ds_names = array( | 41 | $obj->ds_names = array( |
39 | 'hits-demand_data' => 'data hits', | 42 | 'hits-demand_data' => 'data hits', |
@@ -43,11 +46,10 @@ switch($obj->args['type']) { | |||
43 | 'hits-prefetch_data' => 'prefetch data hits', | 46 | 'hits-prefetch_data' => 'prefetch data hits', |
44 | 'misses-prefetch_data' => 'prefetch data misses', | 47 | 'misses-prefetch_data' => 'prefetch data misses', |
45 | 'hits-prefetch_metadata' => 'prefetch metadata hits', | 48 | 'hits-prefetch_metadata' => 'prefetch metadata hits', |
46 | 'misses-prefetch_metadata' => 'prefetch metadata misses' | 49 | 'misses-prefetch_metadata' => 'prefetch metadata misses', |
47 | ); | 50 | ); |
48 | $obj->rrd_title = 'arc counts'; | 51 | $obj->rrd_title = 'arc counts'; |
49 | $obj->rrd_vertical = 'count'; | 52 | $obj->rrd_vertical = 'count'; |
50 | $obj->rrd_format = '%5.1lf%s'; | ||
51 | break; | 53 | break; |
52 | case 'arc_size': | 54 | case 'arc_size': |
53 | $obj->data_sources = array('current','target','minlimit','maxlimit'); | 55 | $obj->data_sources = array('current','target','minlimit','maxlimit'); |
@@ -55,48 +57,44 @@ switch($obj->args['type']) { | |||
55 | 'current', | 57 | 'current', |
56 | 'target', | 58 | 'target', |
57 | 'minlimit', | 59 | 'minlimit', |
58 | 'maxlimit' | 60 | 'maxlimit', |
59 | ); | 61 | ); |
60 | $obj->rrd_title = 'Arc size'; | 62 | $obj->rrd_title = 'Arc size'; |
61 | $obj->rrd_vertical = 'bytes'; | 63 | $obj->rrd_vertical = 'bytes'; |
62 | $obj->rrd_format = '%5.1lf%s'; | ||
63 | break; | 64 | break; |
64 | case 'arc_l2_bytes': | 65 | case 'arc_l2_bytes': |
65 | $obj->data_sources = array( | 66 | $obj->data_sources = array( |
66 | 'write', | 67 | 'write', |
67 | 'read' | 68 | 'read', |
68 | ); | 69 | ); |
69 | $obj->ds_names = array( | 70 | $obj->ds_names = array( |
70 | 'write' => 'Write', | 71 | 'write' => 'Write', |
71 | 'read' => 'Read', | 72 | 'read' => 'Read', |
72 | ); | 73 | ); |
73 | $obj->colors = array( | 74 | $obj->colors = array( |
74 | 'write' => 'ff0000', | 75 | 'write' => 'ff0000', |
75 | 'read' => '0000ff', | 76 | 'read' => '0000ff', |
76 | ); | 77 | ); |
77 | $obj->rrd_title = 'Arc L2 bytes'; | 78 | $obj->rrd_title = 'Arc L2 bytes'; |
78 | $obj->rrd_vertical = 'bytes'; | 79 | $obj->rrd_vertical = 'bytes'; |
79 | $obj->rrd_format = '%5.1lf%s'; | ||
80 | break; | 80 | break; |
81 | case 'arc_l2_size': | 81 | case 'arc_l2_size': |
82 | $obj->data_sources = array( | 82 | $obj->data_sources = array( |
83 | 'value' | 83 | 'value', |
84 | ); | 84 | ); |
85 | $obj->ds_names = array( | 85 | $obj->ds_names = array( |
86 | 'value' => 'Bytes' | 86 | 'value' => 'Bytes', |
87 | ); | 87 | ); |
88 | $obj->colors = array( | 88 | $obj->colors = array( |
89 | 'value' => '0000ff', | 89 | 'value' => '0000ff', |
90 | ); | 90 | ); |
91 | $obj->rrd_title = 'Arc L2 size'; | 91 | $obj->rrd_title = 'Arc L2 size'; |
92 | $obj->rrd_vertical = 'bytes'; | 92 | $obj->rrd_vertical = 'bytes'; |
93 | $obj->rrd_format = '%5.1lf%s'; | ||
94 | break; | 93 | break; |
95 | case 'arc_ratio': | 94 | case 'arc_ratio': |
96 | $obj->data_sources = array('value'); | 95 | $obj->data_sources = array('value'); |
97 | $obj->rrd_title = 'Arc ratio'; | 96 | $obj->rrd_title = 'Arc ratio'; |
98 | $obj->rrd_vertical = 'ratio'; | 97 | $obj->rrd_vertical = 'ratio'; |
99 | $obj->rrd_format = '%5.1lf%s'; | ||
100 | break; | 98 | break; |
101 | } | 99 | } |
102 | collectd_flush($obj->identifiers); | 100 | collectd_flush($obj->identifiers); |