nfsd read-ahead depth is now reported as a percentage; fixed an issue with RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL which was zeroing the percentages of dimensions when there were moments without new data
Costa Tsaousis (ktsaou) committed
Mar 18, 2015 at 00:45 UTC
b9370bee219c5283dc24a19f1a8ec65d467aea84
2 files changed
+14
-14
src/proc_net_rpc_nfsd.c
+13
-13
@@ -516,19 +516,19 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
516
if(do_ra == 2) {
517
st = rrd_stats_find_bytype("nfsd", "readahead");
518
if(!st) {
519
- st = rrd_stats_create("nfsd", "readahead", NULL, "nfsd", "Read Ahead Depth", "reads/s", 5005, update_every, CHART_TYPE_STACKED);
520
-
521
- rrd_stats_dimension_add(st, "10%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
522
- rrd_stats_dimension_add(st, "20%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
523
- rrd_stats_dimension_add(st, "30%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
524
- rrd_stats_dimension_add(st, "40%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
525
- rrd_stats_dimension_add(st, "50%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
526
- rrd_stats_dimension_add(st, "60%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
527
- rrd_stats_dimension_add(st, "70%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
528
- rrd_stats_dimension_add(st, "80%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
529
- rrd_stats_dimension_add(st, "90%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
530
- rrd_stats_dimension_add(st, "100%", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
531
- rrd_stats_dimension_add(st, "misses", NULL, 1, update_every, RRD_DIMENSION_INCREMENTAL);
519
+ st = rrd_stats_create("nfsd", "readahead", NULL, "nfsd", "Read Ahead Depth", "percentage", 5005, update_every, CHART_TYPE_STACKED);
520
+
521
+ rrd_stats_dimension_add(st, "10%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
522
+ rrd_stats_dimension_add(st, "20%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
523
+ rrd_stats_dimension_add(st, "30%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
524
+ rrd_stats_dimension_add(st, "40%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
525
+ rrd_stats_dimension_add(st, "50%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
526
+ rrd_stats_dimension_add(st, "60%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
527
+ rrd_stats_dimension_add(st, "70%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
528
+ rrd_stats_dimension_add(st, "80%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
529
+ rrd_stats_dimension_add(st, "90%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
530
+ rrd_stats_dimension_add(st, "100%", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
531
+ rrd_stats_dimension_add(st, "misses", NULL, 1, update_every, RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL);
532
}
533
else rrd_stats_next(st);
534
src/rrd.c
+1
-1
@@ -682,7 +682,7 @@ unsigned long long rrd_stats_done(RRD_STATS *st)
682
case RRD_DIMENSION_PCENT_OVER_DIFF_TOTAL:
683
// the percentage of the current increment
684
// over the increment of all dimensions together
685
- if(st->collected_total == st->last_collected_total) rd->calculated_value = 0;
685
+ if(st->collected_total == st->last_collected_total) rd->calculated_value = rd->last_calculated_value;
686
else rd->calculated_value =
687
(calculated_number)100
688
* (calculated_number)(rd->collected_value - rd->last_collected_value)