-
Notifications
You must be signed in to change notification settings - Fork 34
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
LiveMetric: realtime statistics for debug UI. #405
base: main
Are you sure you want to change the base?
Conversation
c875639
to
55f4a42
Compare
Could you please add a quick summary of what problem the PR solves? |
55f4a42
to
557479c
Compare
This gives a readable statistics for cpu submission time / gpu work duration / etc. i.e. the leading digit does not jump around every frame. This version is due to suggestion of @Keenuts 's suggestion on have it in the metric framework. The stand alone version is #377 . |
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.
Thanks for putting this together. A few comments 😊
@@ -299,6 +415,12 @@ class Manager final | |||
// Get Gauge Basic Statistics, only works for type GAUGE | |||
GaugeBasicStatistics GetGaugeBasicStatistics(MetricID id) const; | |||
|
|||
// Get Live Statistics for a LiveMetric, only works for type GAUGE | |||
LiveStatistics GetLiveStatistics(MetricID id) const; |
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.
Shall this be renamed to GetGaugeLiveStatistics
to match the function above?
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.
It does not report MetricGauge
's live statistics, so I'll leave Gauge out of the name.
cbb395f
to
8488b7d
Compare
It is a kind of tracker of statistics for an underlying gauge metrics, and you reset it (by clearing history) whenever you want. Is that correct? |
The initial idea is to have a layer on top of the raw metrics that averages it over X samples. That's for the goal/idea I have in mind. |
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.
Thanks for the changes! Added comments, but LGTM for the direction. Addind second owner.
Addition to Nathan's comment. The use case is to tracks a set of gauge metrics that we want to see on screen, not necessary the ones we want to record to a profiling run (e.g. cpu time spent on input processing). The samples are |
Statistics include latest/mean/variance/min/max.
e97381b
to
6bab0a5
Compare
Adding Angela & Ran since they have reviewed #377 . |
Ok, thx. Makes sense. |
LGTM from a metrics perspective. I'll defer approval to people that own the project. |
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.
Sorry for the late review, only left a couple of comments cause I need to take another look fully.
Personally though, I find the metrics framework more confusing with these changes, and not sure if the complexity is justified. But if I am in minority, I am also fine with this.
Also I would like for Application to contain less code that doesn't need to be there, I understand we have some wrappers there to add additional metrics, but do the others functions need to be there?
bool BindMetric(metrics::MetricID metricID, const metrics::MetricMetadata& metadata); | ||
|
||
// Bind a live metric, return true on success. | ||
bool BindLiveMetric(metrics::MetricID metricID); |
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.
Could you elaborate here? What does "binding" a metric mean? Why do we need to call that? What happens if we don't?
I would ideally like to know these things without reading the code.
@@ -523,13 +524,28 @@ class Application | |||
// See StartMetricsRun for why this wrapper is necessary. | |||
virtual bool HasActiveMetricsRun() const; | |||
|
|||
// Allocate a metric id to be used for a combined live/recorded metric. |
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 need to have all of these metric related functions in Application?
My preference is keeping it simple and separate, however Nathan have some good point, so I also made this version to see if integration makes sense. |
This PR is a fork of #377 .
Adding real time statistics into the metric framework so it is easier to read.