diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2023-01-18 21:32:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 21:32:50 +0200 |
commit | c1908d3163185cf65a139edeb11a165a10eca1e9 (patch) | |
tree | 6fe69ef8cd5f5797253e0d583fe60d56c69ec3da /collectors | |
parent | 51565d55e92b6f814a09ca87d3c77a40acba576c (diff) |
DBENGINE v2 - improvements part 5 (#14289)
* cleanup journal v2 mounts periodically
* fix for last commit
* re-enable loading page from disk when the arrangement of pages requires it
* Remove unused statistics
* Estimate diskspace when the current datafile is full and queue a rotate command (Currently it will not attempt to estimate end size for journals)
Queue a command to check quota on startup per tier
* apps.plugin now exposes RSS chart
* shorter thread names to make debugging easier, since thread names can only be 15 characters
* more thread names fixes
* allow an apps_groups.conf target to be pid 0 or 1
Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/apps.plugin/apps_plugin.c | 19 | ||||
-rw-r--r-- | collectors/diskspace.plugin/plugin_diskspace.c | 3 | ||||
-rw-r--r-- | collectors/plugins.d/plugins_d.c | 2 | ||||
-rw-r--r-- | collectors/proc.plugin/plugin_proc.h | 2 | ||||
-rw-r--r-- | collectors/statsd.plugin/statsd.c | 2 |
5 files changed, 21 insertions, 7 deletions
diff --git a/collectors/apps.plugin/apps_plugin.c b/collectors/apps.plugin/apps_plugin.c index fc36ef9d74..8cc39c8dbe 100644 --- a/collectors/apps.plugin/apps_plugin.c +++ b/collectors/apps.plugin/apps_plugin.c @@ -420,6 +420,7 @@ struct pid_stat { int sortlist; // higher numbers = top on the process tree // each process gets a unique number + bool matched_by_config; struct target *target; // app_groups.conf targets struct target *user_target; // uid based targets struct target *group_target; // gid based targets @@ -1103,6 +1104,7 @@ static inline void assign_target_to_pid(struct pid_stat *p) { || (proc_pid_cmdline_is_needed && w->starts_with && w->ends_with && p->cmdline && strstr(p->cmdline, w->compare)) ))) { + p->matched_by_config = true; if(w->target) p->target = w->target; else p->target = w; @@ -2832,11 +2834,11 @@ static void apply_apps_groups_targets_inheritance(void) { } // init goes always to default target - if(all_pids[INIT_PID]) + if(all_pids[INIT_PID] && !all_pids[INIT_PID]->matched_by_config) all_pids[INIT_PID]->target = apps_groups_default_target; // pid 0 goes always to default target - if(all_pids[0]) + if(all_pids[0] && !all_pids[INIT_PID]->matched_by_config) all_pids[0]->target = apps_groups_default_target; // give a default target on all top level processes @@ -3589,6 +3591,13 @@ static void send_collected_data_to_netdata(struct target *root, const char *type } send_END(); + send_BEGIN(type, "rss", dt); + for (w = root; w ; w = w->next) { + if(unlikely(w->exposed && w->processes)) + send_SET(w->name, w->status_vmrss); + } + send_END(); + send_BEGIN(type, "vmem", dt); for (w = root; w ; w = w->next) { if(unlikely(w->exposed && w->processes)) @@ -3728,6 +3737,12 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type } APPS_PLUGIN_FUNCTIONS(); + fprintf(stdout, "CHART %s.rss '' '%s Resident Set Size (w/shared)' 'MiB' mem %s.rss stacked 20004 %d\n", type, title, type, update_every); + for (w = root; w ; w = w->next) { + if(unlikely(w->exposed)) + fprintf(stdout, "DIMENSION %s '' absolute %ld %ld\n", w->name, 1L, 1024L); + } + APPS_PLUGIN_FUNCTIONS(); fprintf(stdout, "CHART %s.vmem '' '%s Virtual Memory Size' 'MiB' mem %s.vmem stacked 20005 %d\n", type, title, type, update_every); for (w = root; w ; w = w->next) { diff --git a/collectors/diskspace.plugin/plugin_diskspace.c b/collectors/diskspace.plugin/plugin_diskspace.c index 81604e2048..915c63c4b7 100644 --- a/collectors/diskspace.plugin/plugin_diskspace.c +++ b/collectors/diskspace.plugin/plugin_diskspace.c @@ -3,7 +3,6 @@ #include "../proc.plugin/plugin_proc.h" #define PLUGIN_DISKSPACE_NAME "diskspace.plugin" -#define THREAD_DISKSPACE_SLOW_NAME "PLUGIN[diskspace slow]" #define DEFAULT_EXCLUDED_PATHS "/proc/* /sys/* /var/run/user/* /run/user/* /snap/* /var/lib/docker/*" #define DEFAULT_EXCLUDED_FILESYSTEMS "*gvfs *gluster* *s3fs *ipfs *davfs2 *httpfs *sshfs *gdfs *moosefs fusectl autofs" @@ -632,7 +631,7 @@ void *diskspace_main(void *ptr) { netdata_thread_create( diskspace_slow_thread, - THREAD_DISKSPACE_SLOW_NAME, + "P[diskspace slow]", NETDATA_THREAD_OPTION_JOINABLE, diskspace_slow_worker, &slow_worker_data); diff --git a/collectors/plugins.d/plugins_d.c b/collectors/plugins.d/plugins_d.c index 34130efff3..e585d237ab 100644 --- a/collectors/plugins.d/plugins_d.c +++ b/collectors/plugins.d/plugins_d.c @@ -271,7 +271,7 @@ void *pluginsd_main(void *ptr) if (cd->enabled) { char tag[NETDATA_THREAD_TAG_MAX + 1]; - snprintfz(tag, NETDATA_THREAD_TAG_MAX, "PLUGINSD[%s]", pluginname); + snprintfz(tag, NETDATA_THREAD_TAG_MAX, "PD[%s]", pluginname); // spawn a new thread for it netdata_thread_create( &cd->thread, tag, NETDATA_THREAD_OPTION_DEFAULT, pluginsd_worker_thread, cd); diff --git a/collectors/proc.plugin/plugin_proc.h b/collectors/proc.plugin/plugin_proc.h index b4fd7b83d4..e8746ba363 100644 --- a/collectors/proc.plugin/plugin_proc.h +++ b/collectors/proc.plugin/plugin_proc.h @@ -8,7 +8,7 @@ #define PLUGIN_PROC_CONFIG_NAME "proc" #define PLUGIN_PROC_NAME PLUGIN_PROC_CONFIG_NAME ".plugin" -#define THREAD_NETDEV_NAME "PLUGIN[proc netdev]" +#define THREAD_NETDEV_NAME "P[proc netdev]" void *netdev_main(void *ptr); int do_proc_net_wireless(int update_every, usec_t dt); diff --git a/collectors/statsd.plugin/statsd.c b/collectors/statsd.plugin/statsd.c index b8a62fb9b1..bd8cee153f 100644 --- a/collectors/statsd.plugin/statsd.c +++ b/collectors/statsd.plugin/statsd.c @@ -2548,7 +2548,7 @@ void *statsd_main(void *ptr) { for(i = 0; i < statsd.threads ;i++) { statsd.collection_threads_status[i].max_sockets = max_sockets / statsd.threads; char tag[NETDATA_THREAD_TAG_MAX + 1]; - snprintfz(tag, NETDATA_THREAD_TAG_MAX, "STATSD_COLLECTOR[%d]", i + 1); + snprintfz(tag, NETDATA_THREAD_TAG_MAX, "STATSD_IN[%d]", i + 1); netdata_spinlock_init(&statsd.collection_threads_status[i].spinlock); netdata_thread_create(&statsd.collection_threads_status[i].thread, tag, NETDATA_THREAD_OPTION_DEFAULT, statsd_collector_thread, &statsd.collection_threads_status[i]); } |