Skip to content

Storage/Health: improve the per-partition health dotΒ #53

Description

@adelfardi

Context

In a table's Storage & Health tab, each partition shows a colored dot (🟒/🟠/πŸ”΄). It is computed on the frontend by partitionTone(p) β†’ computeStorageHealthStatus(...) in frontend/src/pages/TableDetail.tsx, reusing the global health logic on each partition's own numbers.

Current checks (worst tone wins):

Check Formula warn bad
Avg size vs target (avgVsTarget) avgFileSize / targetFileSize Γ— 100 < 90% < 50%
Small-files ratio (smallRatio) smallFileCount / dataFiles Γ— 100 > 20% > 50%
Delete-files ratio (deleteRatio) deleteFiles / (dataFiles + deleteFiles) Γ— 100 > 10% > 30%
Needs compaction dataFiles > 1 AND avgFileSize < targetFileSize Γ— 50% β†’ warn β€”

Thresholds come from the Storage health thresholds (Settings), falling back to DEFAULT_HEALTH_THRESHOLDS. targetFileSizeBytes is the table's value.

Changes to implement

1. Don't penalize avgVsTarget when dataFiles ≀ 1

A partition with a single file smaller than the target is flagged warn/bad on the avgVsTarget check, even though compaction would do nothing (a lone file can't be merged). The dataFiles > 1 guard already exists for the compaction check but not for avgVsTarget.

Proposal: skip (or force to good) the avgVsTarget check when dataFiles ≀ 1, to avoid false positives on small, healthy partitions.

2. Show the calculation breakdown on hover

Add a tooltip on the dot that lists each evaluated check, its value (%) and its verdict (good/warn/bad), so it's clear why a partition is orange/red β€” today the title only says "Needs attention / Could be optimized / Healthy".

Notes / out of scope (to discuss)

  • Per-partition health uses the global thresholds and the table targetFileSizeBytes β€” no per-partition tuning. Could be considered later.

Affected file: frontend/src/pages/TableDetail.tsx (partitionTone, computeStorageHealthStatus, dot rendering ~L2500).

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions