]> git.itanic.dy.fi Git - rrdd/commitdiff
itanic: database.h: Add frequency
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 12 Mar 2011 11:08:51 +0000 (13:08 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 12 Mar 2011 11:08:51 +0000 (13:08 +0200)
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
database.h

index faab1ce209eba4d532ce4a86835e20bcea54725f..c767c8bf32fd1e36f338b544c908979ae2d39f2c 100644 (file)
@@ -236,6 +236,21 @@ const char *powertext[] = {
        0
 };
 
+const char *freqtext[] = {
+       "DEF:freq=" POWER_RRD_PATH ":taajuus:AVERAGE",
+       "COMMENT:\\n",
+       blank,
+       "COMMENT:                   "
+       "MIN          MAX         AVG        Last\\n",
+       blank,
+       "LINE1:freq#0000ff:Taajuus      ",
+       "GPRINT:freq:MIN:" numfmt,
+       "GPRINT:freq:MAX:" numfmt,
+       "GPRINT:freq:AVERAGE:" numfmt,
+       "GPRINT:freq:LAST:" numfmt "\\n",
+       "COMMENT: \\n",
+};
+
 const char *cpuoptions[] = {
        "--alt-autoscale-max",
        "--lower-limit", "0",
@@ -259,6 +274,13 @@ const char *systempoptions[] = {
        0
 };
 
+const char *freqoptions[] = {
+       "--alt-autoscale",
+       "--vertical-label", "Taajuus Hz",
+       "--units-exponent", "-2",
+       0
+};
+
 const char *poweroptions[] = {
        "--alt-autoscale-max",
        "--lower-limit", "0",
@@ -442,6 +464,50 @@ static struct rrd_image poweryearly = {
        .text = (char **)&powertext
 };
 
+static struct rrd_image freqdaily = {
+       .image_filename = POWER_IMAGES_PATH "freq_daily.png",
+       .width = 480,
+       .height = 480,
+       .timestart = "end-1d",
+       .timeend = "now",
+       .imageformat = "PNG",
+       .options = (char **)&freqoptions,
+       .text = (char **)&freqtext
+};
+
+static struct rrd_image freqweekly = {
+       .image_filename = POWER_IMAGES_PATH "freq_weekly.png",
+       .width = 480,
+       .height = 480,
+       .timestart = "end-1w",
+       .timeend = "now",
+       .imageformat = "PNG",
+       .options = (char **)&freqoptions,
+       .text = (char **)&freqtext
+};
+
+static struct rrd_image freqmonthly = {
+       .image_filename = POWER_IMAGES_PATH "freq_monthly.png",
+       .width = 480,
+       .height = 480,
+       .timestart = "end-1m",
+       .timeend = "now",
+       .imageformat = "PNG",
+       .options = (char **)&freqoptions,
+       .text = (char **)&freqtext
+};
+
+static struct rrd_image freqyearly = {
+       .image_filename = POWER_IMAGES_PATH "freq_yearly.png",
+       .width = 480,
+       .height = 480,
+       .timestart = "end-1y",
+       .timeend = "now",
+       .imageformat = "PNG",
+       .options = (char **)&freqoptions,
+       .text = (char **)&freqtext
+};
+
 static struct rrd_image *cpu_mem_images[] = {
        &cpudaily,
        &cpuweekly,
@@ -467,6 +533,10 @@ static struct rrd_image *power_images[] = {
        &powerweekly,
        &powermonthly,
        &poweryearly,
+       &freqdaily,
+       &freqweekly,
+       &freqmonthly,
+       &freqyearly,
        0
 };