Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance GetPoolStats() Method to Include Num_bytes_available Field in PoolStat #922

Open
sujeet01 opened this issue Sep 25, 2023 · 2 comments

Comments

@sujeet01
Copy link

Description

Currently, the "github.com/ceph/go-ceph/rados" Go library provides a convenient way to interact with Ceph, including retrieving pool statistics using the GetPoolStats method. However, the Num_bytes_available field is missing in the retrieved pool statistics.

In the current PoolStat struct, there is a Num_bytes field that represents the space used in bytes, but there is no corresponding field representing the available space (Num_bytes_available).

This feature request proposes the addition of support for the Num_bytes_available field in the PoolStat struct and the corresponding GetPoolStats method. Including the Num_bytes_available field is important for users who want to have comprehensive insights into the pool's status, including both used and available capacity.

Proposed Changes

  • Modify the Ceph C library to include support for retrieving the Num_bytes_available field in pool statistics.
  • Update the Go bindings in "github.com/ceph/go-ceph/rados" to expose this new functionality to Go code by extending the PoolStat struct to include a Num_bytes_available field.
  • Ensure comprehensive testing to verify the correct retrieval of the Num_bytes_available field.
  • Update the documentation to include information about how to use the new Num_bytes_available functionality.

Use Case

The addition of the Num_bytes_available field will benefit users who need to monitor and manage Ceph pools, especially when making decisions based on available capacity.

Community Impact

This enhancement will improve the completeness and usability of the "github.com/ceph/go-ceph" library and benefit the broader Ceph community.

Additional Information

Current PoolStat struct definition:

type PoolStat struct {
    // space used in bytes
    Num_bytes uint64
    // space used in KB
    Num_kb uint64
    // number of objects in the pool
    Num_objects uint64
    // number of clones of objects
    Num_object_clones uint64
    // num_objects * num_replicas
    Num_object_copies              uint64
    Num_objects_missing_on_primary uint64
    // number of objects found on no OSDs
    Num_objects_unfound uint64
    // number of objects replicated fewer times than they should be
    // (but found on at least one OSD)
    Num_objects_degraded uint64
    Num_rd               uint64
    Num_rd_kb            uint64
    Num_wr               uint64
    Num_wr_kb            uint64
}
@phlogistonjohn
Copy link
Collaborator

Thanks for the request, I agree that this would probably be a useful enhancement.

  • Modify the Ceph C library to include support for retrieving the Num_bytes_available field in pool statistics.

This step is a prerequisite to having the field available in Go. If you haven't already please file a ceph tracker issue (https://tracker.ceph.com) for this. Then link that tracker here so we all can monitor it. Once the field is available in Ceph, then we can look into adding it in go-ceph.

@sujeet01
Copy link
Author

If you haven't already please file a ceph tracker issue (https://tracker.ceph.com) for this. Then link that tracker here so we all can monitor it.

Done. I've created a Ceph tracker issue here to add the Num_bytes_available field in the Ceph C library.

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

No branches or pull requests

2 participants