summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e391ecd)
raw | patch | inline | side by side (parent: e391ecd)
author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 26 Aug 2009 11:46:36 +0000 (13:46 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 26 Aug 2009 11:46:36 +0000 (13:46 +0200) |
contrib/collection3/etc/collection.conf | patch | blob | history | |
contrib/collection3/lib/Collectd/Graph/Type.pm | patch | blob | history |
index 86cb3aa1944b5623707ccaa35c90a903590f8172..f4c7f5d6e6f261ea1db8d4104e3c3710a37831a8 100644 (file)
RRDVerticalLabel "°Celsius"
RRDFormat "%4.1lf°C"
</Type>
+<Type total_time_in_ms>
+ DataSources value
+ DSName "value Time"
+ RRDTitle "Time {instance}"
+ RRDVerticalLabel "Seconds"
+ RRDFormat "%6.2lf %ss"
+ Scale 0.001
+</Type>
<Type users>
DataSources users
DSName users Users
diff --git a/contrib/collection3/lib/Collectd/Graph/Type.pm b/contrib/collection3/lib/Collectd/Graph/Type.pm
index 1fb60afeecdd31a36b2eb4f1faefcaaad08ba149..01c2417c39db7bab0e5a74fbd6f91b4724e7c60a 100644 (file)
$f =~ s#:#\\:#g;
$ds_name =~ s#:#\\:#g;
- push (@ret,
- "DEF:min${i}=${f}:${ds_name}:MIN",
- "DEF:avg${i}=${f}:${ds_name}:AVERAGE",
- "DEF:max${i}=${f}:${ds_name}:MAX");
+ if (exists ($obj->{'scale'}))
+ {
+ my $scale = 0.0 + $obj->{'scale'};
+ push (@ret,
+ "DEF:min${i}_raw=${f}:${ds_name}:MIN",
+ "DEF:avg${i}_raw=${f}:${ds_name}:AVERAGE",
+ "DEF:max${i}_raw=${f}:${ds_name}:MAX",
+ "CDEF:max${i}=max${i}_raw,$scale,*",
+ "CDEF:avg${i}=avg${i}_raw,$scale,*",
+ "CDEF:min${i}=min${i}_raw,$scale,*");
+ }
+ else
+ {
+ push (@ret,
+ "DEF:min${i}=${f}:${ds_name}:MIN",
+ "DEF:avg${i}=${f}:${ds_name}:AVERAGE",
+ "DEF:max${i}=${f}:${ds_name}:MAX");
+ }
}
if (@$ds == 1)