-
Notifications
You must be signed in to change notification settings - Fork 184
renamed Metrics to MetricsState and move to a separate file #822
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
Conversation
Signed-off-by: Nir Rozenbaum <[email protected]>
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
/retest |
| String() string | ||
| } | ||
|
|
||
| type Metrics struct { |
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.
If we are going to pull this out of the types file. Should we pull the factory out as well? If we want a type per file, should we turn types into a directory?
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.
the direction I was thinking of can be seen in #783 that was closed in favor of splitting the changes into a series of smaller PRs. I think each data scraper should have a directory and inside that directory the structs should be flattened. if it's more convenient you can see in the PR branch an example here:
https://github.com/nirrozenbaum/gateway-api-inference-extension/tree/model-scraper/pkg/epp/backend/metrics
so, at the end of this bigger change, I don't think we'll need types directory nor types.go file.
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.
factory has to go through more changes than extracting from types, so that's for another PR
|
Small comment about repo structure, also I'm not sold on |
in the previous (and bigger) PR that was closed I called it anyway, I'm open to any name that makes sense. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kfswain, nirrozenbaum The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…es-sigs#822) Signed-off-by: Nir Rozenbaum <[email protected]>
…es-sigs#822) Signed-off-by: Nir Rozenbaum <[email protected]>
…es-sigs#822) Signed-off-by: Nir Rozenbaum <[email protected]>
…es-sigs#822) Signed-off-by: Nir Rozenbaum <[email protected]>
This PR renames the struct
Metrics(under backend/metrics) toMetricsStateand move it to a separate file (extracted fromtypes.go).currently in the repo there are many different places that uses the terminology 'metrics', which makes it confusing to a newcomer to understand where do we define what metrics we collect, and where is the metrics latest state.
This PR aims to solve this issue, as the changed struct holds the state of the scraped metrics from a pod (the values may change every scraping interval).
Additionally, not only this change improves readability of current code, it's also a first PR out of a bigger change.
on follow up PRs, the concept of ServerState (a general purpose interface) will be introduced and is representing a state of data that is collected/scraped from a pod (this is part of data layer and extensible pod scrapers).
MetricsState will the first use of that interface once the interface is introduced.
This PR has NO LOGIC CHANGE.