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

StreamStats Command #92

Merged
merged 6 commits into from
May 30, 2023
Merged

StreamStats Command #92

merged 6 commits into from
May 30, 2023

Conversation

ablease
Copy link
Collaborator

@ablease ablease commented May 22, 2023

StreamStatsRequest => Key Version CorrelationId Stream
  Key => uint16 // 0x001c
  Version => uint16
  CorrelationId => uint32
  Stream => string

StreamStatsResponse => Key Version CorrelationId ResponseCode Stats
  Key => uint16 // 0x801c
  Version => uint16
  CorrelationId => uint32
  ResponseCode => uint16
  Stats => [Statistic]
  Statistic => Key Value
  Key => string
  Value => int64

Add's streamStatsRequest function to connection. This returns an error if one occurs, or a map of stream stats.

Given the values for stats.committed_chunk_id, stats.first_chunk_id and stats.last_chunk_id can vary, I instead asserted on the structure and data types of the payload, rather than the actual values.

I can't think of a way of asserting on the values without mocking rabbitmq-server entirely. Let me know if you can think of a way!

Add's streamStatsRequest function to connection. This returns an error
if one occurs, or a map of stream stats
test/unit/stream_stats.test.ts Outdated Show resolved Hide resolved
src/responses/stream_stats_response.ts Outdated Show resolved Hide resolved
gpad
gpad previously approved these changes May 25, 2023
@ablease
Copy link
Collaborator Author

ablease commented May 30, 2023

Hi @gpad I had to merge in some updates form main branch, and this needs review again. Thank you!

@gpad gpad merged commit 9758441 into main May 30, 2023
@gpad gpad deleted the stream-stats branch May 30, 2023 15:05
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.

2 participants