本文整理汇总了C++中Profile::GetTimeSpans方法的典型用法代码示例。如果您正苦于以下问题:C++ Profile::GetTimeSpans方法的具体用法?C++ Profile::GetTimeSpans怎么用?C++ Profile::GetTimeSpans使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile::GetTimeSpans方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseResults
string XmlResultParser::ParseResults(Profile& profile, const SystemInformation& system, vector<Results> vResults)
{
_sResult.clear();
_Print("<Results>\n");
_sResult += system.GetXml();
_sResult += profile.GetXml();
for (size_t iResults = 0; iResults < vResults.size(); iResults++)
{
const Results& results = vResults[iResults];
const TimeSpan& timeSpan = profile.GetTimeSpans()[iResults];
_Print("<TimeSpan>\n");
double fTime = PerfTimer::PerfTimeToSeconds(results.ullTimeCount); //test duration
if (fTime >= 0.0000001)
{
// There either is a fixed number of threads for all files to share (GetThreadCount() > 0) or a number of threads per file.
// In the latter case vThreadResults.size() == number of threads per file * file count
size_t ulThreadCnt = (timeSpan.GetThreadCount() > 0) ? timeSpan.GetThreadCount() : results.vThreadResults.size();
unsigned int ulProcCount = system.processorTopology._ulActiveProcCount;
_Print("<TestTimeSeconds>%.2f</TestTimeSeconds>\n", fTime);
_Print("<ThreadCount>%u</ThreadCount>\n", ulThreadCnt);
_Print("<RequestCount>%u</RequestCount>\n", timeSpan.GetRequestCount());
_Print("<ProcCount>%u</ProcCount>\n", ulProcCount);
_PrintCpuUtilization(results, system);
if (timeSpan.GetMeasureLatency())
{
_PrintLatencyPercentiles(results);
}
if (timeSpan.GetCalculateIopsStdDev())
{
_PrintOverallIops(results, timeSpan.GetIoBucketDurationInMilliseconds());
}
if (results.fUseETW)
{
_PrintETW(results.EtwMask, results.EtwEventCounters);
_PrintETWSessionInfo(results.EtwSessionInfo);
}
for (size_t iThread = 0; iThread < results.vThreadResults.size(); iThread++)
{
const ThreadResults& threadResults = results.vThreadResults[iThread];
_Print("<Thread>\n");
_Print("<Id>%u</Id>\n", iThread);
for (const auto& targetResults : threadResults.vTargetResults)
{
_Print("<Target>\n");
_PrintTargetResults(targetResults);
if (timeSpan.GetMeasureLatency())
{
_PrintTargetLatency(targetResults);
}
if (timeSpan.GetCalculateIopsStdDev())
{
_PrintTargetIops(targetResults.readBucketizer, targetResults.writeBucketizer, timeSpan.GetIoBucketDurationInMilliseconds());
}
_Print("</Target>\n");
}
_Print("</Thread>\n");
}
}
else
{
_Print("<Error>The test was interrupted before the measurements began. No results are displayed.</Error>\n");
}
_Print("</TimeSpan>\n");
}
_Print("</Results>");
return _sResult;
}