From fa1fc5b7727f354ec40463537df03097fb41bab2 Mon Sep 17 00:00:00 2001 From: Daniel d'Andrada Date: Thu, 5 Apr 2018 15:27:27 +0200 Subject: [sysui] Display some startup timings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTAUTO-952 Change-Id: I4d265d35035b4134ba1ed03e0b4aa75afb03ed69 Reviewed-by: Lukáš Tinkl Reviewed-by: Bramastyo Harimukti Santoso --- imports/assets/translations/cs_CZ.ts | 23 ++++++++++ imports/assets/translations/de_DE.ts | 23 ++++++++++ imports/assets/translations/en_GB.ts | 23 ++++++++++ imports/assets/translations/en_US.ts | 23 ++++++++++ imports/assets/translations/ja_JP.ts | 23 ++++++++++ imports/assets/translations/ko_KR.ts | 23 ++++++++++ imports/assets/translations/zh_CN.ts | 23 ++++++++++ sysui/about/About.qml | 7 +++ sysui/about/AboutStartup.qml | 87 ++++++++++++++++++++++++++++++++++++ 9 files changed, 255 insertions(+) create mode 100644 sysui/about/AboutStartup.qml diff --git a/imports/assets/translations/cs_CZ.ts b/imports/assets/translations/cs_CZ.ts index 0819be45..138a9e3c 100644 --- a/imports/assets/translations/cs_CZ.ts +++ b/imports/assets/translations/cs_CZ.ts @@ -33,6 +33,10 @@ UX na cestu Performance + + Startup + + AboutPerformance @@ -76,6 +80,25 @@ UX na cestu + + AboutStartup + + Startup timings not available. Make sure the environment variable AM_STARTUP_TIMER was set + + + + Startup timings: + + + + From boot to System UI process start: %1 ms + + + + From System UI process start to first frame drawn: %1 ms + + + AddWidgetPopup diff --git a/imports/assets/translations/de_DE.ts b/imports/assets/translations/de_DE.ts index e72171ef..322ce698 100644 --- a/imports/assets/translations/de_DE.ts +++ b/imports/assets/translations/de_DE.ts @@ -23,6 +23,10 @@ Performance + + Startup + + AboutPerformance @@ -66,6 +70,25 @@ + + AboutStartup + + Startup timings not available. Make sure the environment variable AM_STARTUP_TIMER was set + + + + Startup timings: + + + + From boot to System UI process start: %1 ms + + + + From System UI process start to first frame drawn: %1 ms + + + AddWidgetPopup diff --git a/imports/assets/translations/en_GB.ts b/imports/assets/translations/en_GB.ts index 230ce952..77cd2567 100644 --- a/imports/assets/translations/en_GB.ts +++ b/imports/assets/translations/en_GB.ts @@ -15,6 +15,10 @@ Performance + + Startup + + AboutPerformance @@ -58,6 +62,25 @@ + + AboutStartup + + Startup timings not available. Make sure the environment variable AM_STARTUP_TIMER was set + + + + Startup timings: + + + + From boot to System UI process start: %1 ms + + + + From System UI process start to first frame drawn: %1 ms + + + AddWidgetPopup diff --git a/imports/assets/translations/en_US.ts b/imports/assets/translations/en_US.ts index 3690e7a2..837d6e87 100644 --- a/imports/assets/translations/en_US.ts +++ b/imports/assets/translations/en_US.ts @@ -15,6 +15,10 @@ Performance + + Startup + + AboutPerformance @@ -58,6 +62,25 @@ + + AboutStartup + + Startup timings not available. Make sure the environment variable AM_STARTUP_TIMER was set + + + + Startup timings: + + + + From boot to System UI process start: %1 ms + + + + From System UI process start to first frame drawn: %1 ms + + + AddWidgetPopup diff --git a/imports/assets/translations/ja_JP.ts b/imports/assets/translations/ja_JP.ts index 9ae3c852..f7c6f4f8 100644 --- a/imports/assets/translations/ja_JP.ts +++ b/imports/assets/translations/ja_JP.ts @@ -23,6 +23,10 @@ Performance + + Startup + + AboutPerformance @@ -66,6 +70,25 @@ + + AboutStartup + + Startup timings not available. Make sure the environment variable AM_STARTUP_TIMER was set + + + + Startup timings: + + + + From boot to System UI process start: %1 ms + + + + From System UI process start to first frame drawn: %1 ms + + + AddWidgetPopup diff --git a/imports/assets/translations/ko_KR.ts b/imports/assets/translations/ko_KR.ts index 0c4f0911..207c1d50 100644 --- a/imports/assets/translations/ko_KR.ts +++ b/imports/assets/translations/ko_KR.ts @@ -23,6 +23,10 @@ Performance + + Startup + + AboutMarketing @@ -73,6 +77,25 @@ + + AboutStartup + + Startup timings not available. Make sure the environment variable AM_STARTUP_TIMER was set + + + + Startup timings: + + + + From boot to System UI process start: %1 ms + + + + From System UI process start to first frame drawn: %1 ms + + + AddWidgetPopup diff --git a/imports/assets/translations/zh_CN.ts b/imports/assets/translations/zh_CN.ts index b01eb7dd..2ef8b734 100644 --- a/imports/assets/translations/zh_CN.ts +++ b/imports/assets/translations/zh_CN.ts @@ -23,6 +23,10 @@ Performance + + Startup + + AboutMarketing @@ -73,6 +77,25 @@ + + AboutStartup + + Startup timings not available. Make sure the environment variable AM_STARTUP_TIMER was set + + + + Startup timings: + + + + From boot to System UI process start: %1 ms + + + + From System UI process start to first frame drawn: %1 ms + + + AddWidgetPopup diff --git a/sysui/about/About.qml b/sysui/about/About.qml index b662d059..8934ad45 100644 --- a/sysui/about/About.qml +++ b/sysui/about/About.qml @@ -92,6 +92,11 @@ NeptunePopup { text: qsTr("System") property string name: "system" } + TabButton { + Layout.preferredWidth: Style.hspan(4) + text: qsTr("Startup") + property string name: "startup" + } TabButton { Layout.preferredWidth: Style.hspan(4) text: qsTr("Running Apps") @@ -114,6 +119,8 @@ NeptunePopup { currentIndex: tabBar.currentIndex MonitorView { } + AboutStartup { + } AboutRunningApps { applicationModel: root.applicationModel } diff --git a/sysui/about/AboutStartup.qml b/sysui/about/AboutStartup.qml new file mode 100644 index 00000000..0fe3bd6d --- /dev/null +++ b/sysui/about/AboutStartup.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQml 2.2 + +import com.pelagicore.styles.neptune 3.0 +import utils 1.0 + +// TODO: Probably move this content to some other tab as there's not much going on here. +// NB: StartupTimer is injected by qtapplicationmanager into the root context, so no import is needed. +Item { + id: root + + // TODO: Make sure this title here matches the size and layout of ones from other tabs + // If we're going to keep this tab in the first place, that is + Label { + id: title + anchors.top: parent.top + anchors.topMargin: NeptuneStyle.dp(20) + anchors.left: parent.left + anchors.right: parent.right + horizontalAlignment: Text.AlignHCenter + text: qsTr("Startup timings:") + wrapMode: Text.Wrap + font.pixelSize: NeptuneStyle.fontSizeXL + font.bold: true + } + + readonly property bool hasStartupData: StartupTimer.timeToFirstFrame > 0 && StartupTimer.systemUpTime > 0 + Label { + id: upTimeLabel + anchors.top: title.bottom + anchors.topMargin: NeptuneStyle.dp(20) + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("From boot to System UI process start: %1 ms") + .arg(Number(StartupTimer.systemUpTime).toLocaleString(Qt.locale(), 'f', 0)) + visible: root.hasStartupData + } + Label { + anchors.left: parent.left + anchors.right: parent.right + anchors.top: upTimeLabel.bottom + text: qsTr("From System UI process start to first frame drawn: %1 ms") + .arg(Number(StartupTimer.timeToFirstFrame).toLocaleString(Qt.locale(), 'f', 0)) + visible: root.hasStartupData + } + Label { + anchors.top: title.bottom + anchors.topMargin: NeptuneStyle.dp(20) + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Startup timings not available. Make sure the environment variable AM_STARTUP_TIMER was set") + wrapMode: Text.Wrap + visible: !root.hasStartupData + } +} -- cgit v1.2.3