added new_pids counter to apps.plugin monitoring
Costa Tsaousis (ktsaou) committed
Mar 8, 2017 at 00:23 UTC
388457d7eea6a76fcb3f624df11f199fa4a343b9
1 file changed
+21
-17
src/apps_plugin.c
+21
-17
@@ -90,7 +90,8 @@ static int
90
static size_t
91
global_iterations_counter = 1,
92
calls_counter = 0,
93
- file_counter = 0;
93
+ file_counter = 0,
94
+ targets_assignment_counter = 0;
95
96
97
// ----------------------------------------------------------------------------
@@ -749,6 +750,8 @@ static inline int managed_log(struct pid_stat *p, uint32_t log, int status) {
750
}
751
752
static inline void assign_target_to_pid(struct pid_stat *p) {
753
+ targets_assignment_counter++;
754
+
755
uint32_t hash = simple_hash(p->comm);
756
size_t pclen = strlen(p->comm);
757
@@ -2651,12 +2654,13 @@ static usec_t send_resource_usage_to_netdata() {
2654
, "CHART netdata.apps_cpu '' 'Apps Plugin CPU' 'milliseconds/s' apps.plugin netdata.apps_cpu stacked 140000 %1$d\n"
2655
"DIMENSION user '' incremental 1 1000\n"
2656
"DIMENSION system '' incremental 1 1000\n"
2654
- "CHART netdata.apps_files '' 'Apps Plugin Files' 'files/s' apps.plugin netdata.apps_files line 140001 %1$d\n"
2657
+ "CHART netdata.apps_sizes '' 'Apps Plugin Files' 'files/s' apps.plugin netdata.apps_sizes line 140001 %1$d\n"
2658
"DIMENSION calls '' incremental 1 1\n"
2659
"DIMENSION files '' incremental 1 1\n"
2660
"DIMENSION pids '' absolute 1 1\n"
2661
"DIMENSION fds '' absolute 1 1\n"
2662
"DIMENSION targets '' absolute 1 1\n"
2663
+ "DIMENSION new_pids 'new pids' incremental 1 1\n"
2664
"CHART netdata.apps_fix '' 'Apps Plugin Normalization Ratios' 'percentage' apps.plugin netdata.apps_fix line 140002 %1$d\n"
2665
"DIMENSION utime '' absolute 1 %2$llu\n"
2666
"DIMENSION stime '' absolute 1 %2$llu\n"
@@ -2685,12 +2689,13 @@ static usec_t send_resource_usage_to_netdata() {
2689
"SET user = %llu\n"
2690
"SET system = %llu\n"
2691
"END\n"
2688
- "BEGIN netdata.apps_files %llu\n"
2692
+ "BEGIN netdata.apps_sizes %llu\n"
2693
"SET calls = %zu\n"
2694
"SET files = %zu\n"
2695
"SET pids = %zu\n"
2696
"SET fds = %d\n"
2697
"SET targets = %zu\n"
2698
+ "SET new_pids = %zu\n"
2699
"END\n"
2700
"BEGIN netdata.apps_fix %llu\n"
2701
"SET utime = %u\n"
@@ -2708,6 +2713,7 @@ static usec_t send_resource_usage_to_netdata() {
2713
, all_pids_count
2714
, all_files_len
2715
, apps_groups_targets_count
2716
+ , targets_assignment_counter
2717
, usec
2718
, (unsigned int)(utime_fix_ratio * 100 * RATES_DETAIL)
2719
, (unsigned int)(stime_fix_ratio * 100 * RATES_DETAIL)
@@ -3097,20 +3103,6 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type
3103
fprintf(stdout, "DIMENSION %s '' absolute 1 %llu\n", w->name, RATES_DETAIL);
3104
}
3105
3100
-#ifndef __FreeBSD__
3101
- fprintf(stdout, "CHART %s.lreads '' '%s Disk Logical Reads' 'kilobytes/s' disk %s.lreads stacked 20042 %d\n", type, title, type, update_every);
3102
- for (w = root; w ; w = w->next) {
3103
- if(unlikely(w->exposed))
3104
- fprintf(stdout, "DIMENSION %s '' absolute 1 %llu\n", w->name, 1024LLU * RATES_DETAIL);
3105
- }
3106
-
3107
- fprintf(stdout, "CHART %s.lwrites '' '%s I/O Logical Writes' 'kilobytes/s' disk %s.lwrites stacked 20042 %d\n", type, title, type, update_every);
3108
- for (w = root; w ; w = w->next) {
3109
- if(unlikely(w->exposed))
3110
- fprintf(stdout, "DIMENSION %s '' absolute 1 %llu\n", w->name, 1024LLU * RATES_DETAIL);
3111
- }
3112
-#endif
3113
-
3106
#ifdef __FreeBSD__
3107
fprintf(stdout, "CHART %s.preads '' '%s Disk Reads' 'blocks/s' disk %s.preads stacked 20002 %d\n", type, title, type, update_every);
3108
for (w = root; w ; w = w->next) {
@@ -3135,6 +3127,18 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type
3127
if(unlikely(w->exposed))
3128
fprintf(stdout, "DIMENSION %s '' absolute 1 %llu\n", w->name, 1024LLU * RATES_DETAIL);
3129
}
3130
+
3131
+ fprintf(stdout, "CHART %s.lreads '' '%s Disk Logical Reads' 'kilobytes/s' disk %s.lreads stacked 20042 %d\n", type, title, type, update_every);
3132
+ for (w = root; w ; w = w->next) {
3133
+ if(unlikely(w->exposed))
3134
+ fprintf(stdout, "DIMENSION %s '' absolute 1 %llu\n", w->name, 1024LLU * RATES_DETAIL);
3135
+ }
3136
+
3137
+ fprintf(stdout, "CHART %s.lwrites '' '%s I/O Logical Writes' 'kilobytes/s' disk %s.lwrites stacked 20042 %d\n", type, title, type, update_every);
3138
+ for (w = root; w ; w = w->next) {
3139
+ if(unlikely(w->exposed))
3140
+ fprintf(stdout, "DIMENSION %s '' absolute 1 %llu\n", w->name, 1024LLU * RATES_DETAIL);
3141
+ }
3142
#endif
3143
3144
if(enable_file_charts) {