MCPcopy Create free account
hub / github.com/SIPp/sipp / dumpDataRtt

Method dumpDataRtt

src/stat.cpp:1409–1448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1407} /* end of logData () */
1408
1409void CStat::dumpDataRtt ()
1410{
1411 if (M_counterDumpRespTime == 0) {
1412 return;
1413 }
1414 if(M_outputStreamRtt == nullptr) {
1415 // if the file is still not opened, we opened it now
1416 M_outputStreamRtt = new std::ofstream(M_fileNameRtt);
1417 M_headerAlreadyDisplayedRtt = false;
1418
1419#ifndef __osf__
1420 if(!M_outputStreamRtt->is_open()) {
1421 std::cerr << "Unable to open rtt file '" << M_fileNameRtt << "' !" << std::endl;
1422 exit(EXIT_FATAL_ERROR);
1423 }
1424#endif
1425 }
1426
1427 if(M_headerAlreadyDisplayedRtt == false) {
1428 (*M_outputStreamRtt) << "Date_ms" << stat_delimiter
1429 << "response_time_ms" << stat_delimiter
1430 << "rtd_no" << std::endl;
1431 M_headerAlreadyDisplayedRtt = true;
1432 }
1433
1434 for (unsigned int L_i = 0; L_i < M_counterDumpRespTime ; L_i ++) {
1435 (*M_outputStreamRtt) << M_dumpRespTime[L_i].date << stat_delimiter ;
1436 (*M_outputStreamRtt) << M_dumpRespTime[L_i].rtt << stat_delimiter ;
1437 (*M_outputStreamRtt) << M_revRtdMap[M_dumpRespTime[L_i].rtd_no] << std::endl;
1438 (*M_outputStreamRtt).flush();
1439 M_dumpRespTime[L_i].date = 0.0;
1440 M_dumpRespTime[L_i].rtt = 0.0;
1441 M_dumpRespTime[L_i].rtd_no = 0;
1442 }
1443
1444 // flushing the output file
1445 (*M_outputStreamRtt).flush();
1446
1447 M_counterDumpRespTime = 0;
1448}
1449
1450
1451/* Time Gestion */

Callers 1

traffic_threadFunction · 0.80

Calls 1

flushMethod · 0.80

Tested by

no test coverage detected