Skip to content

feat(sdk): Add automatic rate computation for read/write metrics #9

@lowhung

Description

@lowhung

Summary

The SDK's ReadMetrics and WriteMetrics have a rate field but it's always None. The SDK should compute messages/second automatically.

Proposed Solution

  • Track previous count and timestamp for each topic in ReadState and WriteState
  • Compute messages/second rate on each collect() call
  • Rate should be None on first collection (no baseline available)
  • Require at least 10ms between samples to avoid division issues

Benefits

  • Real-time throughput visibility without manual calculation
  • Consistent rate computation across all topics

Implementation Notes

Already implemented in PR #8

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions