-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: add more generalized Stats #283
feat: add more generalized Stats #283
Conversation
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.
Adding some context;
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #283 +/- ##
==========================================
+ Coverage 52.67% 53.92% +1.24%
==========================================
Files 67 67
Lines 4592 4671 +79
==========================================
+ Hits 2419 2519 +100
+ Misses 1902 1885 -17
+ Partials 271 267 -4
Flags with carried forward coverage won't be shown. Click here to find out more. see 5 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
ad4e3b7
to
30ee2a0
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.
I like the aggregation model that's starting to take shape here.
Signed-off-by: Alex Pana <[email protected]>
810ab08
to
bc0cc8d
Compare
Signed-off-by: Alex Pana <[email protected]>
Signed-off-by: Alex Pana <[email protected]>
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, great job!
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.
minor comments, otherwise LGTM
Signed-off-by: Alex Pana <[email protected]>
Signed-off-by: Alex Pana <[email protected]>
Signed-off-by: Alex Pana <[email protected]>
41dbaa3
to
293fc6a
Compare
} | ||
|
||
desc, err := driver.GetDescriptionForStat(statName) | ||
if err != nil { |
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.
do we want to bubble this error up?
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.
I could be persuaded to bubble the error up. I know that Max made a comment to bubble up the error from the driver.GetDescriptionForStat
.
For the client UX, I thought it was better for the emission (logging) to not have to handle the error and always get in hand a string, the description requested or an "unknown description" string.
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.
IMO we should go all-in one direction or the other (either bubble up the error all the way or don't raise an error).
For now, I'm okay with leaving this as-is, we can revamp as we learn more about how this is used.
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.
minor comment
LGTM
Signed-off-by: Alex Pana [email protected]
This patch reworks
EvaluationMeta
field as a more general struct.The big win here is seeing
Stats
for non violating constraintswithout manipulating the
Result
struct, which is not possible with theimplementation in #263. This was evident when we tried to integrate in gatekeeper.
reviewer notes
current papercuts
You will notice we modify the driver interface for
Query()
to give back aQueryResponse
type. This breaks compatibility for drivers. We need to modify theQuery()
signature regardless to give back stateless, per call metrics. Adding theQueryResponse
struct helps future proof for further additions.UX in action
Here's what consuming this, say in g8r, would look like w
fmt.Println
:These can be logged or sent to a metrics aggregator depending on needs.
call outs
Result
struct, some tests in gatekeeper are failing and that's ok