Skip to content

Lab · DevOps: Git, Docker, Kubernetes and CI/CD

Lab: DORA metrics for a UPI app team

Labbeginner· about 1.5 hours· 5 steps

The brief

The PayKaro UPI app team wants to know if its delivery is getting better. You turn two weeks of its pipeline export into the four DORA keys (deployment frequency, lead time for changes, change failure rate and time to restore) and a one-line report for the weekly review.

Why it matters

DevOps engineers and engineering managers are asked "are we getting faster and safer?" and must answer with numbers, not feelings. Teams at Indian fintechs and product companies export exactly this data from Jenkins, GitHub Actions or Argo CD and track the DORA keys every sprint. Writing the script yourself also teaches you what each number really means.

Skills you practise

  • the four DORA keys
  • parsing CSV text
  • datetime differences
  • median and mean
  • percentages and rounding

What you will have at the end

dora.py, which turns a pipeline export into the four DORA keys and a one-line weekly report, with a short note on what the PayKaro team should improve first.

How it is marked (rubric, 100 points)
Correct metricsEvery check passes, including the empty and zero cases.50
Right definitionsMedian for lead time, production deployments only, and restore time averaged over failed deployments only.20
Readable codeSmall functions with clear names; the report reuses them instead of repeating the maths.15
InterpretationYou can say which key is the weakest (a 25% change failure rate) and one practice that would improve it.15

0/5 steps done

Step 1 of 5

Read the pipeline export

parse_log(LOG) returns 8 dicts with id, committed and deployed (datetimes), failed (True/False) and restore (a whole number).

Real pipeline exports are text: one header line, then one line per deployment, with commas between fields. Skip the header, ignore blank lines, and split each line on the commas. Convert each field to the right type, because you cannot subtract two strings or add up "45" and "15".

datetime.fromisoformat() reads times written like 2026-10-01T09:00. failed is "yes" or "no" in the file; store it as True or False.

Run shows what your code prints. Check runs the step's tests. Ctrl+Enter checks too.