Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha support for metrics #55

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kaleofduty
Copy link
Collaborator

No description provided.

}
}
var err error
nonblockingMetric.metricImpl, err = nonblockingMetricVec.metricVecImpl.GetMetricWith(nonblockingMetric.labels)
Copy link

@reductionista reductionista Feb 16, 2023

Choose a reason for hiding this comment

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

This can segfault if nbmw.metricsImpl is nil. Should we add a nil check, so it's backward compatible with PeerConfig structs that don't have Metrics field explicitly filled in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, we should def. do that. Note that this is just an alpha branch with the goal of aligning on the updated libocr interface and being able to do some very rough testing of whether things work.

Choose a reason for hiding this comment

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

Do you refer to line 122?
If yes, do I understand correctly that the nil check you refer to is for the constructor?
I.e. function "NewNonblockingMetricsWrapper"

Choose a reason for hiding this comment

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

Yes, line 122. I just mean adding:

if nbmw.metricsImpl == nil {

}

IIRC, when I left this comment I did a couple edits within the first minute or two... you might have seen an earlier version in an email that wasn't right.

Choose a reason for hiding this comment

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

Oh, I may have misunderstood the question: I was actually thinking the check should go here, but yes putting in the constructor might work better? I'd need more context to have a strong opinion on that.

@krehermann
Copy link

i have a WIP implementation. at minimum, it does not segfault during ocr tests and it implements the interfaces smartcontractkit/chainlink#8454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants