Skip to content
New issue

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

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

Already on GitHub? # to your account

Refinement cleanup #20

Merged
merged 2 commits into from
Oct 21, 2022
Merged

Refinement cleanup #20

merged 2 commits into from
Oct 21, 2022

Conversation

janstenpickle
Copy link
Contributor

@janstenpickle janstenpickle commented Oct 21, 2022

Remove some of the boilerplate in refined types

Fixes #18

with Order[Name]
with Show[Name] {
override def hash(x: Name): Int = Hash[String].hash(x.value)
private val invalidNames: Set[String] = Set("quantile", "le", "name")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Histograms require that no user defined label is le and summaries require the same for quantile. This raises the question: should we have metric specifc label names, just as we do for metric names?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think if we can get this cleanly into the DSL (like it is for names) then definitely 👍

If we can't then what I imagine you're doing now (runtime exception) is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't actually a runtime execption... this is more a question about whether, like with metric names, we should have metric specific labels.

Speaking with @TimWSpence we think it's probably a good idea to go with metric specific for consitency's sake.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've just had a go at wiring this through and it is a bit of a pain. Probably not worth the effort considering there are only two labels that we want to prevent peoplefrom using...

Base automatically changed from summary-metric-type to main October 21, 2022 10:43
Copy link
Contributor

@TimWSpence TimWSpence left a comment

Choose a reason for hiding this comment

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

Nice!

@janstenpickle janstenpickle merged commit e10e06a into main Oct 21, 2022
@janstenpickle janstenpickle deleted the refinement-cleanup branch October 21, 2022 10:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TODO: Metric specific labels
3 participants