summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c457229)
raw | patch | inline | side by side (parent: c457229)
author | Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com> | |
Sun, 31 May 2015 19:19:16 +0000 (21:19 +0200) | ||
committer | Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com> | |
Sun, 31 May 2015 19:19:16 +0000 (21:19 +0200) |
src/processes.c | patch | blob | history | |
src/types.db | patch | blob | history |
diff --git a/src/processes.c b/src/processes.c
index 059f9eba812613e48411d619e561de76dded81f0..519d13607600cd0169481d59586d5f114ffbda9b 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
if ( report_ctx_switch )
{
- sstrncpy (vl.type, "ps_cswitch_vol", sizeof (vl.type));
+ sstrncpy (vl.type, "contextswitch", sizeof (vl.type));
+ sstrncpy (vl.type_instance, "voluntary", sizeof (vl.type_instance));
vl.values[0].derive = ps->cswitch_vol;
vl.values_len = 1;
plugin_dispatch_values (&vl);
- sstrncpy (vl.type, "ps_cswitch_invol", sizeof (vl.type));
+ sstrncpy (vl.type, "contextswitch", sizeof (vl.type));
+ sstrncpy (vl.type_instance, "involuntary", sizeof (vl.type_instance));
vl.values[0].derive = ps->cswitch_invol;
vl.values_len = 1;
plugin_dispatch_values (&vl);
char filename[64];
FILE *fh;
struct dirent *ent;
- unsigned long long cswitch_vol = 0;
- unsigned long long cswitch_invol = 0;
+ derive_t cswitch_vol = 0;
+ derive_t cswitch_invol = 0;
char buffer[1024];
char *fields[8];
int numfields;
while (fgets (buffer, sizeof(buffer), fh) != NULL)
{
- long long tmp;
+ derive_t tmp;
char *endptr;
if (strncmp (buffer, "voluntary_ctxt_switches", 23) != 0
errno = 0;
endptr = NULL;
- tmp = strtoll (fields[1], &endptr, /* base = */ 10);
+ tmp = (derive_t) strtoll (fields[1], &endptr, /* base = */ 10);
if ((errno == 0) && (endptr != fields[1]))
{
if (strncmp (buffer, "voluntary_ctxt_switches", 23) == 0)
diff --git a/src/types.db b/src/types.db
index b139393a4db1ba5218c38da1eaf591a769a95cf1..38fb546c867170f43eada049718786e46e6a1060 100644 (file)
--- a/src/types.db
+++ b/src/types.db
pressure value:GAUGE:0:U
protocol_counter value:DERIVE:0:U
ps_code value:GAUGE:0:9223372036854775807
-ps_cswitch_vol value:DERIVE:0:U
-ps_cswitch_invol value:DERIVE:0:U
ps_count processes:GAUGE:0:1000000, threads:GAUGE:0:1000000
ps_cputime user:DERIVE:0:U, syst:DERIVE:0:U
ps_data value:GAUGE:0:9223372036854775807