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
Improve memory track visualization with the stacked graph #2422
Improve memory track visualization with the stacked graph #2422
Conversation
a15ed0d
to
8079977
Compare
132fe46
to
19d84ef
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.
Very nice, Vicky. I added some comments. 🙂
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.
Hey, sorry, this PR takes me forever to review. I am not completely done yet, but here is the first batch of comments. I really like this PR and in addition to beckerhe's comments, I have some more ideas to make it even better.
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 am now done with the review :)
4cebf16
to
580720b
Compare
9923502
to
b8aefd8
Compare
b8aefd8
to
70cfad7
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.
Looks even better now. Thanks for all the work Vicky and sorry for being so late with the review. I added some more comments. 🙈
src/OrbitGl/MultivariateTimeSeries.h
Outdated
UpdateMinAndMax(value); | ||
} | ||
} | ||
void UpdateMinAndMax(double value) { |
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.
This function should probably be private
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 pointing out this. This might be called by the MemoryTrack
when we set the value upper bound and lower bound.
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.
Hmm. In that case I would suggest to not put min_
and max_
into this class. If these values can be changed independently from the time series then they don't share any invariance and shouldn't be in the same class.
src/OrbitGl/GraphTrack.cpp
Outdated
absl::StrAppend(&text, delimiter); | ||
absl::StrAppend(&text, series_names[i].empty() ? "" : absl::StrFormat("%s: ", series_names[i])); | ||
absl::StrAppend(&text, value_decimal_digits.has_value() | ||
? absl::StrFormat("%.*f", value_decimal_digits.value(), values[i]) | ||
: std::to_string(values[i])); | ||
absl::StrAppend(&text, label_unit); | ||
delimiter = "\n"; |
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.
Thank you for addressing my earlier comment and please take the following as a personal preference. I did a bad job requesting a split up to increase readability, because I did not go into more detail on what I actually mean.
Beforehand it was this:
absl::StrAppend(&text, delimiter,
series_names[i].empty() ? "" : absl::StrFormat("%s: ", series_names[i]),
value_decimal_digits_.has_value()
? absl::StrFormat("%.*f", value_decimal_digits_.value(), values[i])
: std::to_string(values[i]),
label_unit_);
I would argue its easier readable and understandable if it has some extra variable names, so I dont need to keep partial result in my head. I dont know if what Im saying makes sense. This is what I mean:
std::string formatted_value =
value_decimal_digits.has_value()
? absl::StrFormat("%.*f", value_decimal_digits.value(), values[i])
: std::to_string(values[i]);
std::string formatted_name =
series_names[i].empty() ? "" : absl::StrFormat("%s: ", series_names[i]);
absl::StrAppend(&text, delimiter, formatted_name, formatted_value, label_unit);
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.
Changed accordingly! Also sorry for misunderstanding your suggestion previously. I like your idea of adding more variable with readable names here! Thanks!
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 Vicky. I added some more minor comments, but in general I think that's good to go!
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 am not done with the next review round. I will look at it again on monday
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.
Thank you a lot for adding my requests :)
Only one more small nit about method name cases.
With this change, we rename the original `GraphTrack` with a single data series as `VariableTrack`.
With this change, we add the MultivariateTimeSeries class and the unit tests.
With this change, we add the new `GraphTrack` which can visualize multiple data series.
With this change, we add the `AnnotationTrack` which provides the functionality of drawing the value limits and the warning threshold.
With this change, we update the `MemoryTrack` to inherit from the new `GraphTrack`, and draw data series as a stacked graph.
74157f9
to
bb957a8
Compare
With this change, we change the
MemoryTrack
to visualize data as a stacked graph.We also plan to refactor the current graph related tracks according to the following diagram.
The detailed plan to refactor the current graph related tracks and add / update memory tacks and pagefault tracks is:
GraphTrack
asVariableTrack
GraphTrack
AnnotationTrack
MemoryTrack
for system memory usageMemoryTrack
for process & cgroup memory usagePagefaultTrack
VariableTrack
to inherit from the newGraphTrack
And this PR contains the changes from STEP 1 to STEP 4.
Memory track after the change:
Updated class diagram:
Bug: http://b/185108718
Test: Run orbit and take a capture with enabling memory tracing.