Skip to content

BUG-44: GET /admin/kpi gives walBytes as a text, not a number #173

Closed

Description

@ephico2real2

Part of #16

What is wrong: GET /api/v1/admin/kpi returns database.walBytes as a JSON text, for example "83886080". The other figures are numbers. PostgreSQL's sum(size) is a numeric, and the code passed it on as it came.

Where: cmapi/src/cmapi/core/kpi.py, database_figures, the query on pg_ls_waldir().

How to prove it: The recorded sample admin_kpi in cmapi/src/cmapi/contract/samples.json has "walBytes": "83886080". A test asserts that each figure of database is a number or null.

Measured or inferred: Measured on 2026-11-13 in the recorded sample of the service suite, PostgreSQL 16 on 127.0.0.1:55432.

Severity: Low.

What must hold after the fix: walBytes and sizeBytes are integers. The response model KpiDatabase types each figure, so another text fails the response validation.

Research: docs/17-kpis.md has the definitions and their sources.

Solution (inline, not applied): Not written here. Where the tag is In-Progress, the fix is on branch kpis.

Class: No class. The fix corrects a type.

Activity

  1. added
    bug
    status:open
    sev:low
    In-Progress
    on Nov 13, 2026
  2. added
    In-QA
    and removed
    In-Progress
    on Nov 13, 2026
  3. ephico2real2 commented on Nov 13, 2026

    @ephico2real2
    OwnerAuthor

    In-QA: pull request #177 closes this issue. Its tests failed before the change and pass after it; GitHub's checks on its head were not read yet when this was written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-QAbugsev:lowstatus:open

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions