Bird
0
0

You want to monitor latency for multiple steps and store results in a dictionary. Which approach correctly updates latency after each step?

hard📝 Workflow Q8 of 15
Agentic AI - Agent Observability
You want to monitor latency for multiple steps and store results in a dictionary. Which approach correctly updates latency after each step?
AUse a list instead of dictionary to store latencies
BStore start time only once before all steps, then subtract from current time after each step
CRecord start time before step, end time after step, then store difference in dictionary
DAdd all step durations together and store as one value
Step-by-Step Solution
Solution:
  1. Step 1: Understand per-step latency measurement

    Each step needs its own start and end time to measure duration.
  2. Step 2: Correct way to store latencies

    Calculate difference per step and store in dictionary with step keys.
  3. Final Answer:

    Record start time before step, end time after step, then store difference in dictionary -> Option C
  4. Quick Check:

    Per-step timing requires start and end per step [OK]
Quick Trick: Measure start and end time for each step separately [OK]
Common Mistakes:
  • Using one start time for all steps
  • Summing durations instead of per-step
  • Confusing list vs dictionary for step keys

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes