Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Record total and active stream counts (#178)
## Which problem is this PR solving? The agent assigns stream IDs to new streams to help identify them. However, we do not track the total number of streams created or the number of active streams. Streams are considered active once created and while receiving data, when data stops flowing they become eligible for closing. Understanding the impact of total and active streams is important because we believe this is directly related to memory utilisation and growth. The PR records the number of active streams and adds both the total and active stream counts to logged stats. ## Short description of the changes - Move streamID count from stream factory to stats struct as total_streams - this is incremented whenever a new stream is created by the stream factory - Add active_streams count to stats struct and increment / decrement as new streams are created and closed - Add both total_streams and active_streams counts to stats fields that are both sent in stats events sent to honeycomb and logged at debug level ## How to verify that this has the expected result Total and active stream counts are visible in logs and in honeycomb agent stats events. <img width="1320" alt="image" src="https://github.com/honeycombio/honeycomb-network-agent/assets/3481731/f1743bef-45b6-412d-81c8-64c111077f61">
- Loading branch information