feat: offer csv-formatted totals (by duration) output#2
feat: offer csv-formatted totals (by duration) output#2juliangaal wants to merge 1 commit intoLMauricius:mainfrom
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.
Header should probably be optional. Add a bool parameter?
|
|
||
| void FuncProfilerTree::outputTotalsByDurationCSVToOStream(std::ostream &out) const | ||
| { | ||
| out << "Time (s),Call Number,Function Name\n"; |
There was a problem hiding this comment.
Also make the header optional.
| }); | ||
| t1.join(); | ||
|
|
||
| std::ofstream ofs("test.csv", std::ios::out | std::ios::trunc); |
There was a problem hiding this comment.
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.
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