Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2271] Add metrics to Parallel Download pipeline #985

Merged

Conversation

smatthewenglish
Copy link
Contributor

@smatthewenglish smatthewenglish commented Feb 26, 2019

PR description

Adds metrics to Parallel Download pipeline, and an associated unit test.

Fixed Issue(s)

@smatthewenglish smatthewenglish added the work in progress Work on this pull request is ongoing label Feb 26, 2019
@smatthewenglish smatthewenglish removed the work in progress Work on this pull request is ongoing label Feb 27, 2019
@@ -60,7 +60,7 @@

private final EnumSet<MetricCategory> enabledCategories = EnumSet.allOf(MetricCategory.class);

PrometheusMetricsSystem() {}
public PrometheusMetricsSystem() {}
Copy link
Contributor

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()

Suggested change
public PrometheusMetricsSystem() {}
PrometheusMetricsSystem() {}

private MutableBlockchain localBlockchain;
private BlockchainSetupUtil<Void> otherBlockchainSetup;
private Blockchain otherBlockchain;
private MetricsSystem metricsSystem = new PrometheusMetricsSystem();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private MetricsSystem metricsSystem = new PrometheusMetricsSystem();
private MetricsSystem metricsSystem = PrometheusMetricsSystem.init();

metricsSystem.createCounter(
MetricCategory.SYNCHRONIZER,
"inboundQueueCounter",
"parallel download pipeline metric");
Copy link
Contributor

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) {
Copy link
Contributor

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);
Copy link
Contributor

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?

@smatthewenglish smatthewenglish merged commit c7c9ef2 into PegaSysEng:master Feb 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants