Jenkins Job Status
The `Jenkins Job Status` dashboard presents job n build data from Jenkins
## Quick start with `docker`
Run command below (edit env):
```
docker run -d \
-eJENKINS_URL='http://192.168.3.100:8080' \
-eJENKINS_USER='admin' \
-eJENKINS_PASSWORD='MqU9Czz8T...' \
-eINFLUX_TOKEN="KlXfBqa0uSGs0icfE-3g8FsQAoC9..." \
-eINFLUX_DB="http://192.168.3.101:8086" \
-eINFLUX_ORG="org" \
-eBUCKET_NAME="jenkins_test" \
return200/jenkins-collector:0.1.0 
```
## Cronjob is set " 0 0 * * * " current.
```
cat crontab
# START CRON JOB
0 0 * * * /usr/local/bin/python3 /jenkins_collector/main.py > /proc/1/fd/1 2>/proc/1/fd/2
# END CRON JOB
```
## Run collector by manual
```
/usr/local/bin/python3 /jenkins_collector/main.py
```
## Check data in influx
## Config datasource
## Import dashboard in grafana

Provides build health stats for each repo in an org
{
  "__inputs": [
    {
      "name": "DS_INFLUXDB",
      "label": "InfluxDB",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "bargauge",
      "name": "Bar Gauge",
      "version": ""
    },
    {
      "type": "panel",
      "id": "btplc-trend-box-panel",
      "name": "Trend Box",
      "version": "0.1.9"
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.2.5"
    },
    {
      "type": "panel",
      "id": "grafana-piechart-panel",
      "name": "Pie Chart",
      "version": "1.3.6"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "The `Jenkins Job Status` dashboard presents job n build data from Jenkins",
  "editable": true,
  "gnetId": 17718,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1563415769982,
  "links": [],
  "panels": [
    {
      "aliasColors": {
        "Failed": "#f53636",
        "Interruped": "#ed8128",
        "Passed": "#32ac2d"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_INFLUXDB}",
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 8,
        "w": 7,
        "x": 0,
        "y": 0
      },
      "id": 11,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": false,
        "values": true
      },
      "legendType": "Under graph",
      "links": [],
      "maxDataPoints": 3,
      "nullPointMode": "connected",
      "options": {},
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "alias": "Passed",
          "groupBy": [],
          "measurement": "job",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "jobtime"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            },
            {
              "condition": "AND",
              "key": "result",
              "operator": "=",
              "value": "CompletedSuccess"
            }
          ]
        },
        {
          "alias": "Failed",
          "groupBy": [],
          "measurement": "job",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "jobtime"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            },
            {
              "condition": "AND",
              "key": "result",
              "operator": "=",
              "value": "CompletedError"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Overall",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_INFLUXDB}",
      "format": "short",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 7,
        "y": 0
      },
      "id": 2,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "repeat": null,
      "repeatDirection": "h",
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "groupBy": [],
          "measurement": "job",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "jobtime"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "thresholds": "",
      "title": "Total Build",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_INFLUXDB}",
      "format": "s",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 12,
        "y": 0
      },
      "id": 4,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "groupBy": [],
          "measurement": "job",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "jobtime"
                ],
                "type": "field"
              },
              {
                "params": [
                  " / 1000"
                ],
                "type": "math"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "thresholds": "",
      "title": "Avg Build Duration",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_INFLUXDB}",
      "gridPos": {
        "h": 4,
        "w": 7,
        "x": 17,
        "y": 0
      },
      "id": 18,
      "links": [],
      "options": {
        "displayMode": "lcd",
        "fieldOptions": {
          "calcs": [
            "last"
          ],
          "defaults": {
            "decimals": 2,
            "max": 1,
            "min": 0,
            "title": "",
            "unit": "percentunit"
          },
          "mappings": [],
          "override": {},
          "thresholds": [
            {
              "color": "green",
              "index": 0,
              "value": null
            },
            {
              "color": "red",
              "index": 1,
              "value": 80
            }
          ],
          "values": false
        },
        "orientation": "horizontal"
      },
      "targets": [
        {
          "alias": "Passed",
          "groupBy": [],
          "measurement": "tests",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "passed"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  " / (passed + skipped + failed)"
                ],
                "type": "math"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        },
        {
          "alias": "Skipped",
          "groupBy": [],
          "measurement": "tests",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "skipped"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  " / (passed + skipped + failed)"
                ],
                "type": "math"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        },
        {
          "alias": "Failed",
          "groupBy": [],
          "measurement": "tests",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "C",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "failed"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  " / (passed + skipped + failed)"
                ],
                "type": "math"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Latest Unit Test Result",
      "type": "bargauge"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorPrefix": false,
      "colorValue": false,
      "colors": [
        "#f53636",
        "rgba(237, 129, 40, 0.89)",
        "#32ac2d"
      ],
      "datasource": "${DS_INFLUXDB}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 7,
        "y": 4
      },
      "id": 9,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "repeatDirection": "h",
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "groupBy": [],
          "measurement": "job",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "passed"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "thresholds": "0.5,1",
      "title": "Latest Build",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        },
        {
          "op": "=",
          "text": "Failed",
          "value": "0"
        },
        {
          "op": "=",
          "text": "Passed",
          "value": "1"
        }
      ],
      "valueName": "current"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "decimals": 2,
      "defaultColor": "rgb(117, 117, 117)",
      "description": "This graph shows the percentage change of build duration between the latest run and the first one. The graph will be green if value <= 0; yellow if 0 < value <= 25; and red if value > 25",
      "displayValue": "value",
      "format": "ms",
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 12,
        "y": 4
      },
      "id": 16,
      "linkIndex": "0",
      "links": [],
      "numberSize": "14px",
      "options": {},
      "percentSize": "30px",
      "targets": [
        {
          "groupBy": [],
          "measurement": "job",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "jobtime"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "thresholds": [
        {
          "color": "#f53636",
          "value": "25"
        },
        {
          "color": "#ed8128",
          "value": "1"
        },
        {
          "color": "#32ac2d",
          "value": "-100"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Duration Trend",
      "titleSize": "13px",
      "type": "btplc-trend-box-panel"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_INFLUXDB}",
      "gridPos": {
        "h": 4,
        "w": 7,
        "x": 17,
        "y": 4
      },
      "id": 24,
      "links": [],
      "options": {
        "displayMode": "lcd",
        "fieldOptions": {
          "calcs": [
            "last"
          ],
          "defaults": {
            "decimals": 1,
            "max": 100,
            "min": 0,
            "title": "",
            "unit": "percent"
          },
          "mappings": [],
          "override": {},
          "thresholds": [
            {
              "color": "red",
              "index": 0,
              "value": null
            },
            {
              "color": "#EAB839",
              "index": 1,
              "value": 60
            },
            {
              "color": "green",
              "index": 2,
              "value": 85
            }
          ],
          "values": false
        },
        "orientation": "horizontal"
      },
      "targets": [
        {
          "alias": "Classes",
          "groupBy": [],
          "measurement": "coverage",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "classes"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        },
        {
          "alias": "Lines",
          "groupBy": [],
          "measurement": "coverage",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "lines"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        },
        {
          "alias": "Branches",
          "groupBy": [],
          "measurement": "coverage",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "C",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "conditionals"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Latest Coverage Result",
      "type": "bargauge"
    },
    {
      "columns": [],
      "datasource": "${DS_INFLUXDB}",
      "fontSize": "100%",
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "id": 14,
      "links": [],
      "options": {},
      "pageSize": 5,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "Build",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "Click to go to Jenkins",
          "linkUrl": "https://jenkins.example.com/${__cell_4:raw}",
          "mappingType": 1,
          "pattern": "job.jobname",
          "preserveFormat": false,
          "sanitize": false,
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "Result",
          "colorMode": "row",
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "job.passed",
          "thresholds": [
            "0.5",
            "1"
          ],
          "type": "string",
          "unit": "short",
          "valueMaps": [
            {
              "text": "Passed",
              "value": "1"
            },
            {
              "text": "Failed",
              "value": "0"
            }
          ]
        },
        {
          "alias": "Duration",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "job.jobtime",
          "thresholds": [],
          "type": "number",
          "unit": "ms"
        },
        {
          "alias": "Link",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "job.joburl",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "Cause",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "job.trigger",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "groupBy": [],
          "measurement": "job",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "time"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "jobname"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "trigger"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "jobtime"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "joburl"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "passed"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Detail",
      "transform": "timeseries_to_columns",
      "type": "table"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 15
      },
      "id": 20,
      "panels": [],
      "title": "Duration",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_INFLUXDB}",
      "fill": 1,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 16
      },
      "id": 8,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": false,
        "total": false,
        "values": false
      },
      "lines": false,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {},
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "#$tag_buildnumber",
          "groupBy": [
            {
              "params": [
                "buildnumber"
              ],
              "type": "tag"
            }
          ],
          "measurement": "job",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "jobtime"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Build Duration",
      "tooltip": {
        "shared": false,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "series",
        "name": null,
        "show": true,
        "values": [
          "total"
        ]
      },
      "yaxes": [
        {
          "format": "ms",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_INFLUXDB}",
      "fill": 1,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 23
      },
      "id": 12,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": false,
        "total": false,
        "values": false
      },
      "lines": false,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {},
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "alias": "$tag_stagename - #$tag_jobname",
          "groupBy": [
            {
              "params": [
                "stagename"
              ],
              "type": "tag"
            },
            {
              "params": [
                "jobname"
              ],
              "type": "tag"
            }
          ],
          "measurement": "stage",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "stagetime"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "jobname"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Stage Duration",
      "tooltip": {
        "shared": false,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "series",
        "name": null,
        "show": false,
        "values": [
          "total"
        ]
      },
      "yaxes": [
        {
          "format": "ms",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 30
      },
      "id": 22,
      "panels": [],
      "title": "Unit Test",
      "type": "row"
    },
    {
      "columns": [],
      "datasource": "${DS_INFLUXDB}",
      "fontSize": "100%",
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 31
      },
      "id": 17,
      "links": [],
      "options": {},
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "Build",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 2,
          "pattern": "tests.jobname",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Passed",
          "colorMode": "row",
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "tests.passed_passed_skipped_failed",
          "thresholds": [
            "75",
            "90"
          ],
          "type": "number",
          "unit": "percentunit"
        },
        {
          "alias": "Skipped",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "tests.skipped_passed_skipped_failed",
          "thresholds": [],
          "type": "number",
          "unit": "percentunit"
        },
        {
          "alias": "Failed",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "tests.failed_passed_skipped_failed",
          "thresholds": [],
          "type": "number",
          "unit": "percentunit"
        }
      ],
      "targets": [
        {
          "alias": "",
          "groupBy": [],
          "measurement": "tests",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "jobname"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "passed"
                ],
                "type": "field"
              },
              {
                "params": [
                  " / (passed + skipped + failed)"
                ],
                "type": "math"
              }
            ],
            [
              {
                "params": [
                  "skipped"
                ],
                "type": "field"
              },
              {
                "params": [
                  " /  (passed + skipped + failed)"
                ],
                "type": "math"
              }
            ],
            [
              {
                "params": [
                  "failed"
                ],
                "type": "field"
              },
              {
                "params": [
                  "  / (passed + skipped + failed)"
                ],
                "type": "math"
              }
            ]
          ],
          "tags": [
            {
              "key": "owner",
              "operator": "=~",
              "value": "/^$folder$/"
            },
            {
              "condition": "AND",
              "key": "repo",
              "operator": "=~",
              "value": "/^$job$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Unit Test Result",
      "transform": "timeseries_to_columns",
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 18,
  "style": "dark",
  "tags": [
    "devops",
    "jenkins",
    "dev",
    "in-progress"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_INFLUXDB}",
        "definition": "SHOW TAG VALUES FROM job WITH KEY = \"owner\"",
        "hide": 0,
        "includeAll": false,
        "label": "Folder",
        "multi": false,
        "name": "folder",
        "options": [],
        "query": "SHOW TAG VALUES FROM job WITH KEY = \"owner\"",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_INFLUXDB}",
        "definition": "SHOW TAG VALUES FROM job WITH KEY = repo WHERE \"owner\" =~ /^($folder)$/",
        "hide": 0,
        "includeAll": false,
        "label": "Job",
        "multi": false,
        "name": "job",
        "options": [],
        "query": "SHOW TAG VALUES FROM job WITH KEY = repo WHERE \"owner\" =~ /^($folder)$/",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-7d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Jenkins Job Status",
  "uid": "000000005",
  "version": 65
}