Bird
Raised Fist0
Agentic AIml~10 mins

Latency monitoring per step in Agentic AI - Interactive Code Practice

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

Complete the code to start measuring latency before a step.

Agentic AI
start_time = [1]()
Drag options to blanks, or click blank then click option'
Atime.time
Btime.sleep
Ctime.now
Dtime.measure
Attempts:
3 left
💡 Hint
Common Mistakes
Using time.sleep instead of time.time
Using a non-existent function like time.now
2fill in blank
medium

Complete the code to calculate latency after a step finishes.

Agentic AI
latency = [1]() - start_time
Drag options to blanks, or click blank then click option'
Atime.time
Btime.sleep
Ctime.clock
Dtime.measure
Attempts:
3 left
💡 Hint
Common Mistakes
Using time.sleep which pauses execution
Using time.clock which is deprecated
3fill in blank
hard

Fix the error in the code to correctly measure latency for a step.

Agentic AI
end_time = time.time()
latency = end_time - [1]
Drag options to blanks, or click blank then click option'
Astarttime
BstartTime
Cstart_time
Dstarttime_
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name with wrong capitalization
Using a variable name that was never defined
4fill in blank
hard

Fill both blanks to create a dictionary that stores latency per step name.

Agentic AI
latency_per_step = { [1]: [2] }
Drag options to blanks, or click blank then click option'
A'step_name'
Blatency
Cstep
Dtime
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable instead of a string for the key
Using an incorrect variable for the latency value
5fill in blank
hard

Fill all three blanks to update latency for a step in a monitoring dictionary.

Agentic AI
latency_per_step[[1]] = [2] - [3]
Drag options to blanks, or click blank then click option'
A'step1'
Bend_time
Cstart_time
D'step_name'
Attempts:
3 left
💡 Hint
Common Mistakes
Using variables instead of strings for dictionary keys
Subtracting in the wrong order