Engine worker metrics support#1470
Conversation
|
|
||
| import org.agrona.collections.MutableInteger; | ||
|
|
||
| public final class CapacityTracker |
There was a problem hiding this comment.
| public final class CapacityTracker | |
| public final class TcpCapacityTracker |
| { | ||
| MutableInteger capacity = new MutableInteger(ENGINE_WORKER_CAPACITY.getAsInt(config)); | ||
| LongConsumer capacityUsage = context.supplyUtilizationMetric(); | ||
| CapacityTracker capacity = new CapacityTracker(ENGINE_WORKER_CAPACITY.getAsInt(config), capacityUsage); |
There was a problem hiding this comment.
Suggest passing config and context to TcpCapacityTracker and handling the metric lookup and the capacity lookup in the constructor.
| for (SocketChannel channel = router.accept(server); channel != null; | ||
| channel = router.accept(server)) |
There was a problem hiding this comment.
We can revert this change.
| { | ||
| // implicit int -> long conversion, it's OK | ||
| return labelResolver.apply(namespaceId); | ||
| return namespaceId != -1 ? labelResolver.apply(namespaceId) : null; |
There was a problem hiding this comment.
| return namespaceId != -1 ? labelResolver.apply(namespaceId) : null; | |
| return namespaceId != NamespacedId.NO_NAMESPACE_ID ? labelResolver.apply(namespaceId) : null; |
| public String binding() | ||
| { | ||
| return labelResolver.apply(bindingId); | ||
| return bindingId != -1 ? labelResolver.apply(bindingId) : null; |
There was a problem hiding this comment.
| return bindingId != -1 ? labelResolver.apply(bindingId) : null; | |
| return bindingId != NamespacedId.NO_LOCAL_ID ? labelResolver.apply(bindingId) : null; |
| [ | ||
| { | ||
| "op": "add", | ||
| "path": "/$defs/telemetry/metrics/items/enum/-", | ||
| "value": "engine.worker.utilization" | ||
| } | ||
| ] |
There was a problem hiding this comment.
I think we shouldn't need this to be configured, it should be always on, even for empty config, agree?
| '}' | ||
| '}]' | ||
| '}]' | ||
| '}]' |
There was a problem hiding this comment.
Please restore the original formatting for readability.
| '}' | ||
| '}]' | ||
| '}]' | ||
| '}]' |
There was a problem hiding this comment.
Please restore the original formatting for readability.
| NANOSECONDS, | ||
| COUNT | ||
| COUNT, | ||
| PERCENT |
There was a problem hiding this comment.
Is it necessary to add a custom type here?
| public String binding() | ||
| { | ||
| return bindingId != -1 ? labelResolver.apply(bindingId) : null; | ||
| return bindingId != NamespacedId.NO_NAMESPACE_ID ? labelResolver.apply(bindingId) : null; |
There was a problem hiding this comment.
| return bindingId != NamespacedId.NO_NAMESPACE_ID ? labelResolver.apply(bindingId) : null; | |
| return bindingId != NamespacedId.NO_LOCAL_ID ? labelResolver.apply(bindingId) : null; |
Fixes #1465