Skip to content

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

@sujeet01

Description

@sujeet01

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions