0
0
MLOpsdevops~10 mins

Alert thresholds and policies in MLOps - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the alert threshold to 80%.

MLOps
alert_threshold = [1]
Drag options to blanks, or click blank then click option'
A80
B60
C90
D70
Attempts:
3 left
💡 Hint
Common Mistakes
Using a value lower than 80 causes alerts too early.
Using a value higher than 80 delays alerts.
2fill in blank
medium

Complete the code to define the alert policy name as 'High CPU Usage'.

MLOps
alert_policy_name = '[1]'
Drag options to blanks, or click blank then click option'
ALow Memory
BNetwork Latency
CDisk Full
DHigh CPU Usage
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing unrelated policy names.
Forgetting to use quotes around the string.
3fill in blank
hard

Fix the error in the alert condition to check if CPU usage is greater than the threshold.

MLOps
if cpu_usage [1] alert_threshold:
Drag options to blanks, or click blank then click option'
A==
B<=
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using less than operator causes alerts to trigger incorrectly.
Using equality operator misses cases where usage is higher.
4fill in blank
hard

Fill both blanks to create a policy that triggers when memory usage is above 75% and duration is over 5 minutes.

MLOps
if memory_usage [1] 75 and duration [2] 5:
Drag options to blanks, or click blank then click option'
A>
B<
C>=
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using less than operators causes the policy to trigger incorrectly.
Using strict greater than for duration misses exact 5 minutes.
5fill in blank
hard

Fill both blanks to define an alert dictionary with keys 'metric', 'threshold', and 'policy'.

MLOps
alert = {
    '[1]': 'cpu_usage',
    '[2]': 80
}
Drag options to blanks, or click blank then click option'
A{
Bmetric
Cthreshold
Dpolicy
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong keys like 'policy' instead of 'threshold'.
Missing the opening brace '{' for the dictionary.