A team is instrumenting function duration and must include failures in the measured distribution. What is the best placement of observation logic?

Published
  1. Observe only after successful return
  2. Increment the duration counter before the function starts with a guessed value
  3. Measure elapsed time and observe it on both successful and exceptional completion paths
  4. Record the start timestamp as the elapsed duration

Comments — 0