summaryrefslogtreecommitdiffstats
path: root/collectors/tc.plugin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-08-04 08:56:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-08-04 08:56:44 +0000
commit34f488f41ee820371159111bf621f11d0f54f669 (patch)
tree13eea1c3aa3d905ec929691bbf23d8b90bef1dcb /collectors/tc.plugin
parentAdding upstream version 1.16.0. (diff)
downloadnetdata-34f488f41ee820371159111bf621f11d0f54f669.tar.xz
netdata-34f488f41ee820371159111bf621f11d0f54f669.zip
Adding upstream version 1.16.1.upstream/1.16.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/tc.plugin')
-rw-r--r--collectors/tc.plugin/README.md2
-rw-r--r--collectors/tc.plugin/plugin_tc.c34
2 files changed, 16 insertions, 20 deletions
diff --git a/collectors/tc.plugin/README.md b/collectors/tc.plugin/README.md
index e71944e3c..4133b4f8d 100644
--- a/collectors/tc.plugin/README.md
+++ b/collectors/tc.plugin/README.md
@@ -191,7 +191,7 @@ Add the following configuration option in `/etc/netdata.conf`:
Finally, create `/etc/netdata/tc-qos-helper.conf` with this content:
```tc_show="class"```
-Please note, that by default Netdata will enable monitoring metrics only when they are not zero. If they are constantly zero they are ignored. Metrics that will start having values, after netdata is started, will be detected and charts will be automatically added to the dashboard (a refresh of the dashboard is needed for them to appear though). Set `yes` for a chart instead of `auto` to enable it permanently.
+Please note, that by default Netdata will enable monitoring metrics only when they are not zero. If they are constantly zero they are ignored. Metrics that will start having values, after netdata is started, will be detected and charts will be automatically added to the dashboard (a refresh of the dashboard is needed for them to appear though). Set `yes` for a chart instead of `auto` to enable it permanently. You can also set the `enable zero metrics` option to `yes` in the `[global]` section which enables charts with zero metrics for all internal Netdata plugins.
[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Ftc.plugin%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)]()
diff --git a/collectors/tc.plugin/plugin_tc.c b/collectors/tc.plugin/plugin_tc.c
index 1a0ced9a5..50383f4ce 100644
--- a/collectors/tc.plugin/plugin_tc.c
+++ b/collectors/tc.plugin/plugin_tc.c
@@ -382,7 +382,9 @@ static inline void tc_device_commit(struct tc_device *d) {
// --------------------------------------------------------------------
// bytes
- if(d->enabled_bytes == CONFIG_BOOLEAN_YES || (d->enabled_bytes == CONFIG_BOOLEAN_AUTO && bytes_sum)) {
+ if(d->enabled_bytes == CONFIG_BOOLEAN_YES || (d->enabled_bytes == CONFIG_BOOLEAN_AUTO &&
+ (bytes_sum ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
d->enabled_bytes = CONFIG_BOOLEAN_YES;
if(unlikely(!d->st_bytes))
@@ -425,7 +427,9 @@ static inline void tc_device_commit(struct tc_device *d) {
// --------------------------------------------------------------------
// packets
- if(d->enabled_packets == CONFIG_BOOLEAN_YES || (d->enabled_packets == CONFIG_BOOLEAN_AUTO && packets_sum)) {
+ if(d->enabled_packets == CONFIG_BOOLEAN_YES || (d->enabled_packets == CONFIG_BOOLEAN_AUTO &&
+ (packets_sum ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
d->enabled_packets = CONFIG_BOOLEAN_YES;
if(unlikely(!d->st_packets)) {
@@ -478,7 +482,9 @@ static inline void tc_device_commit(struct tc_device *d) {
// --------------------------------------------------------------------
// dropped
- if(d->enabled_dropped == CONFIG_BOOLEAN_YES || (d->enabled_dropped == CONFIG_BOOLEAN_AUTO && dropped_sum)) {
+ if(d->enabled_dropped == CONFIG_BOOLEAN_YES || (d->enabled_dropped == CONFIG_BOOLEAN_AUTO &&
+ (dropped_sum ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
d->enabled_dropped = CONFIG_BOOLEAN_YES;
if(unlikely(!d->st_dropped)) {
@@ -531,7 +537,9 @@ static inline void tc_device_commit(struct tc_device *d) {
// --------------------------------------------------------------------
// tokens
- if(d->enabled_tokens == CONFIG_BOOLEAN_YES || (d->enabled_tokens == CONFIG_BOOLEAN_AUTO && tokens_sum)) {
+ if(d->enabled_tokens == CONFIG_BOOLEAN_YES || (d->enabled_tokens == CONFIG_BOOLEAN_AUTO &&
+ (tokens_sum ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
d->enabled_tokens = CONFIG_BOOLEAN_YES;
if(unlikely(!d->st_tokens)) {
@@ -585,7 +593,9 @@ static inline void tc_device_commit(struct tc_device *d) {
// --------------------------------------------------------------------
// ctokens
- if(d->enabled_ctokens == CONFIG_BOOLEAN_YES || (d->enabled_ctokens == CONFIG_BOOLEAN_AUTO && ctokens_sum)) {
+ if(d->enabled_ctokens == CONFIG_BOOLEAN_YES || (d->enabled_ctokens == CONFIG_BOOLEAN_AUTO &&
+ (ctokens_sum ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
d->enabled_ctokens = CONFIG_BOOLEAN_YES;
if(unlikely(!d->st_ctokens)) {
@@ -874,9 +884,6 @@ void *tc_main(void *ptr) {
uint32_t SETDEVICEGROUP_HASH = simple_hash("SETDEVICEGROUP");
uint32_t SETCLASSNAME_HASH = simple_hash("SETCLASSNAME");
uint32_t WORKTIME_HASH = simple_hash("WORKTIME");
-#ifdef DETACH_PLUGINS_FROM_NETDATA
- uint32_t MYPID_HASH = simple_hash("MYPID");
-#endif
uint32_t first_hash;
snprintfz(command, TC_LINE_MAX, "%s/tc-qos-helper.sh", netdata_configured_primary_plugins_dir);
@@ -1119,17 +1126,6 @@ void *tc_main(void *ptr) {
rrdset_done(sttime);
}
-#ifdef DETACH_PLUGINS_FROM_NETDATA
- else if(unlikely(first_hash == MYPID_HASH && (strcmp(words[0], "MYPID") == 0))) {
- // debug(D_TC_LOOP, "MYPID line '%s'", words[1]);
- char *id = words[1];
- pid_t pid = atol(id);
-
- if(likely(pid)) tc_child_pid = pid;
-
- debug(D_TC_LOOP, "TC: Child PID is %d.", tc_child_pid);
- }
-#endif
//else {
// debug(D_TC_LOOP, "IGNORED line");
//}