lowered memory consumption by 60% and increased speed by 30%; there is still some room for improvement especially in first_entry_t; need to check if chart is shifted
Costa Tsaousis (ktsaou) committed
Apr 30, 2014 at 01:38 UTC
e445c9f35a716e23f546dd5163453b4f59d5ccf9
3 files changed
+441
-545
charts.d/skeleton-chart.sh
+2
-2
@@ -19,7 +19,7 @@ echo "MYPID $$"
19
20
# -----------------------------------------------------------------------------
21
# create a new chart
22
-# > CHART family.chartname group[=type] homegroup[=family] charttype priority[=1000]
22
+# > CHART type.chartname family[=chartname] homegroup[=type] charttype priority[=1000]
23
# charttype = line or area or stacked
24
# homegroup = any name or the word 'none' which hides the chart from the home web page
25
#
@@ -33,7 +33,7 @@ echo "MYPID $$"
33
# > UPDATE EVERY $update_every
34
#
35
# create all the dimensions you need
36
-# > DIMENSION CREATE dimensionname1 algorithm signed|unsigned byte|char|int|long|long long multiplier divisor"
36
+# > DIMENSION CREATE dimensionname1 algorithm signed|unsigned byte|char|int|long|long long multiplier divisor [hidden]"
37
#
38
# algorithms:
39
# absolute
netdata.c
+434
-538
@@ -32,6 +32,8 @@
32
#include <pthread.h>
33
#include <zlib.h>
34
#include <malloc.h>
35
+#include <inttypes.h>
36
+
37
38
#define RRD_DIMENSION_ABSOLUTE 0
39
#define RRD_DIMENSION_INCREMENTAL 1
@@ -656,25 +658,24 @@ struct rrd_dimension {
658
unsigned long hash; // a simple hash on the id, to speed up searching
659
// we first compare hashes, and only if the hashes are equal we do string comparisons
660
659
- int issigned; // if true, the values are signed
660
-
661
- size_t bytes; // how many bytes each value has, e.g. sizeof(long)
662
- size_t entries; // how many entries this dimension has
661
+ long entries; // how many entries this dimension has
662
// this should be the same to the entries of the data set
663
664
int hidden; // if set to non zero, this dimension will not be sent to the client
665
667
- // before presenting the value to the user:
668
- int type; // - first calculate a long double value based on this type of calculation
669
- long multiplier; // - then, multiple by this
670
- long divisor; // - then, divide by this
666
+ int algorithm;
667
+ long multiplier;
668
+ long divisor;
669
672
- void *values; // the array of values, each value is 'bytes' in length
670
+ int32_t *values; // the array of values
671
674
-// char **annotations;
675
-// char *(*annotator)(long double previous, long double current);
672
+ struct timeval last_updated; // when was this dimension last updated
673
677
- time_t last_updated; // when was this dimension last updated
674
+ long long calculated_value;
675
+ long long last_calculated_value;
676
+
677
+ long long collected_value;
678
+ long long last_collected_value;
679
680
struct rrd_dimension *next; // linking of dimensions within the same data set
681
};
@@ -683,6 +684,8 @@ typedef struct rrd_dimension RRD_DIMENSION;
684
struct rrd_stats {
685
pthread_mutex_t mutex;
686
687
+ unsigned long counter; // the number of times we added values to this rrd
688
+
689
char id[RRD_STATS_NAME_MAX + 1]; // id of the data set
690
char name[RRD_STATS_NAME_MAX + 1]; // name of the data set
691
@@ -690,7 +693,7 @@ struct rrd_stats {
693
// we first compare hashes, and only if the hashes are equal we do string comparisons
694
695
char type[RRD_STATS_NAME_MAX + 1]; // the type of graph RRD_TYPE_* (a category, for determining graphing options)
693
- char group[RRD_STATS_NAME_MAX + 1]; // the group of this data set (for grouping them together)
696
+ char family[RRD_STATS_NAME_MAX + 1]; // the family of this data set (for grouping them together)
697
698
char title[RRD_STATS_NAME_MAX + 1]; // title shown to user
699
char units[RRD_STATS_NAME_MAX + 1]; // units of measurement
@@ -698,21 +701,22 @@ struct rrd_stats {
701
char usertitle[RRD_STATS_NAME_MAX + 1];
702
long userpriority;
703
701
- size_t entries; // total number of entries in the data set
702
- size_t current_entry; // the entry that is currently being updated
704
+ long entries; // total number of entries in the data set
705
+ long current_entry; // the entry that is currently being updated
706
// it goes around in a round-robin fashion
704
- // size_t last_entry;
707
708
int update_every; // every how many seconds is this updated?
709
+ struct timeval last_updated; // when this data set was last updated
710
+ unsigned long long usec_since_last_update;
711
708
- time_t last_updated; // when this data set was last updated
709
-
710
- int isdetail; // if set, the data set should be considered as a detail of another
711
- // (the master data set should be the one that has the same group and is not detail)
712
+ long long absolute_total;
713
+ long long last_absolute_total;
714
715
int enabled;
716
+ int isdetail; // if set, the data set should be considered as a detail of another
717
+ // (the master data set should be the one that has the same family and is not detail)
718
715
- struct timeval *times; // the time in microseconds each data entry was collected
719
+ uint32_t *timediff; // the time in microseconds between each data entry
720
RRD_DIMENSION *dimensions; // the actual data for every dimension
721
722
struct rrd_stats *next; // linking of rrd stats
@@ -722,7 +726,7 @@ typedef struct rrd_stats RRD_STATS;
726
RRD_STATS *root = NULL;
727
pthread_mutex_t root_mutex = PTHREAD_MUTEX_INITIALIZER;
728
725
-RRD_STATS *rrd_stats_create(const char *type, const char *id, const char *name, const char *group, const char *title, const char *units, long priority)
729
+RRD_STATS *rrd_stats_create(const char *type, const char *id, const char *name, const char *family, const char *title, const char *units, long priority)
730
{
731
RRD_STATS *st = NULL;
732
char *p;
@@ -762,8 +766,8 @@ RRD_STATS *rrd_stats_create(const char *type, const char *id, const char *name,
766
while((p = strchr(st->name, '?'))) *p = '_';
767
while((p = strchr(st->name, '&'))) *p = '_';
768
765
- if(group) strncpy(st->group, group, RRD_STATS_NAME_MAX);
766
- else strcpy(st->group, st->id);
769
+ if(family) strncpy(st->family, family, RRD_STATS_NAME_MAX);
770
+ else strcpy(st->family, st->id);
771
772
strncpy(st->title, title, RRD_STATS_NAME_MAX);
773
strncpy(st->units, units, RRD_STATS_NAME_MAX);
@@ -782,17 +786,13 @@ RRD_STATS *rrd_stats_create(const char *type, const char *id, const char *name,
786
st->enabled = config_get_boolean(st->id, "enabled", 1);
787
if(!st->enabled) st->entries = 5;
788
785
- st->times = calloc(st->entries, sizeof(struct timeval));
786
- if(!st->times) {
789
+ st->timediff = calloc(st->entries, sizeof(uint32_t));
790
+ if(!st->timediff) {
791
free(st);
792
fatal("Cannot allocate %lu entries of %lu bytes each for RRD_STATS.", st->entries, sizeof(struct timeval));
793
return NULL;
794
}
795
792
- st->current_entry = 0;
793
- // st->last_entry = 0;
794
- st->dimensions = NULL;
795
- st->last_updated = time(NULL);
796
st->update_every = update_every;
797
798
pthread_mutex_init(&st->mutex, NULL);
@@ -808,7 +808,7 @@ RRD_STATS *rrd_stats_create(const char *type, const char *id, const char *name,
808
return(st);
809
}
810
811
-RRD_DIMENSION *rrd_stats_dimension_add(RRD_STATS *st, const char *id, const char *name, size_t bytes, int issigned, long multiplier, long divisor, int type, void *obsolete)
811
+RRD_DIMENSION *rrd_stats_dimension_add(RRD_STATS *st, const char *id, const char *name, long multiplier, long divisor, int algorithm)
812
{
813
RRD_DIMENSION *rd = NULL;
814
@@ -820,28 +820,18 @@ RRD_DIMENSION *rrd_stats_dimension_add(RRD_STATS *st, const char *id, const char
820
return NULL;
821
}
822
823
- rd->bytes = bytes;
823
rd->entries = st->entries;
824
rd->multiplier = multiplier;
825
rd->divisor = divisor;
827
- rd->type = type;
828
- rd->issigned = issigned;
826
+ rd->algorithm = algorithm;
827
830
- rd->values = calloc(rd->entries, rd->bytes);
828
+ rd->values = calloc(rd->entries, sizeof(int32_t));
829
if(!rd->values) {
830
free(rd);
833
- fatal("Cannot allocate %lu entries of %lu bytes each for RRD_DIMENSION values.", rd->entries, rd->bytes);
831
+ fatal("Cannot allocate %lu entries for RRD_DIMENSION values.", rd->entries);
832
return NULL;
833
}
834
837
-/* rd->annotations = calloc(rd->entries, sizeof(char *));
838
- if(!rd->annotations) {
839
- free(rd->values);
840
- free(rd);
841
- fatal("Cannot allocate %lu entries of %lu bytes each for RRD_DIMENSION annotations.", rd->entries, sizeof(char *));
842
- return NULL;
843
- }
844
-*/
835
// no need to terminate the strings after strncpy(), because of calloc()
836
837
strncpy(rd->id, id, RRD_STATS_NAME_MAX);
@@ -944,70 +934,15 @@ int rrd_stats_dimension_hide(RRD_STATS *st, const char *id)
934
return 0;
935
}
936
947
-void rrd_stats_dimension_set_by_pointer(RRD_STATS *st, RRD_DIMENSION *rd, void *data, void *obsolete)
937
+void rrd_stats_dimension_set_by_pointer(RRD_STATS *st, RRD_DIMENSION *rd, long long value)
938
{
949
- rd->last_updated = st->last_updated;
950
-
951
- if(rd->issigned) {
952
- if(rd->bytes == sizeof(long long)) {
953
- long long *dimension = rd->values, *value = data;
954
-
955
- dimension[st->current_entry] = (*value);
956
- }
957
- else if(rd->bytes == sizeof(long)) {
958
- long *dimension = rd->values, *value = data;
959
-
960
- dimension[st->current_entry] = (*value);
961
- }
962
- else if(rd->bytes == sizeof(short int)) {
963
- short int *dimension = rd->values, *value = data;
964
-
965
- dimension[st->current_entry] = (*value);
966
- }
967
- else if(rd->bytes == sizeof(char)) {
968
- char *dimension = rd->values, *value = data;
969
-
970
- dimension[st->current_entry] = (*value);
971
- }
972
- else fatal("I don't know how to handle data of length %d (signed) bytes.", rd->bytes);
973
- }
974
- else {
975
- if(rd->bytes == sizeof(unsigned long long)) {
976
- unsigned long long *dimension = rd->values, *value = data;
977
-
978
- dimension[st->current_entry] = (*value);
979
- }
980
- else if(rd->bytes == sizeof(unsigned long)) {
981
- unsigned long *dimension = rd->values, *value = data;
982
-
983
- dimension[st->current_entry] = (*value);
984
- }
985
- else if(rd->bytes == sizeof(unsigned short int)) {
986
- unsigned short int *dimension = rd->values, *value = data;
987
-
988
- dimension[st->current_entry] = (*value);
989
- }
990
- else if(rd->bytes == sizeof(unsigned char)) {
991
- unsigned char *dimension = rd->values, *value = data;
939
+ rd->last_updated.tv_sec = st->last_updated.tv_sec;
940
+ rd->last_updated.tv_usec = st->last_updated.tv_usec;
941
993
- dimension[st->current_entry] = (*value);
994
- }
995
- else fatal("I don't know how to handle data of length %d (unsigned) bytes.", rd->bytes);
996
- }
997
-
998
- // clear any previous annotations
999
-/* if(rd->annotations[st->current_entry]) {
1000
- free(rd->annotations[st->current_entry]);
1001
- rd->annotations[st->current_entry] = NULL;
1002
- }
1003
-
1004
- // set the new annotation
1005
- if(annotation)
1006
- rd->annotations[st->current_entry] = strdup(annotation);
1007
-*/
942
+ rd->collected_value = value;
943
}
944
1010
-int rrd_stats_dimension_set(RRD_STATS *st, char *id, void *data, void *obsolete)
945
+int rrd_stats_dimension_set(RRD_STATS *st, char *id, long long value)
946
{
947
RRD_DIMENSION *rd = rrd_stats_dimension_find(st, id);
948
if(!rd) {
@@ -1015,31 +950,31 @@ int rrd_stats_dimension_set(RRD_STATS *st, char *id, void *data, void *obsolete)
950
return 1;
951
}
952
1018
- rrd_stats_dimension_set_by_pointer(st, rd, data, obsolete);
953
+ rrd_stats_dimension_set_by_pointer(st, rd, value);
954
return 0;
955
}
956
957
unsigned long long rrd_stats_next(RRD_STATS *st)
958
{
1024
- struct timeval *now, *old;
1025
-
959
pthread_mutex_lock(&st->mutex);
960
1028
- old = &st->times[st->current_entry];
1029
-
1030
- // st->current_entry should never be outside the array
1031
- // or, the parallel threads may end up crashing
1032
- // st->last_entry = st->current_entry;
1033
- st->current_entry = ((st->current_entry + 1) >= st->entries) ? 0 : st->current_entry + 1;
961
+ RRD_DIMENSION *rd;
962
+ for( rd = st->dimensions; rd ; rd = rd->next ) {
963
+ rd->last_calculated_value = rd->calculated_value;
964
+ rd->last_collected_value = rd->collected_value;
965
1035
- now = &st->times[st->current_entry];
1036
- gettimeofday(now, NULL);
966
+ rd->calculated_value = 0;
967
+ rd->collected_value = 0;
968
+ }
969
1038
- st->last_updated = now->tv_sec;
970
+ st->last_absolute_total = st->absolute_total;
971
+ st->absolute_total = 0;
972
+ st->current_entry = ((st->current_entry + 1) >= st->entries) ? 0 : st->current_entry + 1;
973
+ st->counter++;
974
975
// leave mutex locked
976
1042
- return usecdiff(now, old);
977
+ return st->usec_since_last_update;
978
}
979
980
void rrd_stats_done(RRD_STATS *st)
@@ -1048,7 +983,7 @@ void rrd_stats_done(RRD_STATS *st)
983
984
// find if there are any obsolete dimensions (not updated recently)
985
for( rd = st->dimensions, last = NULL ; rd ; ) {
1051
- if((rd->last_updated + (10 * st->update_every)) < st->last_updated) { // remove it only it is not updated in 10 seconds
986
+ if((rd->last_updated.tv_sec + (10 * st->update_every)) < st->last_updated.tv_sec) { // remove it only it is not updated in 10 seconds
987
debug(D_RRD_STATS, "Removing obsolete dimension '%s' (%s) of '%s' (%s).", rd->name, rd->id, st->name, st->id);
988
989
if(!last) {
@@ -1066,20 +1001,62 @@ void rrd_stats_done(RRD_STATS *st)
1001
continue;
1002
}
1003
}
1069
- else if((rd->last_updated + st->update_every) < st->last_updated) {
1070
- debug(D_RRD_STATS, "Clearing obsolete dimension '%s' (%s) of '%s' (%s).", rd->name, rd->id, st->name, st->id);
1004
1072
- unsigned char zero[rd->bytes];
1073
- int i;
1074
- for(i = 0; i < rd->bytes ; i++) zero[i] = 0;
1005
+ last = rd;
1006
+ rd = rd->next;
1007
+ }
1008
+
1009
+ // calculate totals and count the dimensions
1010
+ st->absolute_total = 0;
1011
+ int dimensions;
1012
+ for( rd = st->dimensions, dimensions = 0 ; rd ; rd = rd->next, dimensions++ )
1013
+ st->absolute_total += rd->collected_value;
1014
1076
- rrd_stats_dimension_set_by_pointer(st, rd, &zero, NULL);
1015
+ struct timeval now;
1016
+ gettimeofday(&now, NULL);
1017
+
1018
+ // if this is the second+ value we collect
1019
+ if(st->counter) {
1020
+
1021
+ st->usec_since_last_update = usecdiff(&now, &st->last_updated);
1022
+
1023
+ // process all dimensions to calculate its values
1024
+ for( rd = st->dimensions ; rd ; rd = rd->next ) {
1025
+ rd->calculated_value = rd->collected_value;
1026
+
1027
+ switch(rd->algorithm) {
1028
+ case RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL:
1029
+ rd->calculated_value = (100 * (rd->collected_value - rd->last_collected_value)) / (st->absolute_total - st->last_absolute_total);
1030
+ break;
1031
+
1032
+ case RRD_DIMENSION_PCENT_OVER_ROW_TOTAL:
1033
+ rd->calculated_value = (100 * rd->collected_value) / st->absolute_total;
1034
+ break;
1035
+
1036
+ case RRD_DIMENSION_INCREMENTAL:
1037
+ if(rd->last_collected_value > rd->collected_value) rd->calculated_value = 0;
1038
+ else rd->calculated_value = rd->collected_value - rd->last_collected_value;
1039
+
1040
+ rd->calculated_value = (rd->calculated_value * 1000000) / st->usec_since_last_update;
1041
+ break;
1042
+
1043
+ default:
1044
+ break;
1045
+ }
1046
+
1047
+ rd->calculated_value = rd->calculated_value * rd->multiplier / rd->divisor;
1048
+
1049
+ // store the calculated value
1050
+ rd->values[st->current_entry] = rd->calculated_value * 10;
1051
}
1052
1079
- last = rd;
1080
- rd = rd->next;
1053
+ // store the time difference to the last entry
1054
+ st->timediff[st->current_entry] = st->usec_since_last_update;
1055
}
1056
1057
+ st->last_updated.tv_sec = now.tv_sec;
1058
+ st->last_updated.tv_usec = now.tv_usec;
1059
+
1060
pthread_mutex_unlock(&st->mutex);
1061
}
1062
@@ -1264,61 +1241,18 @@ struct web_client *web_client_free(struct web_client *w)
1241
#define GROUP_MAX 1
1242
1243
// find the oldest entry in the data, skipping all empty slots
1267
-size_t rrd_stats_first_entry(RRD_STATS *st)
1244
+time_t rrd_stats_first_entry_t(RRD_STATS *st)
1245
{
1269
- size_t first_entry = st->current_entry + 1;
1270
- if(first_entry >= st->entries) first_entry = 0;
1271
-
1272
- while(st->times[first_entry].tv_sec == 0 && first_entry != st->current_entry) {
1273
- first_entry++;
1274
- if(first_entry >= st->entries) first_entry = 0;
1275
- }
1276
-
1277
- return first_entry;
1278
-}
1246
+ unsigned long long usec = st->last_updated.tv_sec * 1000000 + st->last_updated.tv_usec;
1247
1280
-long double rrd_stats_dimension_get(RRD_DIMENSION *rd, size_t position)
1281
-{
1282
- if(rd->issigned) {
1283
- if(rd->bytes == sizeof(long long)) {
1284
- long long *dimension = rd->values;
1285
- return(dimension[position]);
1286
- }
1287
- else if(rd->bytes == sizeof(long)) {
1288
- long *dimension = rd->values;
1289
- return(dimension[position]);
1290
- }
1291
- else if(rd->bytes == sizeof(short int)) {
1292
- short int *dimension = rd->values;
1293
- return(dimension[position]);
1294
- }
1295
- else if(rd->bytes == sizeof(char)) {
1296
- char *dimension = rd->values;
1297
- return(dimension[position]);
1298
- }
1299
- else fatal("Cannot produce JSON for size %d bytes (signed) dimension.", rd->bytes);
1300
- }
1301
- else {
1302
- if(rd->bytes == sizeof(unsigned long long)) {
1303
- unsigned long long *dimension = rd->values;
1304
- return(dimension[position]);
1305
- }
1306
- else if(rd->bytes == sizeof(unsigned long)) {
1307
- unsigned long *dimension = rd->values;
1308
- return(dimension[position]);
1309
- }
1310
- else if(rd->bytes == sizeof(unsigned short int)) {
1311
- unsigned short int *dimension = rd->values;
1312
- return(dimension[position]);
1313
- }
1314
- else if(rd->bytes == sizeof(unsigned char)) {
1315
- unsigned char *dimension = rd->values;
1316
- return(dimension[position]);
1317
- }
1318
- else fatal("Cannot produce JSON for size %d bytes (unsigned) dimension.", rd->bytes);
1248
+ long t;
1249
+ for( t = st->current_entry - 1 ; t != st->current_entry ; t--) {
1250
+ if(t < 0) t = st->entries - 1;
1251
+ if(!st->timediff[t]) break;
1252
+ usec -= st->timediff[t];
1253
}
1254
1321
- return(0);
1255
+ return(usec / 1000000);
1256
}
1257
1258
unsigned long rrd_stats_one_json(RRD_STATS *st, char *options, struct web_buffer *wb)
@@ -1327,57 +1261,60 @@ unsigned long rrd_stats_one_json(RRD_STATS *st, char *options, struct web_buffer
1261
1262
pthread_mutex_lock(&st->mutex);
1263
1330
- size_t first_entry = rrd_stats_first_entry(st);
1331
- time_t first_entry_t = st->times[first_entry].tv_sec;
1264
+ time_t first_entry_t = rrd_stats_first_entry_t(st);
1265
1266
web_buffer_printf(wb,
1267
"\t\t{\n"
1268
"\t\t\t\"id\": \"%s\",\n"
1269
"\t\t\t\"name\": \"%s\",\n"
1270
"\t\t\t\"type\": \"%s\",\n"
1338
- "\t\t\t\"group_tag\": \"%s\",\n"
1271
+ "\t\t\t\"family\": \"%s\",\n"
1272
"\t\t\t\"title\": \"%s\",\n"
1273
"\t\t\t\"priority\": %ld,\n"
1274
"\t\t\t\"enabled\": %d,\n"
1275
"\t\t\t\"units\": \"%s\",\n"
1276
"\t\t\t\"url\": \"/data/%s/%s\",\n"
1277
"\t\t\t\"entries\": %ld,\n"
1345
- "\t\t\t\"first_entry\": %ld,\n"
1278
"\t\t\t\"first_entry_t\": %ld,\n"
1279
"\t\t\t\"last_entry\": %ld,\n"
1280
"\t\t\t\"last_entry_t\": %lu,\n"
1281
"\t\t\t\"last_entry_secs_ago\": %lu,\n"
1282
"\t\t\t\"update_every\": %d,\n"
1283
"\t\t\t\"isdetail\": %d,\n"
1284
+ "\t\t\t\"usec_since_last_update\": %llu,\n"
1285
+ "\t\t\t\"absolute_total\": %lld,\n"
1286
+ "\t\t\t\"last_absolute_total\": %lld,\n"
1287
"\t\t\t\"dimensions\": [\n"
1288
, st->id
1289
, st->name
1290
, st->type
1356
- , st->group
1291
+ , st->family
1292
, st->usertitle
1293
, st->userpriority
1294
, st->enabled
1295
, st->units
1296
, st->name, options?options:""
1297
, st->entries
1363
- , first_entry
1298
, first_entry_t
1299
, st->current_entry
1366
- , st->last_updated
1367
- , time(NULL) - st->last_updated
1300
+ , st->last_updated.tv_sec
1301
+ , time(NULL) - st->last_updated.tv_sec
1302
, st->update_every
1303
, st->isdetail
1304
+ , st->usec_since_last_update
1305
+ , st->absolute_total
1306
+ , st->last_absolute_total
1307
);
1308
1372
- unsigned long memory = sizeof(RRD_STATS) + (sizeof(struct timeval) * st->entries);
1309
+ unsigned long memory = sizeof(RRD_STATS) + (sizeof(uint32_t) * st->entries);
1310
1311
RRD_DIMENSION *rd;
1312
for(rd = st->dimensions; rd ; rd = rd->next) {
1376
- unsigned long rdmem = sizeof(RRD_DIMENSION) + (rd->bytes * rd->entries);
1313
+ unsigned long rdmem = sizeof(RRD_DIMENSION) + (sizeof(int32_t) * rd->entries);
1314
memory += rdmem;
1315
1316
char *algorithm = "";
1380
- switch(rd->type) {
1317
+ switch(rd->algorithm) {
1318
case RRD_DIMENSION_INCREMENTAL:
1319
algorithm = "incremental";
1320
break;
@@ -1403,29 +1340,31 @@ unsigned long rrd_stats_one_json(RRD_STATS *st, char *options, struct web_buffer
1340
"\t\t\t\t{\n"
1341
"\t\t\t\t\t\"id\": \"%s\",\n"
1342
"\t\t\t\t\t\"name\": \"%s\",\n"
1406
- "\t\t\t\t\t\"bytes\": %ld,\n"
1343
"\t\t\t\t\t\"entries\": %ld,\n"
1408
- "\t\t\t\t\t\"isSigned\": %d,\n"
1344
"\t\t\t\t\t\"isHidden\": %d,\n"
1345
"\t\t\t\t\t\"algorithm\": \"%s\",\n"
1346
"\t\t\t\t\t\"multiplier\": %ld,\n"
1347
"\t\t\t\t\t\"divisor\": %ld,\n"
1348
"\t\t\t\t\t\"last_entry_t\": %lu,\n"
1414
- "\t\t\t\t\t\"memory\": %lu,\n"
1415
- "\t\t\t\t\t\"last_collected_value\": %0.1Lf\n"
1349
+ "\t\t\t\t\t\"collected_value\": %lld,\n"
1350
+ "\t\t\t\t\t\"calculated_value\": %lld,\n"
1351
+ "\t\t\t\t\t\"last_collected_value\": %lld,\n"
1352
+ "\t\t\t\t\t\"last_calculated_value\": %lld,\n"
1353
+ "\t\t\t\t\t\"memory\": %lu\n"
1354
"\t\t\t\t}%s\n"
1355
, rd->id
1356
, rd->name
1419
- , rd->bytes
1357
, rd->entries
1421
- , rd->issigned
1358
, rd->hidden
1359
, algorithm
1360
, rd->multiplier
1361
, rd->divisor
1426
- , rd->last_updated
1362
+ , rd->last_updated.tv_sec
1363
+ , rd->collected_value
1364
+ , rd->calculated_value
1365
+ , rd->last_collected_value
1366
+ , rd->last_calculated_value
1367
, rdmem
1428
- , rrd_stats_dimension_get(rd, st->current_entry)
1368
, rd->next?",":""
1369
);
1370
}
@@ -1516,16 +1455,9 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, siz
1455
int c = 0; // counter for dimension loops
1456
int dimensions = 0; // the total number of dimensions present
1457
1519
- unsigned long long usec = 0;// usec between the entries
1520
-
1521
- int we_need_totals = 0; // if set, we should calculate totals for all dimensions
1522
-
1458
// find how many dimensions we have
1459
RRD_DIMENSION *rd;
1525
- for( rd = st->dimensions ; rd ; rd = rd->next) {
1526
- dimensions++;
1527
- if(rd->type == RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL || rd->type == RRD_DIMENSION_PCENT_OVER_ROW_TOTAL) we_need_totals++;
1528
- }
1460
+ for( rd = st->dimensions ; rd ; rd = rd->next) dimensions++;
1461
1462
if(!dimensions) {
1463
pthread_mutex_unlock(&st->mutex);
@@ -1536,11 +1468,11 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, siz
1468
int annotation_count = 0;
1469
1470
// temp for the printable values
1539
- long double print_values[dimensions];
1471
+ long long print_values[dimensions];
1472
int print_hidden[dimensions];
1473
1474
// temporary storage to keep track of group values and counts
1543
- long double group_values[dimensions];
1475
+ long long group_values[dimensions];
1476
int group_count = 0;
1477
for( rd = st->dimensions, c = 0 ; rd && c < dimensions ; rd = rd->next, c++)
1478
group_values[c] = 0;
@@ -1567,13 +1499,14 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, siz
1499
1500
// make sure current_entry is within limits
1501
if(current_entry < 0 || current_entry >= st->entries) current_entry = 0;
1570
- if(before == 0) before = st->times[current_entry].tv_sec;
1502
+ if(before == 0) before = st->last_updated.tv_sec;
1503
1504
// find the oldest entry of the round-robin
1573
- stop_entry = rrd_stats_first_entry(st);
1505
+ stop_entry = st->current_entry + 1;
1506
+ if(stop_entry >= st->entries) stop_entry = st->entries - 1;
1507
1508
// skip the oldest, to have incremental data
1576
- if(after == 0) after = st->times[stop_entry].tv_sec;
1509
+ if(after == 0) after = rrd_stats_first_entry_t(st);
1510
1511
// the minimum line length we expect
1512
int line_size = 4096 + (dimensions * 200);
@@ -1598,22 +1531,24 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, siz
1531
1532
// loop in dimension data
1533
int annotate_reset = 0;
1601
- long t = current_entry, lt = current_entry - 1, count; // t = the current entry, lt = the last entry of data
1602
- if(lt < 0) lt = st->entries - 1;
1603
- for (count = printed = 0; t != stop_entry ; t = lt--) {
1534
+ struct timeval now;
1535
+ now.tv_sec = st->last_updated.tv_sec;
1536
+ now.tv_usec = st->last_updated.tv_usec;
1537
+ unsigned long long time_usec = now.tv_sec * 1000000 + now.tv_usec;
1538
+ long t, count;
1539
+ for (count = printed = 0, t = current_entry; t != stop_entry ; time_usec -= st->timediff[t], t--) {
1540
int print_this = 0;
1541
1606
- if(lt < 0) lt = st->entries - 1;
1542
+ if(t < 0) t = st->entries - 1;
1543
+
1544
+ now.tv_sec = time_usec / 1000000;
1545
+ now.tv_usec = time_usec % 1000000;
1546
1547
// make sure we return data in the proper time range
1609
- if(st->times[t].tv_sec < after || st->times[t].tv_sec > before) continue;
1548
+ if(now.tv_sec < after || now.tv_sec > before) continue;
1549
count++;
1550
group_count++;
1551
1613
- // ok. we will use this entry!
1614
- // find how much usec since the previous entry
1615
- usec = usecdiff(&st->times[t], &st->times[lt]);
1616
-
1552
if(((count - pad) % group) == 0) {
1553
if(printed >= entries_to_show) {
1554
// debug(D_RRD_STATS, "Already printed all rows. Stopping.");
@@ -1633,62 +1568,21 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, siz
1568
web_buffer_increase(wb, line_size);
1569
1570
// generate the local date time
1636
- struct tm *tm = localtime(&st->times[t].tv_sec);
1571
+ struct tm *tm = localtime(&now.tv_sec);
1572
if(!tm) { error("localtime() failed."); continue; }
1638
- if(st->times[t].tv_sec > last_timestamp) last_timestamp = st->times[t].tv_sec;
1573
+ if(now.tv_sec > last_timestamp) last_timestamp = now.tv_sec;
1574
1575
web_buffer_printf(wb, "%s {%sc%s:[{%sv%s:%sDate(%d, %d, %d, %d, %d, %d, %d)%s}", printed?"]},\n":"",
1576
kq, kq, kq, kq, sq,
1642
- tm->tm_year + 1900, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, (int)(st->times[t].tv_usec / 1000),
1577
+ tm->tm_year + 1900, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, (int)(now.tv_usec / 1000),
1578
sq);
1579
1580
print_this = 1;
1581
}
1582
1648
- // if we need a PCENT_OVER_TOTAL, calculate the totals for the current and the last
1649
- long double total = 0, oldtotal = 0;
1650
- if(we_need_totals) {
1651
- for( rd = st->dimensions, c = 0 ; rd && c < dimensions ; rd = rd->next, c++) {
1652
- total += rrd_stats_dimension_get(rd, t);
1653
- oldtotal += rrd_stats_dimension_get(rd, lt);
1654
- }
1655
- }
1656
-
1583
for( rd = st->dimensions, c = 0 ; rd && c < dimensions ; rd = rd->next, c++) {
1658
- long double oldvalue, value; // temp variable for storing data values
1659
-
1660
- value = rrd_stats_dimension_get(rd, t);
1661
- oldvalue = rrd_stats_dimension_get(rd, lt);
1584
+ long value = rd->values[t];
1585
1663
- switch(rd->type) {
1664
- case RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL:
1665
- value = 100.0 * (value - oldvalue) / (total - oldtotal);
1666
- break;
1667
-
1668
- case RRD_DIMENSION_PCENT_OVER_ROW_TOTAL:
1669
- value = 100.0 * value / total;
1670
- break;
1671
-
1672
- case RRD_DIMENSION_INCREMENTAL:
1673
- if(oldvalue > value) {
1674
- annotate_reset = 1;
1675
- value = 0;
1676
- }
1677
- else value -= oldvalue;
1678
-
1679
- value = value * 1000000.0 / (long double)usec;
1680
- break;
1681
-
1682
- default:
1683
- break;
1684
- }
1685
-
1686
- value = value * (long double)rd->multiplier / (long double)rd->divisor;
1687
-
1688
-// if(rd->options & RRD_OPTION_ANNOTATE_NOT_ZERO) {
1689
-// annotation_add(my_annotations, rd->name, "%s = %0.1lf", value);
1690
-// }
1691
-
1586
switch(group_method) {
1587
case GROUP_MAX:
1588
if(abs(value) > abs(group_values[c])) group_values[c] = value;
@@ -1722,8 +1616,10 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, siz
1616
}
1617
1618
for(c = 0 ; c < dimensions ; c++) {
1725
- if(!print_hidden[c])
1726
- web_buffer_printf(wb, ",{%sv%s:%0.1Lf}", kq, kq, print_values[c]);
1619
+ if(!print_hidden[c]) {
1620
+ long double x = (long double)print_values[c] / 10.0;
1621
+ web_buffer_printf(wb, ",{%sv%s:%0.1Lf}", kq, kq, x);
1622
+ }
1623
}
1624
1625
printed++;
@@ -2117,7 +2013,7 @@ int web_client_data_request(struct web_client *w, char *url, int datasource_type
2013
if(datasource_type == DATASOURCE_GOOGLE_JSONP) {
2014
w->data->bytes = snprintf(w->data->buffer, w->data->size,
2015
"%s({version:'%s',reqId:'%s',status:'ok',sig:'%lu',table:",
2120
- google_responseHandler, google_version, google_reqId, st->last_updated);
2016
+ google_responseHandler, google_version, google_reqId, st->last_updated.tv_sec);
2017
}
2018
2019
debug(D_WEB_CLIENT_ACCESS, "%llu: Sending RRD data '%s' (id %s, %d lines, %d group, %d group_method, %lu after, %lu before).", w->id, st->name, st->id, lines, group_count, group_method, after, before);
@@ -3010,13 +2906,13 @@ int do_proc_net_dev() {
2906
if(!st) {
2907
st = rrd_stats_create(RRD_TYPE_NET, iface, NULL, iface, "Bandwidth", "kilobits/s", 1000);
2908
3013
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
3014
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
2909
+ rrd_stats_dimension_add(st, "received", NULL, 8, 1024, RRD_DIMENSION_INCREMENTAL);
2910
+ rrd_stats_dimension_add(st, "sent", NULL, -8, 1024, RRD_DIMENSION_INCREMENTAL);
2911
}
2912
else rrd_stats_next(st);
2913
3018
- rrd_stats_dimension_set(st, "received", &rbytes, NULL);
3019
- rrd_stats_dimension_set(st, "sent", &tbytes, NULL);
2914
+ rrd_stats_dimension_set(st, "received", rbytes);
2915
+ rrd_stats_dimension_set(st, "sent", tbytes);
2916
rrd_stats_done(st);
2917
}
2918
@@ -3028,13 +2924,13 @@ int do_proc_net_dev() {
2924
st = rrd_stats_create("net_packets", iface, NULL, iface, "Packets", "packets/s", 1001);
2925
st->isdetail = 1;
2926
3031
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3032
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
2927
+ rrd_stats_dimension_add(st, "received", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
2928
+ rrd_stats_dimension_add(st, "sent", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
2929
}
2930
else rrd_stats_next(st);
2931
3036
- rrd_stats_dimension_set(st, "received", &rpackets, NULL);
3037
- rrd_stats_dimension_set(st, "sent", &tpackets, NULL);
2932
+ rrd_stats_dimension_set(st, "received", rpackets);
2933
+ rrd_stats_dimension_set(st, "sent", tpackets);
2934
rrd_stats_done(st);
2935
}
2936
@@ -3046,13 +2942,13 @@ int do_proc_net_dev() {
2942
st = rrd_stats_create("net_errors", iface, NULL, iface, "Interface Errors", "errors/s", 1002);
2943
st->isdetail = 1;
2944
3049
- rrd_stats_dimension_add(st, "receive", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3050
- rrd_stats_dimension_add(st, "transmit", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
2945
+ rrd_stats_dimension_add(st, "receive", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
2946
+ rrd_stats_dimension_add(st, "transmit", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
2947
}
2948
else rrd_stats_next(st);
2949
3054
- rrd_stats_dimension_set(st, "receive", &rerrors, NULL);
3055
- rrd_stats_dimension_set(st, "transmit", &terrors, NULL);
2950
+ rrd_stats_dimension_set(st, "receive", rerrors);
2951
+ rrd_stats_dimension_set(st, "transmit", terrors);
2952
rrd_stats_done(st);
2953
}
2954
@@ -3064,13 +2960,13 @@ int do_proc_net_dev() {
2960
st = rrd_stats_create("net_fifo", iface, NULL, iface, "Interface Queue", "packets", 1100);
2961
st->isdetail = 1;
2962
3067
- rrd_stats_dimension_add(st, "receive", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_ABSOLUTE, NULL);
3068
- rrd_stats_dimension_add(st, "transmit", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_ABSOLUTE, NULL);
2963
+ rrd_stats_dimension_add(st, "receive", NULL, 1, 1, RRD_DIMENSION_ABSOLUTE);
2964
+ rrd_stats_dimension_add(st, "transmit", NULL, -1, 1, RRD_DIMENSION_ABSOLUTE);
2965
}
2966
else rrd_stats_next(st);
2967
3072
- rrd_stats_dimension_set(st, "receive", &rfifo, NULL);
3073
- rrd_stats_dimension_set(st, "transmit", &tfifo, NULL);
2968
+ rrd_stats_dimension_set(st, "receive", rfifo);
2969
+ rrd_stats_dimension_set(st, "transmit", tfifo);
2970
rrd_stats_done(st);
2971
}
2972
@@ -3082,13 +2978,13 @@ int do_proc_net_dev() {
2978
st = rrd_stats_create("net_compressed", iface, NULL, iface, "Compressed Packets", "packets/s", 1200);
2979
st->isdetail = 1;
2980
3085
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3086
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
2981
+ rrd_stats_dimension_add(st, "received", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
2982
+ rrd_stats_dimension_add(st, "sent", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
2983
}
2984
else rrd_stats_next(st);
2985
3090
- rrd_stats_dimension_set(st, "received", &rcompressed, NULL);
3091
- rrd_stats_dimension_set(st, "sent", &tcompressed, NULL);
2986
+ rrd_stats_dimension_set(st, "received", rcompressed);
2987
+ rrd_stats_dimension_set(st, "sent", tcompressed);
2988
rrd_stats_done(st);
2989
}
2990
}
@@ -3299,13 +3195,13 @@ int do_proc_diskstats() {
3195
3196
st = rrd_stats_create(RRD_TYPE_DISK, disk, NULL, disk, "Disk I/O", "kilobytes/s", 2000);
3197
3302
- rrd_stats_dimension_add(st, "reads", NULL, sizeof(unsigned long long), 0, sector_size, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
3303
- rrd_stats_dimension_add(st, "writes", NULL, sizeof(unsigned long long), 0, sector_size * -1, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
3198
+ rrd_stats_dimension_add(st, "reads", NULL, sector_size, 1024, RRD_DIMENSION_INCREMENTAL);
3199
+ rrd_stats_dimension_add(st, "writes", NULL, sector_size * -1, 1024, RRD_DIMENSION_INCREMENTAL);
3200
}
3201
else rrd_stats_next(st);
3202
3307
- rrd_stats_dimension_set(st, "reads", &readsectors, NULL);
3308
- rrd_stats_dimension_set(st, "writes", &writesectors, NULL);
3203
+ rrd_stats_dimension_set(st, "reads", readsectors);
3204
+ rrd_stats_dimension_set(st, "writes", writesectors);
3205
rrd_stats_done(st);
3206
}
3207
@@ -3317,13 +3213,13 @@ int do_proc_diskstats() {
3213
st = rrd_stats_create("disk_ops", disk, NULL, disk, "Disk Operations", "operations/s", 2001);
3214
st->isdetail = 1;
3215
3320
- rrd_stats_dimension_add(st, "reads", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3321
- rrd_stats_dimension_add(st, "writes", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3216
+ rrd_stats_dimension_add(st, "reads", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3217
+ rrd_stats_dimension_add(st, "writes", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3218
}
3219
else rrd_stats_next(st);
3220
3325
- rrd_stats_dimension_set(st, "reads", &reads, NULL);
3326
- rrd_stats_dimension_set(st, "writes", &writes, NULL);
3221
+ rrd_stats_dimension_set(st, "reads", reads);
3222
+ rrd_stats_dimension_set(st, "writes", writes);
3223
rrd_stats_done(st);
3224
}
3225
@@ -3335,13 +3231,13 @@ int do_proc_diskstats() {
3231
st = rrd_stats_create("disk_merged_ops", disk, NULL, disk, "Merged Disk Operations", "operations/s", 2010);
3232
st->isdetail = 1;
3233
3338
- rrd_stats_dimension_add(st, "reads", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3339
- rrd_stats_dimension_add(st, "writes", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3234
+ rrd_stats_dimension_add(st, "reads", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3235
+ rrd_stats_dimension_add(st, "writes", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3236
}
3237
else rrd_stats_next(st);
3238
3343
- rrd_stats_dimension_set(st, "reads", &reads_merged, NULL);
3344
- rrd_stats_dimension_set(st, "writes", &writes_merged, NULL);
3239
+ rrd_stats_dimension_set(st, "reads", reads_merged);
3240
+ rrd_stats_dimension_set(st, "writes", writes_merged);
3241
rrd_stats_done(st);
3242
}
3243
@@ -3353,17 +3249,17 @@ int do_proc_diskstats() {
3249
st = rrd_stats_create("disk_iotime", disk, NULL, disk, "Disk I/O Time", "milliseconds/s", 2005);
3250
st->isdetail = 1;
3251
3356
- rrd_stats_dimension_add(st, "reads", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3357
- rrd_stats_dimension_add(st, "writes", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3358
- rrd_stats_dimension_add(st, "latency", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3359
- rrd_stats_dimension_add(st, "weighted", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3252
+ rrd_stats_dimension_add(st, "reads", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3253
+ rrd_stats_dimension_add(st, "writes", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3254
+ rrd_stats_dimension_add(st, "latency", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3255
+ rrd_stats_dimension_add(st, "weighted", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3256
}
3257
else rrd_stats_next(st);
3258
3363
- rrd_stats_dimension_set(st, "reads", &readms, NULL);
3364
- rrd_stats_dimension_set(st, "writes", &writems, NULL);
3365
- rrd_stats_dimension_set(st, "latency", &iosms, NULL);
3366
- rrd_stats_dimension_set(st, "weighted", &wiosms, NULL);
3259
+ rrd_stats_dimension_set(st, "reads", readms);
3260
+ rrd_stats_dimension_set(st, "writes", writems);
3261
+ rrd_stats_dimension_set(st, "latency", iosms);
3262
+ rrd_stats_dimension_set(st, "weighted", wiosms);
3263
rrd_stats_done(st);
3264
}
3265
@@ -3375,11 +3271,11 @@ int do_proc_diskstats() {
3271
st = rrd_stats_create("disk_cur_ops", disk, NULL, disk, "Current Disk I/O operations", "operations", 2004);
3272
st->isdetail = 1;
3273
3378
- rrd_stats_dimension_add(st, "operations", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_ABSOLUTE, NULL);
3274
+ rrd_stats_dimension_add(st, "operations", NULL, 1, 1, RRD_DIMENSION_ABSOLUTE);
3275
}
3276
else rrd_stats_next(st);
3277
3382
- rrd_stats_dimension_set(st, "operations", ¤tios, NULL);
3278
+ rrd_stats_dimension_set(st, "operations", currentios);
3279
rrd_stats_done(st);
3280
}
3281
}
@@ -3449,15 +3345,15 @@ int do_proc_net_snmp() {
3345
if(!st) {
3346
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "packets", NULL, RRD_TYPE_NET_SNMP, "IPv4 Packets", "packets/s", 3000);
3347
3452
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3453
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3454
- rrd_stats_dimension_add(st, "forwarded", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3348
+ rrd_stats_dimension_add(st, "received", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3349
+ rrd_stats_dimension_add(st, "sent", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3350
+ rrd_stats_dimension_add(st, "forwarded", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3351
}
3352
else rrd_stats_next(st);
3353
3458
- rrd_stats_dimension_set(st, "sent", &OutRequests, NULL);
3459
- rrd_stats_dimension_set(st, "received", &InReceives, NULL);
3460
- rrd_stats_dimension_set(st, "forwarded", &ForwDatagrams, NULL);
3354
+ rrd_stats_dimension_set(st, "sent", OutRequests);
3355
+ rrd_stats_dimension_set(st, "received", InReceives);
3356
+ rrd_stats_dimension_set(st, "forwarded", ForwDatagrams);
3357
rrd_stats_done(st);
3358
}
3359
@@ -3469,15 +3365,15 @@ int do_proc_net_snmp() {
3365
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "fragsout", NULL, RRD_TYPE_NET_SNMP, "IPv4 Fragments Sent", "packets/s", 3010);
3366
st->isdetail = 1;
3367
3472
- rrd_stats_dimension_add(st, "ok", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3473
- rrd_stats_dimension_add(st, "failed", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3474
- rrd_stats_dimension_add(st, "all", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3368
+ rrd_stats_dimension_add(st, "ok", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3369
+ rrd_stats_dimension_add(st, "failed", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3370
+ rrd_stats_dimension_add(st, "all", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3371
}
3372
else rrd_stats_next(st);
3373
3478
- rrd_stats_dimension_set(st, "ok", &FragOKs, NULL);
3479
- rrd_stats_dimension_set(st, "failed", &FragFails, NULL);
3480
- rrd_stats_dimension_set(st, "all", &FragCreates, NULL);
3374
+ rrd_stats_dimension_set(st, "ok", FragOKs);
3375
+ rrd_stats_dimension_set(st, "failed", FragFails);
3376
+ rrd_stats_dimension_set(st, "all", FragCreates);
3377
rrd_stats_done(st);
3378
}
3379
@@ -3489,15 +3385,15 @@ int do_proc_net_snmp() {
3385
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "fragsin", NULL, RRD_TYPE_NET_SNMP, "IPv4 Fragments Reassembly", "packets/s", 3011);
3386
st->isdetail = 1;
3387
3492
- rrd_stats_dimension_add(st, "ok", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3493
- rrd_stats_dimension_add(st, "failed", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3494
- rrd_stats_dimension_add(st, "all", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3388
+ rrd_stats_dimension_add(st, "ok", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3389
+ rrd_stats_dimension_add(st, "failed", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3390
+ rrd_stats_dimension_add(st, "all", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3391
}
3392
else rrd_stats_next(st);
3393
3498
- rrd_stats_dimension_set(st, "ok", &ReasmOKs, NULL);
3499
- rrd_stats_dimension_set(st, "failed", &ReasmFails, NULL);
3500
- rrd_stats_dimension_set(st, "all", &ReasmReqds, NULL);
3394
+ rrd_stats_dimension_set(st, "ok", ReasmOKs);
3395
+ rrd_stats_dimension_set(st, "failed", ReasmFails);
3396
+ rrd_stats_dimension_set(st, "all", ReasmReqds);
3397
rrd_stats_done(st);
3398
}
3399
@@ -3509,23 +3405,23 @@ int do_proc_net_snmp() {
3405
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "errors", NULL, RRD_TYPE_NET_SNMP, "IPv4 Errors", "packets/s", 3002);
3406
st->isdetail = 1;
3407
3512
- rrd_stats_dimension_add(st, "InDiscards", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3513
- rrd_stats_dimension_add(st, "OutDiscards", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3408
+ rrd_stats_dimension_add(st, "InDiscards", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3409
+ rrd_stats_dimension_add(st, "OutDiscards", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3410
3515
- rrd_stats_dimension_add(st, "InHdrErrors", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3516
- rrd_stats_dimension_add(st, "InAddrErrors", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3517
- rrd_stats_dimension_add(st, "InUnknownProtos", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3411
+ rrd_stats_dimension_add(st, "InHdrErrors", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3412
+ rrd_stats_dimension_add(st, "InAddrErrors", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3413
+ rrd_stats_dimension_add(st, "InUnknownProtos", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3414
3519
- rrd_stats_dimension_add(st, "OutNoRoutes", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3415
+ rrd_stats_dimension_add(st, "OutNoRoutes", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3416
}
3417
else rrd_stats_next(st);
3418
3523
- rrd_stats_dimension_set(st, "InDiscards", &InDiscards, NULL);
3524
- rrd_stats_dimension_set(st, "OutDiscards", &OutDiscards, NULL);
3525
- rrd_stats_dimension_set(st, "InHdrErrors", &InHdrErrors, NULL);
3526
- rrd_stats_dimension_set(st, "InAddrErrors", &InAddrErrors, NULL);
3527
- rrd_stats_dimension_set(st, "InUnknownProtos", &InUnknownProtos, NULL);
3528
- rrd_stats_dimension_set(st, "OutNoRoutes", &OutNoRoutes, NULL);
3419
+ rrd_stats_dimension_set(st, "InDiscards", InDiscards);
3420
+ rrd_stats_dimension_set(st, "OutDiscards", OutDiscards);
3421
+ rrd_stats_dimension_set(st, "InHdrErrors", InHdrErrors);
3422
+ rrd_stats_dimension_set(st, "InAddrErrors", InAddrErrors);
3423
+ rrd_stats_dimension_set(st, "InUnknownProtos", InUnknownProtos);
3424
+ rrd_stats_dimension_set(st, "OutNoRoutes", OutNoRoutes);
3425
rrd_stats_done(st);
3426
}
3427
}
@@ -3556,11 +3452,11 @@ int do_proc_net_snmp() {
3452
if(!st) {
3453
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "tcpsock", NULL, "tcp", "IPv4 TCP Connections", "active connections", 2500);
3454
3559
- rrd_stats_dimension_add(st, "connections", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_ABSOLUTE, NULL);
3455
+ rrd_stats_dimension_add(st, "connections", NULL, 1, 1, RRD_DIMENSION_ABSOLUTE);
3456
}
3457
else rrd_stats_next(st);
3458
3563
- rrd_stats_dimension_set(st, "connections", &CurrEstab, NULL);
3459
+ rrd_stats_dimension_set(st, "connections", CurrEstab);
3460
rrd_stats_done(st);
3461
}
3462
@@ -3571,13 +3467,13 @@ int do_proc_net_snmp() {
3467
if(!st) {
3468
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "tcppackets", NULL, "tcp", "IPv4 TCP Packets", "packets/s", 2600);
3469
3574
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3575
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3470
+ rrd_stats_dimension_add(st, "received", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3471
+ rrd_stats_dimension_add(st, "sent", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3472
}
3473
else rrd_stats_next(st);
3474
3579
- rrd_stats_dimension_set(st, "received", &InSegs, NULL);
3580
- rrd_stats_dimension_set(st, "sent", &OutSegs, NULL);
3475
+ rrd_stats_dimension_set(st, "received", InSegs);
3476
+ rrd_stats_dimension_set(st, "sent", OutSegs);
3477
rrd_stats_done(st);
3478
}
3479
@@ -3589,13 +3485,13 @@ int do_proc_net_snmp() {
3485
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "tcperrors", NULL, "tcp", "IPv4 TCP Errors", "packets/s", 2700);
3486
st->isdetail = 1;
3487
3592
- rrd_stats_dimension_add(st, "InErrs", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3593
- rrd_stats_dimension_add(st, "RetransSegs", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3488
+ rrd_stats_dimension_add(st, "InErrs", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3489
+ rrd_stats_dimension_add(st, "RetransSegs", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3490
}
3491
else rrd_stats_next(st);
3492
3597
- rrd_stats_dimension_set(st, "InErrs", &InErrs, NULL);
3598
- rrd_stats_dimension_set(st, "RetransSegs", &RetransSegs, NULL);
3493
+ rrd_stats_dimension_set(st, "InErrs", InErrs);
3494
+ rrd_stats_dimension_set(st, "RetransSegs", RetransSegs);
3495
rrd_stats_done(st);
3496
}
3497
@@ -3607,19 +3503,19 @@ int do_proc_net_snmp() {
3503
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "tcphandshake", NULL, "tcp", "IPv4 TCP Handshake Issues", "events/s", 2900);
3504
st->isdetail = 1;
3505
3610
- rrd_stats_dimension_add(st, "EstabResets", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3611
- rrd_stats_dimension_add(st, "OutRsts", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3612
- rrd_stats_dimension_add(st, "ActiveOpens", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3613
- rrd_stats_dimension_add(st, "PassiveOpens", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3614
- rrd_stats_dimension_add(st, "AttemptFails", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3506
+ rrd_stats_dimension_add(st, "EstabResets", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3507
+ rrd_stats_dimension_add(st, "OutRsts", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3508
+ rrd_stats_dimension_add(st, "ActiveOpens", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3509
+ rrd_stats_dimension_add(st, "PassiveOpens", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3510
+ rrd_stats_dimension_add(st, "AttemptFails", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3511
}
3512
else rrd_stats_next(st);
3513
3618
- rrd_stats_dimension_set(st, "EstabResets", &EstabResets, NULL);
3619
- rrd_stats_dimension_set(st, "OutRsts", &OutRsts, NULL);
3620
- rrd_stats_dimension_set(st, "ActiveOpens", &ActiveOpens, NULL);
3621
- rrd_stats_dimension_set(st, "PassiveOpens", &PassiveOpens, NULL);
3622
- rrd_stats_dimension_set(st, "AttemptFails", &AttemptFails, NULL);
3514
+ rrd_stats_dimension_set(st, "EstabResets", EstabResets);
3515
+ rrd_stats_dimension_set(st, "OutRsts", OutRsts);
3516
+ rrd_stats_dimension_set(st, "ActiveOpens", ActiveOpens);
3517
+ rrd_stats_dimension_set(st, "PassiveOpens", PassiveOpens);
3518
+ rrd_stats_dimension_set(st, "AttemptFails", AttemptFails);
3519
rrd_stats_done(st);
3520
}
3521
}
@@ -3649,13 +3545,13 @@ int do_proc_net_snmp() {
3545
if(!st) {
3546
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "udppackets", NULL, "udp", "IPv4 UDP Packets", "packets/s", 2601);
3547
3652
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3653
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3548
+ rrd_stats_dimension_add(st, "received", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3549
+ rrd_stats_dimension_add(st, "sent", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3550
}
3551
else rrd_stats_next(st);
3552
3657
- rrd_stats_dimension_set(st, "received", &InDatagrams, NULL);
3658
- rrd_stats_dimension_set(st, "sent", &OutDatagrams, NULL);
3553
+ rrd_stats_dimension_set(st, "received", InDatagrams);
3554
+ rrd_stats_dimension_set(st, "sent", OutDatagrams);
3555
rrd_stats_done(st);
3556
}
3557
@@ -3667,17 +3563,17 @@ int do_proc_net_snmp() {
3563
st = rrd_stats_create(RRD_TYPE_NET_SNMP, "udperrors", NULL, "udp", "IPv4 UDP Errors", "events/s", 2701);
3564
st->isdetail = 1;
3565
3670
- rrd_stats_dimension_add(st, "RcvbufErrors", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3671
- rrd_stats_dimension_add(st, "SndbufErrors", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3672
- rrd_stats_dimension_add(st, "InErrors", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3673
- rrd_stats_dimension_add(st, "NoPorts", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3566
+ rrd_stats_dimension_add(st, "RcvbufErrors", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3567
+ rrd_stats_dimension_add(st, "SndbufErrors", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3568
+ rrd_stats_dimension_add(st, "InErrors", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3569
+ rrd_stats_dimension_add(st, "NoPorts", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3570
}
3571
else rrd_stats_next(st);
3572
3677
- rrd_stats_dimension_set(st, "InErrors", &InErrors, NULL);
3678
- rrd_stats_dimension_set(st, "NoPorts", &NoPorts, NULL);
3679
- rrd_stats_dimension_set(st, "RcvbufErrors", &RcvbufErrors, NULL);
3680
- rrd_stats_dimension_set(st, "SndbufErrors", &SndbufErrors, NULL);
3573
+ rrd_stats_dimension_set(st, "InErrors", InErrors);
3574
+ rrd_stats_dimension_set(st, "NoPorts", NoPorts);
3575
+ rrd_stats_dimension_set(st, "RcvbufErrors", RcvbufErrors);
3576
+ rrd_stats_dimension_set(st, "SndbufErrors", SndbufErrors);
3577
rrd_stats_done(st);
3578
}
3579
}
@@ -3746,13 +3642,13 @@ int do_proc_net_netstat() {
3642
if(!st) {
3643
st = rrd_stats_create("system", "ipv4", NULL, "ipv4", "IPv4 Bandwidth", "kilobits/s", 2000);
3644
3749
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
3750
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
3645
+ rrd_stats_dimension_add(st, "received", NULL, 8, 1024, RRD_DIMENSION_INCREMENTAL);
3646
+ rrd_stats_dimension_add(st, "sent", NULL, -8, 1024, RRD_DIMENSION_INCREMENTAL);
3647
}
3648
else rrd_stats_next(st);
3649
3754
- rrd_stats_dimension_set(st, "sent", &OutOctets, NULL);
3755
- rrd_stats_dimension_set(st, "received", &InOctets, NULL);
3650
+ rrd_stats_dimension_set(st, "sent", OutOctets);
3651
+ rrd_stats_dimension_set(st, "received", InOctets);
3652
rrd_stats_done(st);
3653
}
3654
@@ -3764,13 +3660,13 @@ int do_proc_net_netstat() {
3660
st = rrd_stats_create("ipv4", "inerrors", NULL, "ipv4", "IPv4 Input Errors", "packets/s", 4000);
3661
st->isdetail = 1;
3662
3767
- rrd_stats_dimension_add(st, "noroutes", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3768
- rrd_stats_dimension_add(st, "trunkated", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3663
+ rrd_stats_dimension_add(st, "noroutes", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3664
+ rrd_stats_dimension_add(st, "trunkated", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3665
}
3666
else rrd_stats_next(st);
3667
3772
- rrd_stats_dimension_set(st, "noroutes", &InNoRoutes, NULL);
3773
- rrd_stats_dimension_set(st, "trunkated", &InTruncatedPkts, NULL);
3668
+ rrd_stats_dimension_set(st, "noroutes", InNoRoutes);
3669
+ rrd_stats_dimension_set(st, "trunkated", InTruncatedPkts);
3670
rrd_stats_done(st);
3671
}
3672
@@ -3782,13 +3678,13 @@ int do_proc_net_netstat() {
3678
st = rrd_stats_create("ipv4", "mcast", NULL, "ipv4", "IPv4 Multicast Bandwidth", "kilobits/s", 9000);
3679
st->isdetail = 1;
3680
3785
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
3786
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
3681
+ rrd_stats_dimension_add(st, "received", NULL, 8, 1024, RRD_DIMENSION_INCREMENTAL);
3682
+ rrd_stats_dimension_add(st, "sent", NULL, -8, 1024, RRD_DIMENSION_INCREMENTAL);
3683
}
3684
else rrd_stats_next(st);
3685
3790
- rrd_stats_dimension_set(st, "sent", &OutMcastOctets, NULL);
3791
- rrd_stats_dimension_set(st, "received", &InMcastOctets, NULL);
3686
+ rrd_stats_dimension_set(st, "sent", OutMcastOctets);
3687
+ rrd_stats_dimension_set(st, "received", InMcastOctets);
3688
rrd_stats_done(st);
3689
}
3690
@@ -3800,13 +3696,13 @@ int do_proc_net_netstat() {
3696
st = rrd_stats_create("ipv4", "bcast", NULL, "ipv4", "IPv4 Broadcast Bandwidth", "kilobits/s", 8000);
3697
st->isdetail = 1;
3698
3803
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
3804
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
3699
+ rrd_stats_dimension_add(st, "received", NULL, 8, 1024, RRD_DIMENSION_INCREMENTAL);
3700
+ rrd_stats_dimension_add(st, "sent", NULL, -8, 1024, RRD_DIMENSION_INCREMENTAL);
3701
}
3702
else rrd_stats_next(st);
3703
3808
- rrd_stats_dimension_set(st, "sent", &OutBcastOctets, NULL);
3809
- rrd_stats_dimension_set(st, "received", &InBcastOctets, NULL);
3704
+ rrd_stats_dimension_set(st, "sent", OutBcastOctets);
3705
+ rrd_stats_dimension_set(st, "received", InBcastOctets);
3706
rrd_stats_done(st);
3707
}
3708
@@ -3818,13 +3714,13 @@ int do_proc_net_netstat() {
3714
st = rrd_stats_create("ipv4", "mcastpkts", NULL, "ipv4", "IPv4 Multicast Packets", "packets/s", 9500);
3715
st->isdetail = 1;
3716
3821
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3822
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3717
+ rrd_stats_dimension_add(st, "received", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3718
+ rrd_stats_dimension_add(st, "sent", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3719
}
3720
else rrd_stats_next(st);
3721
3826
- rrd_stats_dimension_set(st, "sent", &OutMcastPkts, NULL);
3827
- rrd_stats_dimension_set(st, "received", &InMcastPkts, NULL);
3722
+ rrd_stats_dimension_set(st, "sent", OutMcastPkts);
3723
+ rrd_stats_dimension_set(st, "received", InMcastPkts);
3724
rrd_stats_done(st);
3725
}
3726
@@ -3836,13 +3732,13 @@ int do_proc_net_netstat() {
3732
st = rrd_stats_create("ipv4", "bcastpkts", NULL, "ipv4", "IPv4 Broadcast Packets", "packets/s", 8500);
3733
st->isdetail = 1;
3734
3839
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3840
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3735
+ rrd_stats_dimension_add(st, "received", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3736
+ rrd_stats_dimension_add(st, "sent", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3737
}
3738
else rrd_stats_next(st);
3739
3844
- rrd_stats_dimension_set(st, "sent", &OutBcastPkts, NULL);
3845
- rrd_stats_dimension_set(st, "received", &InBcastPkts, NULL);
3740
+ rrd_stats_dimension_set(st, "sent", OutBcastPkts);
3741
+ rrd_stats_dimension_set(st, "received", InBcastPkts);
3742
rrd_stats_done(st);
3743
}
3744
}
@@ -3923,11 +3819,11 @@ int do_proc_net_stat_conntrack() {
3819
if(!st) {
3820
st = rrd_stats_create(RRD_TYPE_NET_STAT_CONNTRACK, "sockets", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connections", "active connections", 1000);
3821
3926
- rrd_stats_dimension_add(st, "connections", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_ABSOLUTE, NULL);
3822
+ rrd_stats_dimension_add(st, "connections", NULL, 1, 1, RRD_DIMENSION_ABSOLUTE);
3823
}
3824
else rrd_stats_next(st);
3825
3930
- rrd_stats_dimension_set(st, "connections", &aentries, NULL);
3826
+ rrd_stats_dimension_set(st, "connections", aentries);
3827
rrd_stats_done(st);
3828
}
3829
@@ -3938,15 +3834,15 @@ int do_proc_net_stat_conntrack() {
3834
if(!st) {
3835
st = rrd_stats_create(RRD_TYPE_NET_STAT_CONNTRACK, "new", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter New Connections", "connections/s", 1001);
3836
3941
- rrd_stats_dimension_add(st, "new", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3942
- rrd_stats_dimension_add(st, "ignore", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3943
- rrd_stats_dimension_add(st, "invalid", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3837
+ rrd_stats_dimension_add(st, "new", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3838
+ rrd_stats_dimension_add(st, "ignore", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3839
+ rrd_stats_dimension_add(st, "invalid", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3840
}
3841
else rrd_stats_next(st);
3842
3947
- rrd_stats_dimension_set(st, "new", &anew, NULL);
3948
- rrd_stats_dimension_set(st, "ignore", &aignore, NULL);
3949
- rrd_stats_dimension_set(st, "invalid", &ainvalid, NULL);
3843
+ rrd_stats_dimension_set(st, "new", anew);
3844
+ rrd_stats_dimension_set(st, "ignore", aignore);
3845
+ rrd_stats_dimension_set(st, "invalid", ainvalid);
3846
rrd_stats_done(st);
3847
}
3848
@@ -3958,15 +3854,15 @@ int do_proc_net_stat_conntrack() {
3854
st = rrd_stats_create(RRD_TYPE_NET_STAT_CONNTRACK, "changes", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connection Changes", "changes/s", 1002);
3855
st->isdetail = 1;
3856
3961
- rrd_stats_dimension_add(st, "inserted", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3962
- rrd_stats_dimension_add(st, "deleted", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3963
- rrd_stats_dimension_add(st, "delete_list", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3857
+ rrd_stats_dimension_add(st, "inserted", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3858
+ rrd_stats_dimension_add(st, "deleted", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3859
+ rrd_stats_dimension_add(st, "delete_list", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3860
}
3861
else rrd_stats_next(st);
3862
3967
- rrd_stats_dimension_set(st, "inserted", &ainsert, NULL);
3968
- rrd_stats_dimension_set(st, "deleted", &adelete, NULL);
3969
- rrd_stats_dimension_set(st, "delete_list", &adelete_list, NULL);
3863
+ rrd_stats_dimension_set(st, "inserted", ainsert);
3864
+ rrd_stats_dimension_set(st, "deleted", adelete);
3865
+ rrd_stats_dimension_set(st, "delete_list", adelete_list);
3866
rrd_stats_done(st);
3867
}
3868
@@ -3978,15 +3874,15 @@ int do_proc_net_stat_conntrack() {
3874
st = rrd_stats_create(RRD_TYPE_NET_STAT_CONNTRACK, "expect", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connection Expectations", "expectations/s", 1003);
3875
st->isdetail = 1;
3876
3981
- rrd_stats_dimension_add(st, "created", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3982
- rrd_stats_dimension_add(st, "deleted", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3983
- rrd_stats_dimension_add(st, "new", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3877
+ rrd_stats_dimension_add(st, "created", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3878
+ rrd_stats_dimension_add(st, "deleted", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3879
+ rrd_stats_dimension_add(st, "new", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3880
}
3881
else rrd_stats_next(st);
3882
3987
- rrd_stats_dimension_set(st, "created", &aexpect_create, NULL);
3988
- rrd_stats_dimension_set(st, "deleted", &aexpect_delete, NULL);
3989
- rrd_stats_dimension_set(st, "new", &aexpect_new, NULL);
3883
+ rrd_stats_dimension_set(st, "created", aexpect_create);
3884
+ rrd_stats_dimension_set(st, "deleted", aexpect_delete);
3885
+ rrd_stats_dimension_set(st, "new", aexpect_new);
3886
rrd_stats_done(st);
3887
}
3888
@@ -3998,15 +3894,15 @@ int do_proc_net_stat_conntrack() {
3894
st = rrd_stats_create(RRD_TYPE_NET_STAT_CONNTRACK, "search", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connection Searches", "searches/s", 1010);
3895
st->isdetail = 1;
3896
4001
- rrd_stats_dimension_add(st, "searched", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4002
- rrd_stats_dimension_add(st, "restarted", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4003
- rrd_stats_dimension_add(st, "found", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3897
+ rrd_stats_dimension_add(st, "searched", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3898
+ rrd_stats_dimension_add(st, "restarted", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3899
+ rrd_stats_dimension_add(st, "found", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3900
}
3901
else rrd_stats_next(st);
3902
4007
- rrd_stats_dimension_set(st, "searched", &asearched, NULL);
4008
- rrd_stats_dimension_set(st, "restarted", &asearch_restart, NULL);
4009
- rrd_stats_dimension_set(st, "found", &afound, NULL);
3903
+ rrd_stats_dimension_set(st, "searched", asearched);
3904
+ rrd_stats_dimension_set(st, "restarted", asearch_restart);
3905
+ rrd_stats_dimension_set(st, "found", afound);
3906
rrd_stats_done(st);
3907
}
3908
@@ -4018,17 +3914,17 @@ int do_proc_net_stat_conntrack() {
3914
st = rrd_stats_create(RRD_TYPE_NET_STAT_CONNTRACK, "errors", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Errors", "events/s", 1005);
3915
st->isdetail = 1;
3916
4021
- rrd_stats_dimension_add(st, "icmp_error", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4022
- rrd_stats_dimension_add(st, "insert_failed", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4023
- rrd_stats_dimension_add(st, "drop", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4024
- rrd_stats_dimension_add(st, "early_drop", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3917
+ rrd_stats_dimension_add(st, "icmp_error", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3918
+ rrd_stats_dimension_add(st, "insert_failed", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3919
+ rrd_stats_dimension_add(st, "drop", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3920
+ rrd_stats_dimension_add(st, "early_drop", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
3921
}
3922
else rrd_stats_next(st);
3923
4028
- rrd_stats_dimension_set(st, "icmp_error", &aicmp_error, NULL);
4029
- rrd_stats_dimension_set(st, "insert_failed", &ainsert_failed, NULL);
4030
- rrd_stats_dimension_set(st, "drop", &adrop, NULL);
4031
- rrd_stats_dimension_set(st, "early_drop", &aearly_drop, NULL);
3924
+ rrd_stats_dimension_set(st, "icmp_error", aicmp_error);
3925
+ rrd_stats_dimension_set(st, "insert_failed", ainsert_failed);
3926
+ rrd_stats_dimension_set(st, "drop", adrop);
3927
+ rrd_stats_dimension_set(st, "early_drop", aearly_drop);
3928
rrd_stats_done(st);
3929
}
3930
@@ -4093,11 +3989,11 @@ int do_proc_net_ip_vs_stats() {
3989
if(!st) {
3990
st = rrd_stats_create(RRD_TYPE_NET_IPVS, "sockets", NULL, RRD_TYPE_NET_IPVS, "IPVS New Connections", "connections/s", 1001);
3991
4096
- rrd_stats_dimension_add(st, "connections", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
3992
+ rrd_stats_dimension_add(st, "connections", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
3993
}
3994
else rrd_stats_next(st);
3995
4100
- rrd_stats_dimension_set(st, "connections", &entries, NULL);
3996
+ rrd_stats_dimension_set(st, "connections", entries);
3997
rrd_stats_done(st);
3998
}
3999
@@ -4108,13 +4004,13 @@ int do_proc_net_ip_vs_stats() {
4004
if(!st) {
4005
st = rrd_stats_create(RRD_TYPE_NET_IPVS, "packets", NULL, RRD_TYPE_NET_IPVS, "IPVS Packets", "packets/s", 1002);
4006
4111
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4112
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4007
+ rrd_stats_dimension_add(st, "received", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
4008
+ rrd_stats_dimension_add(st, "sent", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
4009
}
4010
else rrd_stats_next(st);
4011
4116
- rrd_stats_dimension_set(st, "received", &InPackets, NULL);
4117
- rrd_stats_dimension_set(st, "sent", &OutPackets, NULL);
4012
+ rrd_stats_dimension_set(st, "received", InPackets);
4013
+ rrd_stats_dimension_set(st, "sent", OutPackets);
4014
rrd_stats_done(st);
4015
}
4016
@@ -4125,13 +4021,13 @@ int do_proc_net_ip_vs_stats() {
4021
if(!st) {
4022
st = rrd_stats_create(RRD_TYPE_NET_IPVS, "net", NULL, RRD_TYPE_NET_IPVS, "IPVS Bandwidth", "kilobits/s", 1000);
4023
4128
- rrd_stats_dimension_add(st, "received", NULL, sizeof(unsigned long long), 0, 8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
4129
- rrd_stats_dimension_add(st, "sent", NULL, sizeof(unsigned long long), 0, -8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
4024
+ rrd_stats_dimension_add(st, "received", NULL, 8, 1024, RRD_DIMENSION_INCREMENTAL);
4025
+ rrd_stats_dimension_add(st, "sent", NULL, -8, 1024, RRD_DIMENSION_INCREMENTAL);
4026
}
4027
else rrd_stats_next(st);
4028
4133
- rrd_stats_dimension_set(st, "received", &InBytes, NULL);
4134
- rrd_stats_dimension_set(st, "sent", &OutBytes, NULL);
4029
+ rrd_stats_dimension_set(st, "received", InBytes);
4030
+ rrd_stats_dimension_set(st, "sent", OutBytes);
4031
rrd_stats_done(st);
4032
}
4033
@@ -4192,31 +4088,31 @@ int do_proc_stat() {
4088
long multiplier = 1;
4089
long divisor = 1; // sysconf(_SC_CLK_TCK);
4090
4195
- rrd_stats_dimension_add(st, "guest_nice", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4196
- rrd_stats_dimension_add(st, "guest", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4197
- rrd_stats_dimension_add(st, "steal", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4198
- rrd_stats_dimension_add(st, "softirq", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4199
- rrd_stats_dimension_add(st, "irq", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4200
- rrd_stats_dimension_add(st, "user", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4201
- rrd_stats_dimension_add(st, "system", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4202
- rrd_stats_dimension_add(st, "nice", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4203
- rrd_stats_dimension_add(st, "iowait", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4204
-
4205
- rrd_stats_dimension_add(st, "idle", NULL, sizeof(unsigned long long), 0, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL, NULL);
4091
+ rrd_stats_dimension_add(st, "guest_nice", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4092
+ rrd_stats_dimension_add(st, "guest", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4093
+ rrd_stats_dimension_add(st, "steal", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4094
+ rrd_stats_dimension_add(st, "softirq", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4095
+ rrd_stats_dimension_add(st, "irq", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4096
+ rrd_stats_dimension_add(st, "user", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4097
+ rrd_stats_dimension_add(st, "system", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4098
+ rrd_stats_dimension_add(st, "nice", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4099
+ rrd_stats_dimension_add(st, "iowait", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4100
+
4101
+ rrd_stats_dimension_add(st, "idle", NULL, multiplier, divisor, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
4102
rrd_stats_dimension_hide(st, "idle");
4103
}
4104
else rrd_stats_next(st);
4105
4210
- rrd_stats_dimension_set(st, "user", &user, NULL);
4211
- rrd_stats_dimension_set(st, "nice", &nice, NULL);
4212
- rrd_stats_dimension_set(st, "system", &system, NULL);
4213
- rrd_stats_dimension_set(st, "idle", &idle, NULL);
4214
- rrd_stats_dimension_set(st, "iowait", &iowait, NULL);
4215
- rrd_stats_dimension_set(st, "irq", &irq, NULL);
4216
- rrd_stats_dimension_set(st, "softirq", &softirq, NULL);
4217
- rrd_stats_dimension_set(st, "steal", &steal, NULL);
4218
- rrd_stats_dimension_set(st, "guest", &guest, NULL);
4219
- rrd_stats_dimension_set(st, "guest_nice", &guest_nice, NULL);
4106
+ rrd_stats_dimension_set(st, "user", user);
4107
+ rrd_stats_dimension_set(st, "nice", nice);
4108
+ rrd_stats_dimension_set(st, "system", system);
4109
+ rrd_stats_dimension_set(st, "idle", idle);
4110
+ rrd_stats_dimension_set(st, "iowait", iowait);
4111
+ rrd_stats_dimension_set(st, "irq", irq);
4112
+ rrd_stats_dimension_set(st, "softirq", softirq);
4113
+ rrd_stats_dimension_set(st, "steal", steal);
4114
+ rrd_stats_dimension_set(st, "guest", guest);
4115
+ rrd_stats_dimension_set(st, "guest_nice", guest_nice);
4116
rrd_stats_done(st);
4117
}
4118
}
@@ -4237,11 +4133,11 @@ int do_proc_stat() {
4133
st = rrd_stats_create("system", id, NULL, "cpu", "CPU Interrupts", "interrupts/s", 900);
4134
st->isdetail = 1;
4135
4240
- rrd_stats_dimension_add(st, "interrupts", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4136
+ rrd_stats_dimension_add(st, "interrupts", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
4137
}
4138
else rrd_stats_next(st);
4139
4244
- rrd_stats_dimension_set(st, "interrupts", &value, NULL);
4140
+ rrd_stats_dimension_set(st, "interrupts", value);
4141
rrd_stats_done(st);
4142
}
4143
}
@@ -4261,11 +4157,11 @@ int do_proc_stat() {
4157
if(!st) {
4158
st = rrd_stats_create("system", id, NULL, "cpu", "CPU Context Switches", "context switches/s", 800);
4159
4264
- rrd_stats_dimension_add(st, "switches", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4160
+ rrd_stats_dimension_add(st, "switches", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
4161
}
4162
else rrd_stats_next(st);
4163
4268
- rrd_stats_dimension_set(st, "switches", &value, NULL);
4164
+ rrd_stats_dimension_set(st, "switches", value);
4165
rrd_stats_done(st);
4166
}
4167
}
@@ -4313,11 +4209,11 @@ int do_proc_stat() {
4209
st = rrd_stats_create("system", "forks", NULL, "cpu", "New Processes", "processes/s", 700);
4210
st->isdetail = 1;
4211
4316
- rrd_stats_dimension_add(st, "started", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4212
+ rrd_stats_dimension_add(st, "started", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
4213
}
4214
else rrd_stats_next(st);
4215
4320
- rrd_stats_dimension_set(st, "started", &processes, NULL);
4216
+ rrd_stats_dimension_set(st, "started", processes);
4217
rrd_stats_done(st);
4218
}
4219
@@ -4328,13 +4224,13 @@ int do_proc_stat() {
4224
if(!st) {
4225
st = rrd_stats_create("system", "processes", NULL, "cpu", "Processes", "processes", 600);
4226
4331
- rrd_stats_dimension_add(st, "running", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_ABSOLUTE, NULL);
4332
- rrd_stats_dimension_add(st, "blocked", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_ABSOLUTE, NULL);
4227
+ rrd_stats_dimension_add(st, "running", NULL, 1, 1, RRD_DIMENSION_ABSOLUTE);
4228
+ rrd_stats_dimension_add(st, "blocked", NULL, -1, 1, RRD_DIMENSION_ABSOLUTE);
4229
}
4230
else rrd_stats_next(st);
4231
4336
- rrd_stats_dimension_set(st, "running", &running, NULL);
4337
- rrd_stats_dimension_set(st, "blocked", &blocked, NULL);
4232
+ rrd_stats_dimension_set(st, "running", running);
4233
+ rrd_stats_dimension_set(st, "blocked", blocked);
4234
rrd_stats_done(st);
4235
}
4236
@@ -4449,17 +4345,17 @@ int do_proc_meminfo() {
4345
if(!st) {
4346
st = rrd_stats_create("system", "ram", NULL, "mem", "System RAM", "MB", 200);
4347
4452
- rrd_stats_dimension_add(st, "buffers", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4453
- rrd_stats_dimension_add(st, "used", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4454
- rrd_stats_dimension_add(st, "cached", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4455
- rrd_stats_dimension_add(st, "free", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4348
+ rrd_stats_dimension_add(st, "buffers", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4349
+ rrd_stats_dimension_add(st, "used", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4350
+ rrd_stats_dimension_add(st, "cached", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4351
+ rrd_stats_dimension_add(st, "free", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4352
}
4353
else rrd_stats_next(st);
4354
4459
- rrd_stats_dimension_set(st, "used", &MemUsed, NULL);
4460
- rrd_stats_dimension_set(st, "free", &MemFree, NULL);
4461
- rrd_stats_dimension_set(st, "cached", &Cached, NULL);
4462
- rrd_stats_dimension_set(st, "buffers", &Buffers, NULL);
4355
+ rrd_stats_dimension_set(st, "used", MemUsed);
4356
+ rrd_stats_dimension_set(st, "free", MemFree);
4357
+ rrd_stats_dimension_set(st, "cached", Cached);
4358
+ rrd_stats_dimension_set(st, "buffers", Buffers);
4359
rrd_stats_done(st);
4360
}
4361
@@ -4473,13 +4369,13 @@ int do_proc_meminfo() {
4369
st = rrd_stats_create("system", "swap", NULL, "mem", "System Swap", "MB", 201);
4370
st->isdetail = 1;
4371
4476
- rrd_stats_dimension_add(st, "free", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4477
- rrd_stats_dimension_add(st, "used", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4372
+ rrd_stats_dimension_add(st, "free", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4373
+ rrd_stats_dimension_add(st, "used", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4374
}
4375
else rrd_stats_next(st);
4376
4481
- rrd_stats_dimension_set(st, "used", &SwapUsed, NULL);
4482
- rrd_stats_dimension_set(st, "free", &SwapFree, NULL);
4377
+ rrd_stats_dimension_set(st, "used", SwapUsed);
4378
+ rrd_stats_dimension_set(st, "free", SwapFree);
4379
rrd_stats_done(st);
4380
}
4381
@@ -4491,11 +4387,11 @@ int do_proc_meminfo() {
4387
st = rrd_stats_create("mem", "hwcorrupt", NULL, "mem", "Hardware Corrupted ECC", "MB", 9000);
4388
st->isdetail = 1;
4389
4494
- rrd_stats_dimension_add(st, "HardwareCorrupted", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4390
+ rrd_stats_dimension_add(st, "HardwareCorrupted", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4391
}
4392
else rrd_stats_next(st);
4393
4498
- rrd_stats_dimension_set(st, "HardwareCorrupted", &HardwareCorrupted, NULL);
4394
+ rrd_stats_dimension_set(st, "HardwareCorrupted", HardwareCorrupted);
4395
rrd_stats_done(st);
4396
}
4397
@@ -4507,11 +4403,11 @@ int do_proc_meminfo() {
4403
st = rrd_stats_create("mem", "committed", NULL, "mem", "Committed (Allocated) Memory", "MB", 5000);
4404
st->isdetail = 1;
4405
4510
- rrd_stats_dimension_add(st, "Committed_AS", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4406
+ rrd_stats_dimension_add(st, "Committed_AS", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4407
}
4408
else rrd_stats_next(st);
4409
4514
- rrd_stats_dimension_set(st, "Committed_AS", &Committed_AS, NULL);
4410
+ rrd_stats_dimension_set(st, "Committed_AS", Committed_AS);
4411
rrd_stats_done(st);
4412
}
4413
@@ -4523,19 +4419,19 @@ int do_proc_meminfo() {
4419
st = rrd_stats_create("mem", "writeback", NULL, "mem", "Writeback Memory", "MB", 4000);
4420
st->isdetail = 1;
4421
4526
- rrd_stats_dimension_add(st, "Dirty", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4527
- rrd_stats_dimension_add(st, "Writeback", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4528
- rrd_stats_dimension_add(st, "FuseWriteback", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4529
- rrd_stats_dimension_add(st, "NfsWriteback", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4530
- rrd_stats_dimension_add(st, "Bounce", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4422
+ rrd_stats_dimension_add(st, "Dirty", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4423
+ rrd_stats_dimension_add(st, "Writeback", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4424
+ rrd_stats_dimension_add(st, "FuseWriteback", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4425
+ rrd_stats_dimension_add(st, "NfsWriteback", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4426
+ rrd_stats_dimension_add(st, "Bounce", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4427
}
4428
else rrd_stats_next(st);
4429
4534
- rrd_stats_dimension_set(st, "Dirty", &Dirty, NULL);
4535
- rrd_stats_dimension_set(st, "Writeback", &Writeback, NULL);
4536
- rrd_stats_dimension_set(st, "FuseWriteback", &WritebackTmp, NULL);
4537
- rrd_stats_dimension_set(st, "NfsWriteback", &NFS_Unstable, NULL);
4538
- rrd_stats_dimension_set(st, "Bounce", &Bounce, NULL);
4430
+ rrd_stats_dimension_set(st, "Dirty", Dirty);
4431
+ rrd_stats_dimension_set(st, "Writeback", Writeback);
4432
+ rrd_stats_dimension_set(st, "FuseWriteback", WritebackTmp);
4433
+ rrd_stats_dimension_set(st, "NfsWriteback", NFS_Unstable);
4434
+ rrd_stats_dimension_set(st, "Bounce", Bounce);
4435
rrd_stats_done(st);
4436
}
4437
@@ -4547,17 +4443,17 @@ int do_proc_meminfo() {
4443
st = rrd_stats_create("mem", "kernel", NULL, "mem", "Memory Used by Kernel", "MB", 6000);
4444
st->isdetail = 1;
4445
4550
- rrd_stats_dimension_add(st, "Slab", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4551
- rrd_stats_dimension_add(st, "KernelStack", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4552
- rrd_stats_dimension_add(st, "PageTables", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4553
- rrd_stats_dimension_add(st, "VmallocUsed", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4446
+ rrd_stats_dimension_add(st, "Slab", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4447
+ rrd_stats_dimension_add(st, "KernelStack", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4448
+ rrd_stats_dimension_add(st, "PageTables", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4449
+ rrd_stats_dimension_add(st, "VmallocUsed", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4450
}
4451
else rrd_stats_next(st);
4452
4557
- rrd_stats_dimension_set(st, "KernelStack", &KernelStack, NULL);
4558
- rrd_stats_dimension_set(st, "Slab", &Slab, NULL);
4559
- rrd_stats_dimension_set(st, "PageTables", &PageTables, NULL);
4560
- rrd_stats_dimension_set(st, "VmallocUsed", &VmallocUsed, NULL);
4453
+ rrd_stats_dimension_set(st, "KernelStack", KernelStack);
4454
+ rrd_stats_dimension_set(st, "Slab", Slab);
4455
+ rrd_stats_dimension_set(st, "PageTables", PageTables);
4456
+ rrd_stats_dimension_set(st, "VmallocUsed", VmallocUsed);
4457
rrd_stats_done(st);
4458
}
4459
@@ -4569,13 +4465,13 @@ int do_proc_meminfo() {
4465
st = rrd_stats_create("mem", "slab", NULL, "mem", "Reclaimable Kernel Memory", "MB", 6500);
4466
st->isdetail = 1;
4467
4572
- rrd_stats_dimension_add(st, "reclaimable", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4573
- rrd_stats_dimension_add(st, "unreclaimable", NULL, sizeof(unsigned long long), 0, 1, 1024, RRD_DIMENSION_ABSOLUTE, NULL);
4468
+ rrd_stats_dimension_add(st, "reclaimable", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4469
+ rrd_stats_dimension_add(st, "unreclaimable", NULL, 1, 1024, RRD_DIMENSION_ABSOLUTE);
4470
}
4471
else rrd_stats_next(st);
4472
4577
- rrd_stats_dimension_set(st, "reclaimable", &SReclaimable, NULL);
4578
- rrd_stats_dimension_set(st, "unreclaimable", &SUnreclaim, NULL);
4473
+ rrd_stats_dimension_set(st, "reclaimable", SReclaimable);
4474
+ rrd_stats_dimension_set(st, "unreclaimable", SUnreclaim);
4475
rrd_stats_done(st);
4476
}
4477
@@ -4736,13 +4632,13 @@ int do_proc_vmstat() {
4632
if(!st) {
4633
st = rrd_stats_create("system", "swapio", NULL, "mem", "Swap I/O", "kilobytes/s", 250);
4634
4739
- rrd_stats_dimension_add(st, "in", NULL, sizeof(unsigned long long), 0, sysconf(_SC_PAGESIZE), 1024, RRD_DIMENSION_INCREMENTAL, NULL);
4740
- rrd_stats_dimension_add(st, "out", NULL, sizeof(unsigned long long), 0, -sysconf(_SC_PAGESIZE), 1024, RRD_DIMENSION_INCREMENTAL, NULL);
4635
+ rrd_stats_dimension_add(st, "in", NULL, sysconf(_SC_PAGESIZE), 1024, RRD_DIMENSION_INCREMENTAL);
4636
+ rrd_stats_dimension_add(st, "out", NULL, -sysconf(_SC_PAGESIZE), 1024, RRD_DIMENSION_INCREMENTAL);
4637
}
4638
else rrd_stats_next(st);
4639
4744
- rrd_stats_dimension_set(st, "in", &pswpin, NULL);
4745
- rrd_stats_dimension_set(st, "out", &pswpout, NULL);
4640
+ rrd_stats_dimension_set(st, "in", pswpin);
4641
+ rrd_stats_dimension_set(st, "out", pswpout);
4642
rrd_stats_done(st);
4643
}
4644
@@ -4753,13 +4649,13 @@ int do_proc_vmstat() {
4649
if(!st) {
4650
st = rrd_stats_create("system", "io", NULL, "disk", "Disk I/O", "kilobytes/s", 150);
4651
4756
- rrd_stats_dimension_add(st, "in", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4757
- rrd_stats_dimension_add(st, "out", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4652
+ rrd_stats_dimension_add(st, "in", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
4653
+ rrd_stats_dimension_add(st, "out", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
4654
}
4655
else rrd_stats_next(st);
4656
4761
- rrd_stats_dimension_set(st, "in", &pgpgin, NULL);
4762
- rrd_stats_dimension_set(st, "out", &pgpgout, NULL);
4657
+ rrd_stats_dimension_set(st, "in", pgpgin);
4658
+ rrd_stats_dimension_set(st, "out", pgpgout);
4659
rrd_stats_done(st);
4660
}
4661
@@ -4771,13 +4667,13 @@ int do_proc_vmstat() {
4667
st = rrd_stats_create("system", "pgfaults", NULL, "mem", "Memory Page Faults", "page faults/s", 500);
4668
st->isdetail = 1;
4669
4774
- rrd_stats_dimension_add(st, "minor", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4775
- rrd_stats_dimension_add(st, "major", NULL, sizeof(unsigned long long), 0, -1, 1, RRD_DIMENSION_INCREMENTAL, NULL);
4670
+ rrd_stats_dimension_add(st, "minor", NULL, 1, 1, RRD_DIMENSION_INCREMENTAL);
4671
+ rrd_stats_dimension_add(st, "major", NULL, -1, 1, RRD_DIMENSION_INCREMENTAL);
4672
}
4673
else rrd_stats_next(st);
4674
4779
- rrd_stats_dimension_set(st, "minor", &pgfault, NULL);
4780
- rrd_stats_dimension_set(st, "major", &pgmajfault, NULL);
4675
+ rrd_stats_dimension_set(st, "minor", pgfault);
4676
+ rrd_stats_dimension_set(st, "major", pgmajfault);
4677
rrd_stats_done(st);
4678
}
4679
@@ -4853,13 +4749,13 @@ void *proc_main(void *ptr)
4749
if(!stcpu) {
4750
stcpu = rrd_stats_create("cpu", "netdata", NULL, "cpu", "NetData CPU usage", "milliseconds/s", 9999);
4751
4856
- rrd_stats_dimension_add(stcpu, "user", NULL, sizeof(unsigned long long), 0, 1, 1000, RRD_DIMENSION_INCREMENTAL, NULL);
4857
- rrd_stats_dimension_add(stcpu, "system", NULL, sizeof(unsigned long long), 0, 1, 1000, RRD_DIMENSION_INCREMENTAL, NULL);
4752
+ rrd_stats_dimension_add(stcpu, "user", NULL, 1, 1000, RRD_DIMENSION_INCREMENTAL);
4753
+ rrd_stats_dimension_add(stcpu, "system", NULL, 1, 1000, RRD_DIMENSION_INCREMENTAL);
4754
}
4755
else rrd_stats_next(stcpu);
4756
4861
- rrd_stats_dimension_set(stcpu, "user", &cpuuser, NULL);
4862
- rrd_stats_dimension_set(stcpu, "system", &cpusyst, NULL);
4757
+ rrd_stats_dimension_set(stcpu, "user", cpuuser);
4758
+ rrd_stats_dimension_set(stcpu, "system", cpusyst);
4759
rrd_stats_done(stcpu);
4760
4761
bcopy(&me, &me_last, sizeof(struct rusage));
@@ -4899,7 +4795,7 @@ struct tc_class {
4795
struct tc_device {
4796
char id[RRD_STATS_NAME_MAX + 1];
4797
char name[RRD_STATS_NAME_MAX + 1];
4902
- char group[RRD_STATS_NAME_MAX + 1];
4798
+ char family[RRD_STATS_NAME_MAX + 1];
4799
4800
struct tc_class *classes;
4801
};
@@ -4949,11 +4845,11 @@ void tc_device_commit(struct tc_device *d)
4845
if(!st) {
4846
debug(D_TC_LOOP, "TC: Committing new TC device '%s'", d->name);
4847
4952
- st = rrd_stats_create(RRD_TYPE_TC, d->id, d->name, d->group, "Class Usage", "kilobits/s", 1000);
4848
+ st = rrd_stats_create(RRD_TYPE_TC, d->id, d->name, d->family, "Class Usage", "kilobits/s", 1000);
4849
4850
for ( c = d->classes ; c ; c = c->next) {
4851
if(c->isleaf && c->hasparent)
4956
- rrd_stats_dimension_add(st, c->id, c->name, sizeof(unsigned long long), 0, 8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
4852
+ rrd_stats_dimension_add(st, c->id, c->name, 8, 1024, RRD_DIMENSION_INCREMENTAL);
4853
}
4854
}
4855
else {
@@ -4963,11 +4859,11 @@ void tc_device_commit(struct tc_device *d)
4859
4860
for ( c = d->classes ; c ; c = c->next) {
4861
if(c->isleaf && c->hasparent) {
4966
- if(rrd_stats_dimension_set(st, c->id, &c->bytes, NULL) != 0) {
4862
+ if(rrd_stats_dimension_set(st, c->id, c->bytes) != 0) {
4863
4864
// new class, we have to add it
4969
- rrd_stats_dimension_add(st, c->id, c->name, sizeof(unsigned long long), 0, 8, 1024, RRD_DIMENSION_INCREMENTAL, NULL);
4970
- rrd_stats_dimension_set(st, c->id, &c->bytes, NULL);
4865
+ rrd_stats_dimension_add(st, c->id, c->name, 8, 1024, RRD_DIMENSION_INCREMENTAL);
4866
+ rrd_stats_dimension_set(st, c->id, c->bytes);
4867
}
4868
4869
// if it has a name, different to the id
@@ -5002,9 +4898,9 @@ void tc_device_set_device_name(struct tc_device *d, char *name)
4898
// no need for null termination - it is already null
4899
}
4900
5005
-void tc_device_set_device_group(struct tc_device *d, char *name)
4901
+void tc_device_set_device_family(struct tc_device *d, char *name)
4902
{
5007
- strncpy(d->group, name, RRD_STATS_NAME_MAX);
4903
+ strncpy(d->family, name, RRD_STATS_NAME_MAX);
4904
// no need for null termination - it is already null
4905
}
4906
@@ -5020,7 +4916,7 @@ struct tc_device *tc_device_create(char *name)
4916
4917
strncpy(d->id, name, RRD_STATS_NAME_MAX);
4918
strcpy(d->name, d->id);
5023
- strcpy(d->group, d->id);
4919
+ strcpy(d->family, d->id);
4920
4921
// no need for null termination on the strings, because of calloc()
4922
@@ -5148,7 +5044,7 @@ void *tc_main(void *ptr)
5044
}
5045
else if(device && (strcmp(p, "SETDEVICEGROUP") == 0)) {
5046
char *name = strsep(&b, " \n");
5151
- if(name && *name) tc_device_set_device_group(device, name);
5047
+ if(name && *name) tc_device_set_device_family(device, name);
5048
}
5049
else if(device && (strcmp(p, "SETCLASSNAME") == 0)) {
5050
char *id = strsep(&b, " \n");
@@ -5191,7 +5087,7 @@ void *cpuidlejitter_main(void *ptr)
5087
struct timeval before, after;
5088
5089
while(1) {
5194
- unsigned long long usec, susec = 0;
5090
+ unsigned long long usec = 0, susec = 0;
5091
5092
while(susec < (update_every * 1000000L)) {
5093
@@ -5209,11 +5105,11 @@ void *cpuidlejitter_main(void *ptr)
5105
if(!st) {
5106
st = rrd_stats_create("system", "idlejitter", NULL, "cpu", "CPU Idle Jitter", "microseconds lost/s", 9999);
5107
5212
- rrd_stats_dimension_add(st, "jitter", NULL, sizeof(unsigned long long), 0, 1, 1, RRD_DIMENSION_ABSOLUTE, NULL);
5108
+ rrd_stats_dimension_add(st, "jitter", NULL, 1, 1, RRD_DIMENSION_ABSOLUTE);
5109
}
5110
else rrd_stats_next(st);
5111
5216
- rrd_stats_dimension_set(st, "jitter", &usec, NULL);
5112
+ rrd_stats_dimension_set(st, "jitter", usec);
5113
rrd_stats_done(st);
5114
}
5115
@@ -5336,8 +5232,8 @@ int main(int argc, char **argv)
5232
// parse the arguments
5233
for(i = 1; i < argc ; i++) {
5234
if(strcmp(argv[i], "-c") == 0 && (i+1) < argc) {
5339
- if(load_config(argv[i+1], 1) != 0) {
5340
- fprintf(stderr, "Cannot load configuration file %s.\n", argv[i+1]);
5235
+ if(load_config(argv[i+1], 1) != 1) {
5236
+ fprintf(stderr, "Cannot load configuration file %s. Reason: %s\n", argv[i+1], strerror(errno));
5237
exit(1);
5238
}
5239
else {
web/index.js
+5
-5
@@ -34,7 +34,7 @@ var mainmenu = "";
34
35
function thumbChartActions(i, c, nogroup) {
36
var name = c.name;
37
- if(!nogroup) name = c.group_tag;
37
+ if(!nogroup) name = c.family;
38
39
var refinfo = "the chart is drawing ";
40
if(c.group == 1) refinfo += "every single point collected (" + c.update_every + "s each).";
@@ -50,7 +50,7 @@ function thumbChartActions(i, c, nogroup) {
50
var ingroup_detail = 0;
51
52
$.each(mycharts, function(i, d) {
53
- if(d.group_tag == c.group_tag) {
53
+ if(d.family == c.family) {
54
ingroup++;
55
if(d.isdetail) ingroup_detail++;
56
}
@@ -59,7 +59,7 @@ function thumbChartActions(i, c, nogroup) {
59
var hidden = "";
60
if(ingroup_detail) hidden = ", including " + ingroup_detail + " charts not shown now";
61
62
- html += "<button type=\"button\" data-toggle=\"tooltip\" title=\"Show all " + ingroup + " charts in group '" + c.group_tag + "'" + hidden + "\" class=\"btn btn-default\" onclick=\"initGroupGraphs('" + c.group_tag +"');\"><span class=\"glyphicon glyphicon-th-large\"></span></button>";
62
+ html += "<button type=\"button\" data-toggle=\"tooltip\" title=\"Show all " + ingroup + " charts in group '" + c.family + "'" + hidden + "\" class=\"btn btn-default\" onclick=\"initGroupGraphs('" + c.family +"');\"><span class=\"glyphicon glyphicon-th-large\"></span></button>";
63
}
64
65
html += "<button type=\"button\" data-toggle=\"tooltip\" title=\"show chart '" + c.name + "' in fullscreen\" class=\"btn btn-default\" onclick=\"initMainChartIndex(" + i +");\"><span class=\"glyphicon glyphicon-resize-full\"></span></button>"
@@ -773,7 +773,7 @@ function switchToGroupGraphs() {
773
document.getElementById('thumbgraphs_container').style.display = 'none';
774
document.getElementById('groupgraphs_container').style.display = 'block';
775
776
- document.getElementById("main_menu_div").innerHTML = "<ul class=\"nav navbar-nav\"><li><a href=\"javascript:switchToThumbGraphs();\">Back to Home</a></li><li class=\"active\"><a href=\"#\">" + group_charts[0].group_tag + " charts</a></li></ul>";
776
+ document.getElementById("main_menu_div").innerHTML = "<ul class=\"nav navbar-nav\"><li><a href=\"javascript:switchToThumbGraphs();\">Back to Home</a></li><li class=\"active\"><a href=\"#\">" + group_charts[0].family + " charts</a></li></ul>";
777
778
window.scrollTo(0, 0);
779
@@ -795,7 +795,7 @@ function initGroupGraphs(group) {
795
796
var groupbody = "";
797
$.each(mycharts, function(i, c) {
798
- if(c.group_tag == group) {
798
+ if(c.family == group) {
799
group_charts[count] = [];
800
group_charts[count] = $.extend(true, {}, c);
801
group_charts[count].div += "_group";