ceph / ceph/go-ceph

Enhance `GetPoolStats()` Method to Include `Num_bytes_available` Field in `PoolStat`

Open
#922 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
691
Forks
296
Avg merge
2d 16h
Merged PRs (30d)
11

Description

**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:
```go
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
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the rados PoolStat definition and GetPoolStats binding described in the issue, then trace how pool statistics are obtained from the Ceph C library. Add and verify the available-bytes field, and update the related documentation; completion requires tests demonstrating that the value is retrieved correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.