Skip to content
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

Write thoughput data of ddsperf to csv file specified on command line via -f option #583

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

BartP6703
Copy link
Contributor

Signed-off-by: Bart bart.poot@adlinktech.com

… via -f option

Signed-off-by: Bart <bart.poot@adlinktech.com>
Copy link
Contributor

@eboasson eboasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @BartP6703, not logging the data in an easily processed format and instead parsing the console output definitely was a mistake and so this is a welcome addition. However, it would be much better do a bit of additional work and log all the interesting data, rather than just this tiny subset.

@@ -1381,12 +1384,18 @@ struct dds_stats {
const struct dds_stat_keyvalue *discarded_bytes;
};

static bool print_stats (dds_time_t tref, dds_time_t tnow, dds_time_t tprev, struct record_cputime_state *cputime_state, struct record_netload_state *netload_state, struct dds_stats *stats)
static bool print_stats (dds_time_t tref, dds_time_t tnow, dds_time_t tprev, struct record_cputime_state *cputime_state, struct record_netload_state *netload_state, struct dds_stats *stats, char *filename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes much sense to pass in the filename here when the file is a global variable. It would be more in line with the rest of the code to open the file in main, then use it here. (Or, alternatively, to make file local to main and pass it in here.)

Copy link
Contributor Author

@BartP6703 BartP6703 Nov 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the filename in optarg to open the file and use the (global) file descriptor.

{
int64_t tsec = (int64_t)(tnow / 1000000000);
int64_t nsec = (int64_t)(tnow % 1000000000);
fprintf (file, "%"PRId64".%"PRId64",%s,%"PRIdPID",%.3f,%"PRIu32",%.2f,%.2f\n",
Copy link
Contributor

@eboasson eboasson Aug 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be "%"PRId64".%06"PRId64" and I suspect the %s should be \"%s\" but I don't know CSV rules very well.

I furthermore think some of the other fields that get written to stdout here are useful; and certainly the CPU, memory and network load data would be good to also collect in the CSV file. They are gathered and printed because they are valuable for understanding what is going on, it follows that a log file specifically for analysis purposes should include them.

P.S. There is also data output for latency measurements, that should be logged as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Changed the format specifier as proposed in the comment.
  • Added code to log the latency measurements to csv file.

@@ -1939,11 +1963,12 @@ int main (int argc, char *argv[])
char netload_if[256];
double netload_bw = -1;
double rss_init = 0.0, rss_final = 0.0;
char filename[256] = { 0 };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to copy the file name to the stack, one can just store optarg.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used optarg to open the file.

…pecified on the command line of ddsperf).

Signed-off-by: Bart <bart.poot@adlinktech.com>
Signed-off-by: Bart <bart.poot@adlinktech.com>
Added extra newline at the end of the csv file just before closing it

Signed-off-by: Bart <bart.poot@adlinktech.com>
Signed-off-by: Bart <bart.poot@adlinktech.com>
@poetinger poetinger added the needs-triage Contributer attention required label Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Contributer attention required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants