-
Notifications
You must be signed in to change notification settings - Fork 1
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: offer csv-formatted totals (by duration) output #2
base: main
Are you sure you want to change the base?
Conversation
Hi, sorry for not getting around to reviewing sooner. Could you fix the indent formatting in the files? I'm not sure who's to blame, but I'd like to have both uniform formatting in the repo and not pollute commits with irrelevant changes. If I have to fix formatting, I'll do it later. I added a few comments so after resolving them it's good to go. |
You're right, that line is unused. I'll fix it later, thanks. |
I used your provided clang-format file. which version of clang-format are you using?
I totally see you point about mixing code changes and formatting changes. I'll prepare the feature-only commit in the next couple of days, if you don't mind. I don't see any of your comments in the 'Files Changed'-Tab though. |
That's weird. I have the same version.
Do you still not see the comments? I see them in the Files tab, and also here, above your last comment. |
void FuncProfilerTree::outputTotalsCSVToOStream(std::ostream &out) const | ||
{ | ||
SStream ss; | ||
out << "Function Name,Time (s),Call Number\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.
Header should probably be optional. Add a bool parameter?
@@ -152,6 +163,16 @@ String FuncProfilerTree::totalsByDurationStr(size_t indent, size_t indentSpaces) | |||
return ss.str(); | |||
} | |||
|
|||
void FuncProfilerTree::outputTotalsByDurationCSVToOStream(std::ostream &out) const | |||
{ | |||
out << "Time (s),Call Number,Function Name\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.
Also make the header optional.
@@ -75,7 +76,16 @@ int main() | |||
}); | |||
t1.join(); | |||
|
|||
std::ofstream ofs("test.csv", std::ios::out | std::ios::trunc); |
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.
Better to output it to cout, like the other examples. This way the demo is showcase-only.
@@ -1,5 +1,6 @@ | |||
#include "MMeter.h" | |||
|
|||
#include <fstream> |
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.
Better not to use fstream just for the demo, iostream is sufficient
Is this still the case? |
Maybe there's a separate category for file comments? |
perfect, now I see. Let me work on the changes over the weekend |
This commit adds the ability to output csv-formatted Totals/TotalsByDuration information to an std::ostream.
I would find very useful for comparing multiple runs against each other, in the process of e.g. refactoring.
Let me know what you think, thanks.
BTW: I think this is unused
MMeter/src/MMeter.cpp
Line 261 in 42df645