Obv. I'm new to InfluxDB & the Flux query language so appreciate patience! Happy to be redirected to documentation but I haven't found anything genuinely useful to date.
I've configured Jenkins (2.277.3) to push build metrics to InfluxDB (Version 2.0.5 ('7c3ead)) using plugin (https://plugins.jenkins.io/influxdb/). No custom metrics at the moment. Data is being successfully sent.
I'd like to build a simple bar chart to show build times for a specific project. Each "bar" would be an individual build (with a distinct build number). Also:
- X-axis, date/time of build
- Y-axis, duration of build
- (Ideally bars would be green/red to indicate success/anything else and would be labelled with job number. In time I'd like to add an overlay with average build time.)
I'm trying to create the query(ies) to support this view:
from(bucket: "db0")
|> range(start: -2d)
|> filter(fn: (r) => r["project_name"] == "Job2")
|> filter(fn: (r) => r._measurement == "jenkins_data" and r._field == "build_time" )
This results in 2 tables in the Table view, one for build SUCCESS and one for build FAILURE. Can someone explain to be why this is the case, and whether I'm missing some fundamental understanding of how to use the tool?