0
0
MLOpsdevops~30 mins

Platform observability and SLAs in MLOps - Mini Project: Build & Apply

Choose your learning style9 modes available
Platform Observability and SLAs
📖 Scenario: You work as a DevOps engineer for a machine learning platform team. Your team wants to monitor the platform's health by tracking service uptime and response times. They also want to check if the platform meets the agreed Service Level Agreements (SLAs).SLAs require the platform to have at least 99% uptime and average response time below 200 milliseconds.
🎯 Goal: Build a simple Python script that stores platform metrics, sets SLA thresholds, calculates uptime and average response time, and prints whether the platform meets the SLAs.
📋 What You'll Learn
Create a dictionary with exact platform metrics data
Add SLA threshold variables for uptime and response time
Calculate uptime percentage and average response time using loops
Print the SLA compliance results exactly as specified
💡 Why This Matters
🌍 Real World
Monitoring platform health and ensuring it meets SLAs is critical for reliable machine learning services.
💼 Career
DevOps engineers and MLOps specialists use observability and SLA checks daily to maintain service quality.
Progress0 / 4 steps
1
Create platform metrics data
Create a dictionary called platform_metrics with these exact entries: 'uptime_minutes': [1440, 1430, 1420, 1440, 1435] and 'response_times_ms': [180, 210, 190, 170, 200].
MLOps
Need a hint?

Use a dictionary with two keys: 'uptime_minutes' and 'response_times_ms'. Each key should have a list of integers as values.

2
Add SLA threshold variables
Add two variables: sla_uptime_threshold set to 99.0 and sla_response_time_threshold set to 200.
MLOps
Need a hint?

Set sla_uptime_threshold to 99.0 (percent) and sla_response_time_threshold to 200 (milliseconds).

3
Calculate uptime percentage and average response time
Calculate the total possible uptime minutes as 1440 * 5. Calculate the actual uptime by summing platform_metrics['uptime_minutes']. Calculate uptime_percentage as (actual uptime / total possible uptime) * 100. Calculate average_response_time as the average of platform_metrics['response_times_ms']. Use for loops with variables minute and time to sum the lists.
MLOps
Need a hint?

Use for loops to sum the uptime and response times. Then calculate percentages and averages.

4
Print SLA compliance results
Print two lines exactly as follows: print(f"Uptime meets SLA: {uptime_percentage >= sla_uptime_threshold}") and print(f"Response time meets SLA: {average_response_time <= sla_response_time_threshold}").
MLOps
Need a hint?

Use print statements with f-strings to show if uptime and response time meet SLA thresholds.