incubator-pegasus
incubator-pegasus copied to clipboard
Feature(new_metrics): migrate replica-level metrics
The replica-level entity can be bound to replica_base, since all of the classes (pegasus_server_impl
, replica
, etc., see classes in following sub-tasks) that hold replica-level metrics are derived from replica_base
; Moreover, these classes also accept replica_base *
as a parameter of their constructors.
Therefore, the replica entity can just be instantiated just in the constructor of replica_base
; then, all of the classes that hold replica-level metrics will be instantiated with the replica entity from replica_base
.
All classes (except pegasus_server_impl
and replica
) that hold replica-level metrics are a member of pegasus_server_impl
, which is a member of replica
and created at replica::init_app_and_prepare_list()
, thus the lifetime of all replica-level metrics are bound to a replica: they will be released once a replica is deleted.
The replica-level metrics are distributed on following classes and source files. The migration for them can be divided into following tasks:
- [x] https://github.com/apache/incubator-pegasus/issues/1344
- [ ] https://github.com/apache/incubator-pegasus/issues/1336
- [x] https://github.com/apache/incubator-pegasus/issues/1333
- [ ] https://github.com/apache/incubator-pegasus/issues/1334
- [ ] https://github.com/apache/incubator-pegasus/issues/1342
- [ ] https://github.com/apache/incubator-pegasus/issues/1343
- [x] https://github.com/apache/incubator-pegasus/issues/1412