Skip to content

feat(monitoring): add GC stats to CS charts LS-344#752

Merged
GigaCronos merged 2 commits intodevfrom
feat-add-gc-stats-to-chart
Feb 23, 2026
Merged

feat(monitoring): add GC stats to CS charts LS-344#752
GigaCronos merged 2 commits intodevfrom
feat-add-gc-stats-to-chart

Conversation

@GigaCronos
Copy link
Contributor

@GigaCronos GigaCronos commented Feb 17, 2026

This commit introduces a chunkserver-side feature to display Garbage Collector(GC) deletions per minute in the CGI chart of the chunkserver(CS).

When a chunk is moved to the .trash.bin directory(if Garbage Collector is ENABLED) the chunk is marked as deleted and added to chunks deleted stats in the chunkserver. Tracking when the chunk is actually deleted(purged) by the GC is needed for better testing of this feature and more precise information.

@gemini-code-assist
Copy link

Summary of Changes

Hello @GigaCronos, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the chunkserver monitoring capabilities by adding a new chart that visualizes the rate of chunk deletions performed by the Garbage Collector. This provides better insight into the efficiency and activity of the GC process on individual chunkservers, aiding in performance analysis and debugging.

Highlights

  • New Monitoring Chart: Introduced a new chart to display Garbage Collector (GC) purge operations per minute on chunkserver CGI monitoring pages.
  • GC Purge Statistics Tracking: Implemented a mechanism within the HddStats module to track and expose the number of chunk deletions performed by the GC.
  • Integration with Charting System: Integrated the new GC purge statistics into the existing chunkserver charting data refresh logic and CGI interface definitions.
Changelog
  • src/cgi/sfs.cgi.in
    • Added a new entry for 'gcpurge' to the list of chart definitions, associating it with ID 31 and a description 'number of chunk purged by GC per minute'.
  • src/chunkserver/chartsdata.cc
    • Defined CHARTS_GC_PURGE as 31.
    • Incremented CHARTS_NUMBER from 31 to 32 to accommodate the new chart.
    • Added a new chart definition for 'gcpurge' with CHARTS_MODE_ADD.
    • Declared a new uint32_t variable opsGCPurge.
    • Modified the call to HddStats::operationStats to pass &opsGCPurge.
    • Assigned the value of opsGCPurge to data[CHARTS_GC_PURGE].
  • src/chunkserver/chunkserver-common/chunk_trash_manager_impl.cc
    • Included hdd_stats.h.
    • Incremented HddStats::gStatsOperationsGCPurge each time a file is successfully removed from trash by the GC.
  • src/chunkserver/chunkserver-common/hdd_stats.cc
    • Included <cstdint>.
    • Modified the operationStats function signature to accept an additional uint32_t *opsGCPurge parameter.
    • Exchanged the value of gStatsOperationsGCPurge and assigned it to *opsGCPurge.
  • src/chunkserver/chunkserver-common/hdd_stats.h
    • Declared inline std::atomic<uint32_t> gStatsOperationsGCPurge(0);.
    • Updated the operationStats function prototype to include the uint32_t *opsGCPurge parameter.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new chart to the chunkserver monitoring CGI to display the number of chunks purged by the Garbage Collector per minute. The changes are well-contained and correctly implement the new feature by adding a new statistic, tracking it in HddStats, and exposing it through the charting infrastructure. The implementation looks solid. I have a few minor suggestions to improve code formatting for better readability.

@GigaCronos GigaCronos force-pushed the feat-add-gc-stats-to-chart branch from c9a73ad to b22ce6d Compare February 17, 2026 13:13
@GigaCronos GigaCronos self-assigned this Feb 17, 2026
@GigaCronos GigaCronos force-pushed the feat-add-gc-stats-to-chart branch 2 times, most recently from d8bf3cd to 2483a82 Compare February 17, 2026 13:27
@GigaCronos GigaCronos changed the title feat(monitoring): add GC stats to CS charts feat(monitoring): add GC stats to CS charts LS #344 Feb 17, 2026
@GigaCronos GigaCronos changed the title feat(monitoring): add GC stats to CS charts LS #344 feat(monitoring): add GC stats to CS charts LS-344 Feb 17, 2026
@GigaCronos
Copy link
Contributor Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully adds a new chart for monitoring Garbage Collector purges on the chunkserver. The changes are implemented consistently across the C++ backend and the Python CGI script. The core logic looks good.

I've provided a few review comments. One addresses header dependency management. The others suggest reverting some code formatting changes that reduce readability and consistency with the existing codebase.

@GigaCronos GigaCronos marked this pull request as ready for review February 17, 2026 14:01
@GigaCronos GigaCronos force-pushed the feat-add-gc-stats-to-chart branch 2 times, most recently from d5b77ea to 5588ad7 Compare February 18, 2026 10:09
Copy link
Contributor

@ralcolea ralcolea left a comment

Choose a reason for hiding this comment

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

Great job @GigaCronos! 👍

@aNeutrino aNeutrino force-pushed the feat-add-gc-stats-to-chart branch from 5588ad7 to 8a4df76 Compare February 19, 2026 09:51
This commit introduces a chunkserver-side feature to display
Garbage Collector(GC) deletions per minute in the CGI chart of
the chunkserver(CS).

Apply formatting to function" to chartsdata_refresh function.

Signed-off-by: GigaCronos <jorge.cabrera@leil.io>
@GigaCronos GigaCronos force-pushed the feat-add-gc-stats-to-chart branch from 8a4df76 to 0e7e736 Compare February 20, 2026 09:15
@GigaCronos GigaCronos merged commit 50e48c2 into dev Feb 23, 2026
11 checks passed
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.

4 participants