#
Cycle times
Cycle times for pipelines is one of the primary indicators of the state of your software tech debt, and growing pipeline times should be regarded with great suspicion - usually it's indicative of an underlying issue.
You will have to query and get an id for an 'Azure/Jenkins' integration to get cycle times.
Given an id for an integration (with type Azure or Jenkins), you can query cycle times like so:
curl -H "X-API-Key: <your token goes here>" \
https://api.accidentalquality.com/api/cycle_times/<integration_id>
fetch('https://api.accidentalquality.com/api/cycle_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 repair times and failure times so you can reuse code between these three.