// Draw the line
DRAW_LINE_WITH_LABEL(args, 1, "freq_cur", object, COLOR_CPU(i), 0, _("CPU Core %ld"), i);
- PRINT_CAMM(args, "freq_cur", object, HZ);
+ PRINT_CAMM(args, "freq_cur", object, HZ, HZ_UNIT);
// Draw the minimum
DRAW_LINE(args, 2, "freq_min", object, COLOR_MINIMUM, 0);
#define FLOAT "%%16.2lf"
#define FLOAT_WITH_UNIT "%%12.2lf %3s"
#define LARGE_FLOAT "%%14.2lf %%s"
-#define BPS "%%11.2lf %%s%3s", _("bps")
-#define PPS "%%12.2lf %3s", _("pps")
-#define QPS "%%12.2lf %3s", _("qps")
-#define HZ "%%12.2lf %%s%2s", _("Hz")
+#define BPS "%%11.2lf %%s%3s"
+#define BPS_UNIT _("bps")
+#define PPS "%%12.2lf %3s"
+#define PPS_UNIT _("pps")
+#define QPS "%%12.2lf %3s"
+#define QPS_UNIT _("qps")
+#define HZ "%%12.2lf %%s%2s"
+#define HZ_UNIT _("Hz")
#define SECONDS_HIGHRES "%%14.2lf%%ss"
#define SECONDS "%%15.2lfs"
do { \
COMPUTE_BITS(args, FIELD_BITS(bytes), object, bytes); \
DRAW_AREA_WITH_LABEL(args, FIELD_BITS(bytes), object, color, 0, label, __VA_ARGS__); \
- PRINT_CAMM(args, bytes, object, BPS); \
+ PRINT_CAMM(args, bytes, object, BPS, BPS_UNIT); \
} while (0)
/*
#define __DRAW_PACKETS(args, object, packets, color, label, ...) \
do { \
DRAW_AREA_WITH_LABEL(args, packets, object, color, 0, label, __VA_ARGS__); \
- PRINT_CAMM(args, packets, object, PPS); \
+ PRINT_CAMM(args, packets, object, PPS, PPS_UNIT); \
} while (0)
/*
// Receive Rate
DRAW_LINE_WITH_LABEL(args, 2, "rx_rate", object, COLOR_RX, 0, _("Receive Rate"));
- PRINT_CAMM(args, "rx_rate", object, BPS);
+ PRINT_CAMM(args, "rx_rate", object, BPS, BPS_UNIT);
// Transmit Rate
DRAW_LINE_WITH_LABEL(args, 2, "tx_rate", object, COLOR_TX, 0, _("Transmit Rate"));
- PRINT_CAMM(args, "tx_rate", object, BPS);
+ PRINT_CAMM(args, "tx_rate", object, BPS, BPS_UNIT);
return 0;
}
DRAW_AREA_WITH_LABEL(args, "packets", "DROP_HOSTILE",
COLOR_DROP, 0, _("Dropped Packets"));
- PRINT_CAMM(args, "packets", "DROP_HOSTILE", PPS);
+ PRINT_CAMM(args, "packets", "DROP_HOSTILE", PPS, PPS_UNIT);
return 0;
}
DRAW_AREA_OUTLINE_WITH_LABEL(args, "packets", "DROP_PSCAN_FRAG",
COLOR_IP_FRAG, 0, _("Fragmented Packets"));
- PRINT_CAMM(args, "packets", "DROP_PSCAN_FRAG", PPS);
+ PRINT_CAMM(args, "packets", "DROP_PSCAN_FRAG", PPS, PPS_UNIT);
DRAW_AREA_OUTLINE_WITH_LABEL(args, "packets", "DROP_PSCAN_ICMP",
COLOR_ICMP, STACKED, _("ICMP"));
- PRINT_CAMM(args, "packets", "DROP_PSCAN_ICMP", PPS);
+ PRINT_CAMM(args, "packets", "DROP_PSCAN_ICMP", PPS, PPS_UNIT);
DRAW_AREA_OUTLINE_WITH_LABEL(args, "packets", "DROP_PSCAN_UDP",
COLOR_UDP, STACKED, _("UDP"));
- PRINT_CAMM(args, "packets", "DROP_PSCAN_UDP", PPS);
+ PRINT_CAMM(args, "packets", "DROP_PSCAN_UDP", PPS, PPS_UNIT);
DRAW_AREA_OUTLINE_WITH_LABEL(args, "packets", "DROP_PSCAN_TCP",
COLOR_TCP, STACKED, _("TCP"));
- PRINT_CAMM(args, "packets", "DROP_PSCAN_TCP", PPS);
+ PRINT_CAMM(args, "packets", "DROP_PSCAN_TCP", PPS, PPS_UNIT);
// Header
PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
// Draw the area outlines afterwards
DRAW_AREA_OUTLINE_WITH_LABEL(args, "bps", "WHITELISTED", COLOR_WHITELISTED,
0, _("Whitelisted"));
- PRINT_CAMM(args, "bps", "WHITELISTED", BPS);
+ PRINT_CAMM(args, "bps", "WHITELISTED", BPS, BPS_UNIT);
DRAW_AREA_OUTLINE_WITH_LABEL(args, "bps", "BYPASSED", COLOR_OFFLOADED,
STACKED, _("Offloaded"));
- PRINT_CAMM(args, "bps", "BYPASSED", BPS);
+ PRINT_CAMM(args, "bps", "BYPASSED", BPS, BPS_UNIT);
DRAW_AREA_OUTLINE_WITH_LABEL(args, "bps", "SCANNED", COLOR_SCANNED,
STACKED, _("Scanned"));
- PRINT_CAMM(args, "bps", "SCANNED", BPS);
+ PRINT_CAMM(args, "bps", "SCANNED", BPS, BPS_UNIT);
PRINT_EMPTY_LINE(args);
// Show the total throughput
PRINT_LABEL(args, _("Total"));
- PRINT_CAMM(args, "total", NULL, BPS);
+ PRINT_CAMM(args, "total", NULL, BPS, BPS_UNIT);
// Header
PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
// Show the total queries
PRINT_LABEL(args, _("Total"));
- PRINT_CAMM(args, "queries", NULL, QPS);
+ PRINT_CAMM(args, "queries", NULL, QPS, QPS_UNIT);
PRINT_EMPTY_LINE(args);
// Draw the area outlines afterwards
DRAW_AREA_OUTLINE_WITH_LABEL(args, "cachehits", NULL,
COLOR_CACHE_HIT, 0, _("Cache Hits"));
- PRINT_CAMM(args, "cachehits", NULL, QPS);
+ PRINT_CAMM(args, "cachehits", NULL, QPS, QPS_UNIT);
DRAW_AREA_OUTLINE_WITH_LABEL(args, "cachemiss", NULL,
COLOR_CACHE_MISS, STACKED, _("Cache Miss"));
- PRINT_CAMM(args, "cachemiss", NULL, QPS);
+ PRINT_CAMM(args, "cachemiss", NULL, QPS, QPS_UNIT);
DRAW_LINE_WITH_LABEL(args, 1, "prefetch", NULL,
COLOR_CACHE_PREFETCH, 0, _("Prefetched Queries"));
- PRINT_CAMM(args, "prefetch", NULL, QPS);
+ PRINT_CAMM(args, "prefetch", NULL, QPS, QPS_UNIT);
return 0;
}
// Draw the average
DRAW_AREA_WITH_LABEL(args, "queries", NULL, COLOR_DEFAULT, 0, _("DNS Queries"));
- PRINT_CAMM(args, "queries", NULL, QPS);
+ PRINT_CAMM(args, "queries", NULL, QPS, QPS_UNIT);
return 0;
}