apache / apache/incubator-pegasus
Feature(new_metrics): migrate metrics of server and other levels
- Dominant language
- C++
- Stars
- 2.1k
- Forks
- 328
- PR merge metrics
- No merged PRs in 30d
Description
The number of metrics that are attached to server-level entity is the largest among all kinds of entities. They are distributed very widely on classes and source files.
Thus server-level entity can just be defined in `metrics.cpp`. Once a metric is attached to the server entity, declare the entity at the header of the source file. The migration for server-level metrics can be divided into following tasks:
- [ ] https://github.com/apache/incubator-pegasus/issues/1414
- [ ] https://github.com/apache/incubator-pegasus/issues/1321
- [ ] https://github.com/apache/incubator-pegasus/issues/1329
- [x] https://github.com/apache/incubator-pegasus/issues/1425
- [ ] https://github.com/apache/incubator-pegasus/issues/1331
- [x] https://github.com/apache/incubator-pegasus/issues/1441
- [x] https://github.com/apache/incubator-pegasus/issues/1454
- [x] https://github.com/apache/incubator-pegasus/issues/1481
Following metrics are the members of `pegasus_event_listener` ([pegasus_event_listener.cpp](https://github.com/apache/incubator-pegasus/blob/master/src/server/pegasus_event_listener.cpp)), which is created at the construction of `pegasus_server_impl`:
| Variables | Types/Computations |
| :-------: | :------------------: |
| _pfc_recent_flush_completed_count | increase(Counter) |
| _pfc_recent_flush_output_bytes | increase(Counter) |
| _pfc_recent_compaction_completed_count | increase(Counter) |
| _pfc_recent_compaction_input_bytes | increase(Counter) |
| _pfc_recent_compaction_output_bytes | increase(Counter) |
| _pfc_recent_write_change_delayed_count | increase(Counter) |
| _pfc_recent_write_change_stopped_count | increase(Counter) |
Following metrics are the members of `ship_mutation` ([duplication_pipeline.cpp](https://github.com/apache/incubator-pegasus/blob/master/src/replica/duplication/duplication_pipeline.cpp)), which is created at `replica_duplicator::start_dup_log()`:
| Variables | Types/Computations |
| :-------: | :------------------: |
| _counter_dup_shipped_bytes_rate | rate(Counter) |
Contributor guide
Research direction
Start with metrics.cpp and the linked server-level migration issues, then inspect pegasus_event_listener.cpp and duplication_pipeline.cpp where the remaining metrics are defined. Trace how pegasus_server_impl constructs the listener and how replica_duplicator::start_dup_log() creates ship_mutation. Done means the listed server-level metrics have been migrated and their entity declarations follow the issue’s stated placement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- observability
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100