Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Added tags support for influxDB reporting #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ Enable the plugin by adding it in your test script's `config.plugins` section:
"statsd": {
"host": "localhost",
"port": 8125,
"prefix": "artillery"
"prefix": "artillery",
"influx_tags": { // optional: reports to influxDB will be tagged with those tags
"tag1": "value1",
"tag2": "value2",
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ function StatsDPlugin(rawConfig, ee) {

l.each(flattenedStats, function(value, name) {
debug('Reporting: '+name+' '+value)
metrics.gauge(config.prefix+'.'+name, value || config.defaultValue);
var tagString = _.reduce(config.influx_tags, (result, tagValue, tagName) => {
result += ',' + tagName + "=" + tagValue;
return result;
}, "");
metrics.gauge(config.prefix+'.'+name + tagString, value || config.defaultValue);
});

});
Expand Down