当前位置: 首页>>代码示例>>C++>>正文


C++ Profile::GetTimeSpans方法代码示例

本文整理汇总了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;
}
开发者ID:Microsoft,项目名称:diskspd,代码行数:75,代码来源:XmlResultParser.cpp


注:本文中的Profile::GetTimeSpans方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。