# Wetech CPU Unit Interpretation

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "wetech-cpu-unit-2026-07-22",
  "problems": [
    {
      "problemId": "wetech-process-cpu-percent-reported-as-cores",
      "summary": "A process CPU rate multiplied by 100 can be reported as CPU cores without conversion.",
      "status": "optimized_verified",
      "issueKeys": ["APID-29213"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/APID-29213#problem:ai_gap:cpu-unit"],
      "signalTextIncludesAny": ["713 cores", "728 cores", "CPU 放大 100 倍", "percent reported as cores"],
      "observedThrough": "2026-07-22",
      "effectiveAt": "2026-07-22T05:01:58Z",
      "verifiedAt": "2026-07-22T05:15:00Z",
      "attemptedAction": "Require process_cpu_seconds_total rates to remain in cores unless an explicit percentage scale is reported and converted correctly.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/APID-29213?focusedCommentId=23256901"
    }
  ]
}
-->

- Optimization ID: `wetech-cpu-unit-2026-07-22`
- Owner: auto-oncall
- Source reference: local APID-29213 trial run
- Problem: a query used `rate(process_cpu_seconds_total[5m]) * 100` and the
  generated draft labeled values around 713 and 728 as CPU cores. The values
  were on a one-core percentage scale and required conversion before a cores
  statement.
- Implementation status: deployed to staging in `6d7cc93934d002343c56517cc7a6eaca019bbd54`
- Effective status: `optimized_verified`

## Verification

At `2026-07-22T12:27:50+08:00`, read-only replay
`c5139425-5d74-4158-903b-9eca033ba0f4` queried
`sum by (instance) (rate(process_cpu_seconds_total{job=~".*tidb.*"}[5m]))`
without a `* 100` multiplier. The final draft reported a 24.23-core peak rather
than the prior 100-times-larger value. The CPU-unit contract tests passed.

At `2026-07-22T13:15:00+08:00`, deployed write replay
`f400209a-3471-4b5b-b55c-eba99b58110c` again used cores-native
`rate(process_cpu_seconds_total[5m])` queries with no `* 100` multiplier. The
updated Jira comment reported the peak as approximately 24.2 CPU cores.

## Unresolved gaps

- No unresolved gap remains for this bounded unit-interpretation problem.

## Next validation action

Monitor newer Wetech CPU cases for percent-versus-cores regressions.
