#
Failure times
The mantra fail fast from DevOps culture is about encouraging early failure modes to avoid sitting around waiting for feedback. One of the few ways to improve, is to track how long failures take.
This data allows you to observe just that.
You will have to query and get an id for an 'Azure/Jenkins' integration to get time to failure.
Given an id for an integration (with type Azure or Jenkins), you can query failure times like so:
curl -H "X-API-Key: <your token goes here>" \
https://api.accidentalquality.com/api/failure_times/<integration_id>
fetch('https://api.accidentalquality.com/api/failure_times/<integration_id>', {
method: "GET",
headers: {"Content-type": "application/json;charset=UTF-8", "X-API-Key": "<your-token-goes-here>"}
})
.then(response => response.json())
.then(json => console.log(json))
.catch(err => console.log(err));
The data returned is in json format and structured as follows:
- unit (string) - Unit of the data displayed in the data array
- data (array)
- x string - Date for the datapoint in format yyyy-mm-dd
- y integer - Value for the datapoint in seconds
There can be multiple datapoints for the same day if a pipeline ran multiple times that day.
Example:
{
"unit":"Date/seconds",
"data": [
{
"x": "1990-01-01",
"y": 123
},
{
"x": "1990-01-01",
"y": 321
},
...
]
}
Note that the structure of data is the same as for cycle times and repair times so you can reuse code between these three.