]> git.itanic.dy.fi Git - rrdd/commitdiff
database.h.example: Add information to allow database creation
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Mon, 7 Mar 2011 16:00:28 +0000 (18:00 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Mon, 7 Mar 2011 16:42:13 +0000 (18:42 +0200)
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
database.h.example

index 913cc905a95d8c357e60a922bc1ce6b66c328e70..22f48e0bc9e1c0c42d9fd09a0ac35b1f2c646f92 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _TESTDATA_H
 #define _TESTDATA_H
 
-#include "draw_graphs.h"
+#include "rrdtool.h"
 #include "scheduler.h"
 #include "parser.h"
 
@@ -331,19 +331,220 @@ static struct rrd_image *systemp_images[] = {
        0
 };
 
+struct rrd_data_source cpumem_sources[] = {
+       {
+               .name = "User",
+               .type = "COUNTER",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 1200,
+       },
+       {
+               .name = "User",
+               .type = "COUNTER",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 1200,
+       },
+       {
+               .name = "Sys",
+               .type = "COUNTER",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 1200,
+       },
+       {
+               .name = "Idle",
+               .type = "COUNTER",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 1200,
+       },
+       {
+               .name = "Wait",
+               .type = "COUNTER",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 1200,
+       },
+       {
+               .name = "IRQ",
+               .type = "COUNTER",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 1200,
+       },
+       {
+               .name = "SoftIRQ",
+               .type = "COUNTER",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 1200,
+       },
+       {
+               .name = "Free",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {
+               .name = "Buffers",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {
+               .name = "Cached",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {
+               .name = "Active",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {
+               .name = "Inactive",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {
+               .name = "SwapFree",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {
+               .name = "Anon",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {
+               .name = "Slab",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {
+               .name = "Tables",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {
+               .name = "Swap",
+               .type = "GAUGE",
+               .heartbeat = 240,
+               .min = 0,
+               .max = 32768,
+       },
+       {},
+};
+
+struct rrd_archive cpumem_archives[] = {
+       {
+               .type = "AVERAGE",
+               .xff = 0.5,
+               .steps = 1,
+               .rows = 720,
+       },
+       {
+               .type = "AVERAGE",
+               .xff = 0.5,
+               .steps = 7,
+               .rows = 720,
+       },
+       {
+               .type = "AVERAGE",
+               .xff = 0.5,
+               .steps = 31,
+               .rows = 720,
+       },
+       {
+               .type = "AVERAGE",
+               .xff = 0.5,
+               .steps = 365,
+               .rows = 720,
+       },
+       {
+               .type = "MIN",
+               .xff = 0.5,
+               .steps = 1,
+               .rows = 720,
+       },
+       {
+               .type = "MIN",
+               .xff = 0.5,
+               .steps = 7,
+               .rows = 720,
+       },
+       {
+               .type = "MIN",
+               .xff = 0.5,
+               .steps = 31,
+               .rows = 720,
+       },
+       {
+               .type = "MIN",
+               .xff = 0.5,
+               .steps = 365,
+               .rows = 720,
+       },
+       {
+               .type = "MAX",
+               .xff = 0.5,
+               .steps = 1,
+               .rows = 720,
+       },
+       {
+               .type = "MAX",
+               .xff = 0.5,
+               .steps = 7,
+               .rows = 720,
+       },
+       {
+               .type = "MAX",
+               .xff = 0.5,
+               .steps = 31,
+               .rows = 720,
+       },
+       {
+               .type = "MAX",
+               .xff = 0.5,
+               .steps = 365,
+               .rows = 720,
+       },
+       {},
+};
+
 static struct rrd_database cpumem_rrd = {
        .filename       = SYSINFO_RRD_PATH,
        .interval       = 120,
        .parse          = cpu_mem_parser,
        .images         = (struct rrd_image **)&cpu_mem_images,
-       .name           = "cpumem"
+       .sources        = cpumem_sources,
+       .archives       = cpumem_archives,
+       .name           = "cpumem",
 };
 
 static struct rrd_database systemp_rrd = {
        .interval       = 300,
        .parse          = NULL,
        .images         = (struct rrd_image **)&systemp_images,
-       .name           = "systemp"
+       .name           = "systemp",
 };
 
 static struct rrd_database *all_rrds[] = {