-
Notifications
You must be signed in to change notification settings - Fork 9
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
1469 Output LB statistics as JSON #1475
Conversation
@PhilMiller @JacobDomagala @jstrzebonski @ppebay @nlslatt I would like feedback on this PR! |
std::unique_ptr<StatsData> sd | ||
) { | ||
std::deque<std::set<ElementIDType>> element_history; | ||
for (PhaseType phase = 0; phase < sd->node_data_.size(); phase++) { |
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.
Would you be able to convert this loop into for-each? Maybe something like this:
for (auto const& nd : sd->node_data_) {
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 problem is that sd->node_data_
is an unordered_map
but these need to be traversed in the correct order for element_history
to be correct. So I can't use an iterator.
|
||
template <typename StreamLike> | ||
bool Compressor::writeImpl( | ||
StreamLike& s, uint8_t const* buffer, std::size_t const size, bool finish_ |
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 see the point in the usage of finish_
, but to be honest, I'm not a fan of changing the behaviour of the function with a boolean variable. But from the top of my head, I don't have any clever idea of refactoring this function. So I'm fine with leaving it be.
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 initially had two different functions (one for finishing and one for incremental writes). The problem is that I have to duplicate basically this whole function so I combined them.
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 left some minor notes and suggestions, but this looks really great!
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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 makes me think that extracting some helpers could help readability
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 good to me!
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'm okay with merging this after addressing the point that @cz4rs made about the stats restart reader.
0e952a9
to
1852358
Compare
Fixes #1469
Should we completely remove the old stat output or leave it as an option that the user can select until we decide to remove it?