我找不到使用Grafana计算SLA(可用性)的正确数学公式: 我有图表显示每天停机的持续时间: 由此,我想计算SLA(例如:99.5%)。
在所选期间(过去7天)的图表上,我可以获得此数据:
如果我有这最后的数据,我会这样做:
(100%* 604800)/ 71258 = X%
100% - X%=我的SLA !!
我的问题是:在Grafana中使用哪个公式来确定选定时间段的持续时间?
答案 0 :(得分:0)
One of the database you can run behind Grafana, is Axibase Time Series Database (ATSD). It provides built-in aggregation functions that can perform SLA-type calculations, for example, to compute % of the period when the value exceeded the threshold.
In your example, that would be THRESHOLD_PERCENT.
Here's a sample SLA report for Amazon Web Services instance: https://apps.axibase.com/chartlab/0aa34311/6/. THRESHOLD_PERCENT is visualized on the top chart.
The API request looks as follows:
{
"queries": [{
"startDate": "2016-02-22T00:00:00Z",
"endDate": "2016-02-23T00:00:00Z",
"timeFormat": "iso",
"entity": "nurswgvml007",
"metric": "app.response_time",
"aggregate": {
"types": [
"THRESHOLD_COUNT",
"THRESHOLD_DURATION",
"THRESHOLD_PERCENT"
],
"period": {
"count": 1,
"unit": "HOUR"
},
"threshold": {
"max": 200
}
}
}]
}
ATSD driver: https://github.com/grafana/grafana-plugins/tree/master/datasources/atsd
Disclosure: I work for Axibase.