summaryrefslogtreecommitdiffstats
path: root/collectors/tc.plugin
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/tc.plugin')
-rw-r--r--collectors/tc.plugin/README.md2
-rw-r--r--collectors/tc.plugin/metrics.csv6
-rw-r--r--collectors/tc.plugin/plugin_tc.c50
3 files changed, 32 insertions, 26 deletions
diff --git a/collectors/tc.plugin/README.md b/collectors/tc.plugin/README.md
index bf8655a4..de5fd474 100644
--- a/collectors/tc.plugin/README.md
+++ b/collectors/tc.plugin/README.md
@@ -4,7 +4,7 @@ custom_edit_url: "https://github.com/netdata/netdata/edit/master/collectors/tc.p
sidebar_label: "tc.plugin"
learn_status: "Published"
learn_topic_type: "References"
-learn_rel_path: "References/Collectors references/Networking"
+learn_rel_path: "Integrations/Monitor/Networking"
-->
# tc.plugin
diff --git a/collectors/tc.plugin/metrics.csv b/collectors/tc.plugin/metrics.csv
new file mode 100644
index 00000000..b8e15649
--- /dev/null
+++ b/collectors/tc.plugin/metrics.csv
@@ -0,0 +1,6 @@
+metric,scope,dimensions,unit,description,chart_type,labels,plugin,module
+tc.qos,"network device, direction",a dimension per class,kilobits/s,"Class Usage",stacked,"device, name, family",tc.plugin,
+tc.qos_packets,"network device, direction",a dimension per class,packets/s,"Class Packets",stacked,"device, name, family",tc.plugin,
+tc.qos_dropped,"network device, direction",a dimension per class,packets/s,"Class Dropped Packets",stacked,"device, name, family",tc.plugin,
+tc.qos_tokens,"network device, direction",a dimension per class,tokens,"Class Tokens",line,"device, name, family",tc.plugin,
+tc.qos_ctokens,"network device, direction",a dimension per class,ctokens,"Class cTokens",line,"device, name, family",tc.plugin, \ No newline at end of file
diff --git a/collectors/tc.plugin/plugin_tc.c b/collectors/tc.plugin/plugin_tc.c
index a8ceca44..b7e493b6 100644
--- a/collectors/tc.plugin/plugin_tc.c
+++ b/collectors/tc.plugin/plugin_tc.c
@@ -478,9 +478,9 @@ static inline void tc_device_commit(struct tc_device *d) {
localhost->rrd_update_every,
d->enabled_all_classes_qdiscs ? RRDSET_TYPE_LINE : RRDSET_TYPE_STACKED);
- rrdlabels_add(d->st_bytes->rrdlabels, "device", string2str(d->id), RRDLABEL_SRC_AUTO);
- rrdlabels_add(d->st_bytes->rrdlabels, "name", string2str(d->name?d->name:d->id), RRDLABEL_SRC_AUTO);
- rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_packets->rrdlabels, "device", string2str(d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_packets->rrdlabels, "name", string2str(d->name?d->name:d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_packets->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
}
else {
if(unlikely(d->name_updated)) {
@@ -490,10 +490,10 @@ static inline void tc_device_commit(struct tc_device *d) {
}
if(d->name && d->name_updated)
- rrdlabels_add(d->st_bytes->rrdlabels, "name", string2str(d->name), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_packets->rrdlabels, "name", string2str(d->name), RRDLABEL_SRC_AUTO);
if(d->family && d->family_updated)
- rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_packets->rrdlabels, "family", string2str(d->family), RRDLABEL_SRC_AUTO);
// TODO
// update the family
@@ -542,9 +542,9 @@ static inline void tc_device_commit(struct tc_device *d) {
localhost->rrd_update_every,
d->enabled_all_classes_qdiscs ? RRDSET_TYPE_LINE : RRDSET_TYPE_STACKED);
- rrdlabels_add(d->st_bytes->rrdlabels, "device", string2str(d->id), RRDLABEL_SRC_AUTO);
- rrdlabels_add(d->st_bytes->rrdlabels, "name", string2str(d->name?d->name:d->id), RRDLABEL_SRC_AUTO);
- rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_dropped->rrdlabels, "device", string2str(d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_dropped->rrdlabels, "name", string2str(d->name?d->name:d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_dropped->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
}
else {
if(unlikely(d->name_updated)) {
@@ -554,10 +554,10 @@ static inline void tc_device_commit(struct tc_device *d) {
}
if(d->name && d->name_updated)
- rrdlabels_add(d->st_bytes->rrdlabels, "name", string2str(d->name), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_dropped->rrdlabels, "name", string2str(d->name), RRDLABEL_SRC_AUTO);
if(d->family && d->family_updated)
- rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_dropped->rrdlabels, "family", string2str(d->family), RRDLABEL_SRC_AUTO);
// TODO
// update the family
@@ -606,9 +606,9 @@ static inline void tc_device_commit(struct tc_device *d) {
localhost->rrd_update_every,
RRDSET_TYPE_LINE);
- rrdlabels_add(d->st_bytes->rrdlabels, "device", string2str(d->id), RRDLABEL_SRC_AUTO);
- rrdlabels_add(d->st_bytes->rrdlabels, "name", string2str(d->name?d->name:d->id), RRDLABEL_SRC_AUTO);
- rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_tokens->rrdlabels, "device", string2str(d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_tokens->rrdlabels, "name", string2str(d->name?d->name:d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_tokens->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
}
else {
if(unlikely(d->name_updated)) {
@@ -618,10 +618,10 @@ static inline void tc_device_commit(struct tc_device *d) {
}
if(d->name && d->name_updated)
- rrdlabels_add(d->st_bytes->rrdlabels, "name", string2str(d->name), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_tokens->rrdlabels, "name", string2str(d->name), RRDLABEL_SRC_AUTO);
if(d->family && d->family_updated)
- rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_tokens->rrdlabels, "family", string2str(d->family), RRDLABEL_SRC_AUTO);
// TODO
// update the family
@@ -671,9 +671,9 @@ static inline void tc_device_commit(struct tc_device *d) {
localhost->rrd_update_every,
RRDSET_TYPE_LINE);
- rrdlabels_add(d->st_bytes->rrdlabels, "device", string2str(d->id), RRDLABEL_SRC_AUTO);
- rrdlabels_add(d->st_bytes->rrdlabels, "name", string2str(d->name?d->name:d->id), RRDLABEL_SRC_AUTO);
- rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_ctokens->rrdlabels, "device", string2str(d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_ctokens->rrdlabels, "name", string2str(d->name?d->name:d->id), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_ctokens->rrdlabels, "family", string2str(d->family?d->family:d->id), RRDLABEL_SRC_AUTO);
}
else {
debug(D_TC_LOOP, "TC: Updating _ctokens chart for device '%s'", string2str(d->name?d->name:d->id));
@@ -685,10 +685,10 @@ static inline void tc_device_commit(struct tc_device *d) {
}
if(d->name && d->name_updated)
- rrdlabels_add(d->st_bytes->rrdlabels, "name", string2str(d->name), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_ctokens->rrdlabels, "name", string2str(d->name), RRDLABEL_SRC_AUTO);
if(d->family && d->family_updated)
- rrdlabels_add(d->st_bytes->rrdlabels, "family", string2str(d->family), RRDLABEL_SRC_AUTO);
+ rrdlabels_add(d->st_ctokens->rrdlabels, "family", string2str(d->family), RRDLABEL_SRC_AUTO);
// TODO
// update the family
@@ -1065,7 +1065,7 @@ void *tc_main(void *ptr) {
// debug(D_TC_LOOP, "SENT line '%s'", words[1]);
if(likely(words[1] && *words[1])) {
- class->bytes = str2ull(words[1]);
+ class->bytes = str2ull(words[1], NULL);
class->updated = true;
}
else {
@@ -1073,10 +1073,10 @@ void *tc_main(void *ptr) {
}
if(likely(words[3] && *words[3]))
- class->packets = str2ull(words[3]);
+ class->packets = str2ull(words[3], NULL);
if(likely(words[6] && *words[6]))
- class->dropped = str2ull(words[6]);
+ class->dropped = str2ull(words[6], NULL);
//if(likely(words[8] && *words[8]))
// class->overlimits = str2ull(words[8]);
@@ -1102,10 +1102,10 @@ void *tc_main(void *ptr) {
// debug(D_TC_LOOP, "TOKENS line '%s'", words[1]);
if(likely(words[1] && *words[1]))
- class->tokens = str2ull(words[1]);
+ class->tokens = str2ull(words[1], NULL);
if(likely(words[3] && *words[3]))
- class->ctokens = str2ull(words[3]);
+ class->ctokens = str2ull(words[3], NULL);
}
else if(unlikely(device && first_hash == SETDEVICENAME_HASH && strcmp(words[0], "SETDEVICENAME") == 0)) {
worker_is_busy(WORKER_TC_SETDEVICENAME);