-
Notifications
You must be signed in to change notification settings - Fork 105
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
Expose metrics to report time taken in fetch/template/deploy phase of app, pkgi, pkgr #1415
Conversation
Signed-off-by: sethiyash <yashsethiya97@gmail.com>
Signed-off-by: sethiyash <yashsethiya97@gmail.com>
d657d7e
to
09d6cd0
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.
inline comments.
00093da
to
196bc45
Compare
Signed-off-by: sethiyash <yashsethiya97@gmail.com>
196bc45
to
1631608
Compare
Import statements in many files are not as per our convention. Please check them. |
Signed-off-by: sethiyash <yashsethiya97@gmail.com>
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
LGTM |
Signed-off-by: sethiyash <yashsethiya97@gmail.com>
8c85c56
to
0174469
Compare
pkg/app/app_reconcile.go
Outdated
// Reconcile is not expected to be called concurrently | ||
func (a *App) Reconcile(force bool) (reconcile.Result, error) { | ||
defer a.flushUpdateStatus("app reconciled") | ||
|
||
var err error | ||
|
||
a.appMetrics.InitMetrics(a.Name(), a.Namespace()) | ||
a.appMetrics.ReconcileCountMetrics.InitMetrics(appResourceType, a.Name(), a.Namespace()) |
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.
Why not use a.Name() itself? Or maybe Kind()
if we don't want to use name.
Same for package install and package repo.
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 is no a.Kind() available here
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 kind
for an app shouldn't be a constant in a reconciler. It should live with the object model.
In this case, our app
struct probably ought to have another function return the kind, rather than a constant.
I think @praveenrewar 's original comment is my thinking also. Just because the data we need isn't there - doesn't mean it can't be. We need it to be, so let's just make it available.
02e4e67
to
092f90b
Compare
Signed-off-by: sethiyash <yashsethiya97@gmail.com>
092f90b
to
621f947
Compare
4ee157b
to
eee0980
Compare
Signed-off-by: sethiyash <yashsethiya97@gmail.com>
eee0980
to
68d3e5d
Compare
b7f1206
to
68d3e5d
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.
LGTM!
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.
Overall LGTM, I added a few nit things. And one suggestion: In our tests we do this pattern of metrics.New()
everywhere, which is kinda silly because it's never used and we allocate all this memory to build the structures. It's just test code so it's not the end of the world, just something to consider / think about.
One concern is that we don't have any tests for this stuff at all (in this PR it seems). Given that the code is mostly registering metrics, it likely ought to be an e2e test. Even a simple one to just validate the a small sample of metrics is actually exposed / collected.
How do we know it works? :) And how do I as the reviewer?
a81a775
to
301d354
Compare
Signed-off-by: sethiyash <yashsethiya97@gmail.com> Signed-off-by: Yash Sethiya <ysethiya@ysethiya4MD6M.vmware.com>
301d354
to
f9b21d3
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.
LGTM (Apart from the 2 nits)
Signed-off-by: Yash Sethiya <ysethiya@ysethiya4MD6M.vmware.com>
b6667e5
to
b292117
Compare
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?
Additional Notes for your reviewer:
Review Checklist:
a link to that PR
change
Additional documentation e.g., Proposal, usage docs, etc.: