IGNITE-27573 Adapt jraft node metrics to ignite metric framework#7722
IGNITE-27573 Adapt jraft node metrics to ignite metric framework#7722Phillippko wants to merge 16 commits intoapache:mainfrom
Conversation
6e20e62 to
5e0961c
Compare
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/CliIntegrationTest.java
Outdated
Show resolved
Hide resolved
...les/raft/src/main/java/org/apache/ignite/internal/metrics/sources/FsmCallerMetricSource.java
Show resolved
Hide resolved
...es/raft/src/main/java/org/apache/ignite/internal/metrics/sources/LogManagerMetricSource.java
Outdated
Show resolved
Hide resolved
| new MetricSource().name(THREAD_POOLS_METRICS_SOURCE_NAME + "striped.messaging.inbound.deploymentunits").enabled(true), | ||
| new MetricSource().name(THREAD_POOLS_METRICS_SOURCE_NAME + "striped.messaging.inbound.scalecube").enabled(true), | ||
| new MetricSource().name(THREAD_POOLS_METRICS_SOURCE_NAME + "messaging.outbound").enabled(true) | ||
| new MetricSource().name("thread.pools.striped.messaging.inbound.default").enabled(true), |
There was a problem hiding this comment.
Would be nice to sort them alphabetically, but maybe that's too much to ask
|
|
||
| private final List<Metric> metrics; | ||
|
|
||
| private final HashMap<TaskType, DistributionMetric> taskDurations = new HashMap<>(); |
There was a problem hiding this comment.
- Type should be declared as
Map, notHashMap. Why did you do this? - Please use
EnumMapfor enums. A dedicated type of map is better than a universal one.
| metrics = new ArrayList<>(); | ||
|
|
||
| metrics.add(applyTasksSize); | ||
| metrics.add(lastApplyTasksTime); | ||
| metrics.add(lastCommitTime); | ||
| metrics.add(applyTasksTime); | ||
| metrics.add(commitTime); |
There was a problem hiding this comment.
Could be metrics = List.of(applyTasksSize, applyTasksTime, commitTime).
I wonder why you decided to write it this way, for future extensibility? Will this list become dynamic in the near future?
| static class Holder implements AbstractMetricSource.Holder<Holder> { | ||
| private final AtomicLongMetric lastTruncateLogSuffixTime = new AtomicLongMetric( | ||
| private static final long[] HISTOGRAM_BUCKETS = | ||
| {10, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000}; |
There was a problem hiding this comment.
Up to 500 thousands? Woooow, that's too much. Are these milliseconds, what will they measure?
Some operations are better measured in microseconds, it has to be metric-dependent. Let's discuss these bounds separately
| this.metricName = "fsm-" + name().toLowerCase().replaceAll("_", "-"); | ||
| } | ||
| return this.metricName; | ||
| IDLE ("IdleDuration"), |
There was a problem hiding this comment.
These are FSMCaller task types, so they have nothing in common with "...Duration". Why did you name them this way?
|
|
||
| private final DistributionMetric handleAppendEntriesDuration = new DistributionMetric( | ||
| "HandleAppendEntriesDuration", | ||
| "Duration of handling append entries request in node impl in milliseconds", |
There was a problem hiding this comment.
Are these messages exposed to a user? In that case, what is node impl? Users know nothing about internal naming
https://issues.apache.org/jira/browse/IGNITE-27573
added metric sources:
raft.logmanager.<group_id>
raft.readonlyservice.<group_id>
raft.fsmcaller.<group_id>
raft.node.<group_id>
So every partition / system group will have it's own set of metrics
didn't touch replicator and thread metrics to keep PR a little bit simpler