Skip to content

fix(agent): measure disk usage within the server data volume - #946

Open
Baylem wants to merge 4 commits into
masterfrom
fix/measure-server-volume-usage
Open

Baylem wants to merge 4 commits into
masterfrom
fix/measure-server-volume-usage

Conversation

@Baylem

@Baylem Baylem commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Report storage for each server from its data directory. Kernel CephFS can supply recursive usage and a directory quota. Other filesystems use a time- and entry-bounded background scan that counts allocated blocks and hard links once, excludes nested mounts, and keeps the heartbeat responsive. The dashboard labels the requested claim size when observed capacity is unavailable.

Verified the Linux usage, heartbeat, and Prometheus suites, the Overview suite, TypeScript, and Go vet. A private Linux mount namespace exercised a real bind mount on the same device. Provider counter tests cover known zero, absent quota, and unavailable attributes. Ten consecutive Linux usage-suite runs passed. The agent covered 128 of 133 changed lines (96.2%). Both updated Overview screens passed the browser-to-Pencil comparison and pseudo-locale clipping checks. Live CephFS validation remains outstanding.

Closes #937.

Signed-off-by: Baylem <zelathis@gmail.com>
@Baylem
Baylem requested a review from ValgulNecron as a code owner November 12, 2026 05:26
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 17 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e3826d8 and 72499b9.

Files ignored due to path filters: 3

  • assets/design-export/screenshots/EZFW0.png is excluded by !**/*.png
  • assets/design-export/screenshots/TE2jI.png is excluded by !**/*.png
  • design.pen is excluded by !**/*.pen
Files selected for processing: 39

  • agent/cmd/main.go
  • agent/internal/heartbeat/heartbeat.go
  • agent/internal/heartbeat/heartbeat_test.go
  • agent/internal/metrics/metrics.go
  • agent/internal/metrics/metrics_test.go
  • agent/internal/usage/disk.go
  • agent/internal/usage/disk_test.go
  • agent/internal/usage/usage.go
  • agent/internal/usage/usage_test.go
  • agent/specs.md
  • assets/design-export/MANIFEST.md
  • assets/design-export/json/EZFW0.json
  • assets/design-export/json/TE2jI.json
  • changelog/unreleased/937-server-volume-usage.md
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml
  • charts/gameplane/crd-manifests/gameplane.local_backups.yaml
  • charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml
  • charts/gameplane/crd-manifests/gameplane.local_clusters.yaml
  • charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml
  • charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml
  • charts/gameplane/crd-manifests/gameplane.local_modules.yaml
  • charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml
  • charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml
  • charts/gameplane/crd-manifests/gameplane.local_restores.yaml
  • i18n/locales/en/app.json
  • operator/api/v1alpha1/gameserver_types.go
  • operator/config/crd/gameplane.local_gameservers.yaml
  • web/e2e/screenshots/slice2a.spec.ts
  • web/src/routes/tabs/Overview.test.tsx
  • web/src/routes/tabs/Overview.tsx
  • web/src/test/handlers.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Baylem Baylem self-assigned this Nov 12, 2026
Signed-off-by: Baylem <zelathis@gmail.com>

@Baylem Baylem left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the storage sampler, heartbeat and dashboard through 49f61e05. The sampler uses the server directory, excludes nested mounts and handles sparse files, hard links and files that disappear during a scan. Capacity stays unknown when there is no measured quota. The follow-up fixes sample expiration at the deadline and exercises cancellation and retries.

Verification included ten consecutive Linux usage-suite passes, 128 of 133 changed agent lines covered (96.2%), the agent lint configuration, dashboard coverage and the updated Pencil screens. Linux tests exercised a same-device bind mount in a private mount namespace. The quota reader was tested with real filesystem attributes and representative CephFS values. A live CephFS deployment remains unverified.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

CI Report - 49f61e0

run 43164141097 - attempt 1

0 failed - 1 passed - 3 skipped - 29 cancelled - 6m39s elapsed

Test selection: partial - per-suite table

Coverage

no coverage/* commit statuses found on 49f61e0

Changed

Area Files +/-
agent/ 10 +614/-112
charts/ 18 +22/-22
web/ 4 +37/-7
assets/ 5 +20/-8
(root) 1 +18/-9
operator/ 2 +4/-4
i18n/ 1 +4/-0
changelog/ 1 +3/-0

Slowest jobs

Job Duration
move parity (spec 028) 6m39s
telemetry default gate 6m39s
docs and repository checks 1m35s
capture-sidecar CAP_NET_RAW survival 1m35s
build e2e images (arm64) 1m35s

e2e buckets run

bot-fast, multicluster, upgrade

Signed-off-by: Baylem <zelathis@gmail.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report per-server storage usage accurately on shared filesystems

1 participant