QmlProfiler: In statistics use non-recursive time as total

Otherwise the percentages and totals don't match. The extra recursive
time is shown in the tooltip, without percentage (as there wouldn't be a
sensible base value for a percentage number).

Change-Id: I47fcf92aac3f60554219f7da9dd2ac90061ce496
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2017-08-10 16:50:32 +02:00
parent 0cbb78e464
commit e7c950eb11

View File

@@ -578,9 +578,8 @@ void QmlProfilerStatisticsMainView::updateNotes(int typeIndex)
item->setToolTip(it.value()); item->setToolTip(it.value());
} else if (stats.durationRecursive > 0) { } else if (stats.durationRecursive > 0) {
item->setBackground(colors()->noteBackground); item->setBackground(colors()->noteBackground);
item->setToolTip(tr("%1 / %2% of total in recursive calls") item->setToolTip(tr("+%1 in recursive calls")
.arg(Timeline::formatTime(stats.durationRecursive)) .arg(Timeline::formatTime(stats.durationRecursive)));
.arg(stats.durationRecursive * 100l / stats.duration));
} else if (!item->toolTip().isEmpty()){ } else if (!item->toolTip().isEmpty()){
item->setBackground(colors()->defaultBackground); item->setBackground(colors()->defaultBackground);
item->setToolTip(QString()); item->setToolTip(QString());
@@ -619,8 +618,9 @@ void QmlProfilerStatisticsMainView::parseModel()
} }
if (d->m_fieldShown[TotalTime]) { if (d->m_fieldShown[TotalTime]) {
newRow << new StatisticsViewItem(Timeline::formatTime(stats.duration), newRow << new StatisticsViewItem(
stats.duration); Timeline::formatTime(stats.duration - stats.durationRecursive),
stats.duration - stats.durationRecursive);
} }
if (d->m_fieldShown[SelfTimeInPercent]) { if (d->m_fieldShown[SelfTimeInPercent]) {