-
Notifications
You must be signed in to change notification settings - Fork 130
[PAN-2271] Add metrics to Parallel Download pipeline #985
[PAN-2271] Add metrics to Parallel Download pipeline #985
Conversation
a0b7ae5
to
ae2b26b
Compare
17b4893
to
c5f88d9
Compare
@@ -60,7 +60,7 @@ | |||
|
|||
private final EnumSet<MetricCategory> enabledCategories = EnumSet.allOf(MetricCategory.class); | |||
|
|||
PrometheusMetricsSystem() {} | |||
public PrometheusMetricsSystem() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is deliberately not public. use init()
public PrometheusMetricsSystem() {} | |
PrometheusMetricsSystem() {} |
private MutableBlockchain localBlockchain; | ||
private BlockchainSetupUtil<Void> otherBlockchainSetup; | ||
private Blockchain otherBlockchain; | ||
private MetricsSystem metricsSystem = new PrometheusMetricsSystem(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private MetricsSystem metricsSystem = new PrometheusMetricsSystem(); | |
private MetricsSystem metricsSystem = PrometheusMetricsSystem.init(); |
metricsSystem.createCounter( | ||
MetricCategory.SYNCHRONIZER, | ||
"inboundQueueCounter", | ||
"parallel download pipeline metric"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More descriptive, such as "count of queue items that started processing"
|
||
final List<Observation> metrics = | ||
metricsSystem.getMetrics(MetricCategory.SYNCHRONIZER).collect(Collectors.toList()); | ||
for (Observation observation : metrics) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what would look better is
assertThat(metrics).contains(new Observation(...), new Observation(...));
metricsSystem.getMetrics(MetricCategory.SYNCHRONIZER).collect(Collectors.toList()); | ||
for (Observation observation : metrics) { | ||
if (observation.getMetricName().equals("outboundQueueCounter")) { | ||
assertThat(observation.getValue()).isEqualTo(5.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.... why aren't the inbound and outbound counts equal? Why is there one more inbound?
9520cbf
to
44ed44d
Compare
44ed44d
to
937de64
Compare
PR description
Adds metrics to Parallel Download pipeline, and an associated unit test.
Fixed Issue(s)