-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Move the stats
package content to metrics
package
#2433
Conversation
@oleiade Out of curiosity, why |
@codebien that's a good question. While discussing this, it emerged that the idea to move things this way was already hanging around. @na-- had already started, so this PR just follows the movement. Besides, I do think that most of the types that have been moved are really related to Metrics, and that it's a better name, but that's really just me 🦖 |
Yeah, in #2426 I needed to add a
At the end of that, we'll be left with a nice self-contained |
75d5b00
to
1b10c69
Compare
591a0fe
to
f06d6f0
Compare
60ee665
to
2e984e1
Compare
58fca82
to
8276246
Compare
9e87a49
to
1756566
Compare
1756566
to
8ea9ce4
Compare
Until now, we had two separate `stats` and `metrics` packages. Although their content was related, some components were living in one, some in the other. It lead to difficulties when having to work with both, and made cyclic dependencies really easy to run into. To simplify our workflow, and facilitate further developments, this commit moves the content of the `stats` package in the top-level `metrics` package. As of this commit, the `stats` package is removed, and all dependencies using it have been updated to use the `metrics` package instead.
8ea9ce4
to
766afc4
Compare
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.
🎉
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.
LGTM 🙇♂️
This is a fix for a breaking change introduced in k6 v0.38.0[1]. [1]: grafana/k6#2433
What this PR is about
Until now, we had two separate
stats
andmetrics
packages. Althoughtheir content was related, some components were living in one, some in
the other. It leads to difficulties when having to work with both, and
made cyclic dependencies easy to run into.
To simplify our workflow, and facilitate further developments, this
commit moves the content of the
stats
package in the top-levelmetrics
package. As of this commit, thestats
package is removed,and all dependencies using it have been updated to use the
metrics
package instead.
Why?
This allows to easily avoid the cyclic dependency issues I've been running into whenever I attempt to touch/refactor the original thresholds code. This also builds upon the refactors made by @na-- in #cleanup-7, and leads them to the finish line 🏁. Moreover, the code between
metric
andstats
as it was laid out before made it sometimes hard to reason about one or the other. I do believe having all these types/concepts in a single place are advantageous.How to review
🚨 I know, this PR is HUGE 🚨 But, the good news is, you don't even need to look at the changes 🦖. It consists only in moving code around, updating imports, and replacing
stats.
calls intometrics.
.However, I do think it'd be valuable if you could check out the branch, and look at the new structure of the top-level
metrics
package. I took the liberty to move some types in dedicated files for clarity, but that's really most of the actual changes involved in this.Dependencies