How is an SLI calculated?
SLIs are simply calculated as the percentage of total events that are considered acceptable. If you are measuring the total number of HTTP requests that are completed successfully, the formula for the corresponding SLI would be:
(successful requests / total requests) x 100
Similarly, consider an SLI that is designed to measure whether a server is becoming too slow. The organization would set a minimum bar for latency — say, 400 milliseconds — and would calculate the SLI as such:
(requests completed in less than 400 milliseconds / total requests) x 100
Any SLI must be calculated over a given amount of time, such as every minute, over the course of an hour or over an entire month. SLOs are commonly stated with fairly lengthy terms. For example, Amazon Compute services promise a minimum of 95% monthly uptime; if the service doesn’t meet this bar, customers are due a 100% credit on their bill. Evaluating an SLI over a shorter time period can be useful in troubleshooting problems, but for the purposes of ensuring SLA compliance, the organization will also need to consider an SLI with a longer time frame.