Commit 269a7d6f authored by Christiaan Janssen's avatar Christiaan Janssen Committed by Aurindam Jana
Browse files

QmlProfiler: skip anonymous events when computing percentages

Change-Id: I23acc59937622c4426c02a613434eb443a155b29
Reviewed-on: http://codereview.qt.nokia.com/1864


Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarAurindam Jana <aurindam.jana@nokia.com>
parent 6d2ac4e9
...@@ -233,10 +233,15 @@ void QmlProfilerEventStatistics::QmlProfilerEventStatisticsPrivate::postProcess( ...@@ -233,10 +233,15 @@ void QmlProfilerEventStatistics::QmlProfilerEventStatisticsPrivate::postProcess(
{ {
double totalTime = 0; double totalTime = 0;
foreach (QmlEventData *binding, m_rootHash.values()) foreach (QmlEventData *binding, m_rootHash.values()) {
if (binding->filename->isEmpty())
continue;
totalTime += binding->duration; totalTime += binding->duration;
}
foreach (QmlEventData *binding, m_rootHash.values()) { foreach (QmlEventData *binding, m_rootHash.values()) {
if (binding->filename->isEmpty())
continue;
binding->percentOfTime = binding->duration * 100.0 / totalTime; binding->percentOfTime = binding->duration * 100.0 / totalTime;
binding->timePerCall = binding->calls > 0 ? double(binding->duration) / binding->calls : 0; binding->timePerCall = binding->calls > 0 ? double(binding->duration) / binding->calls : 0;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment