From dc5d5cbb63ca70b0957b65c0cb6091c79486760a Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 25 Aug 2015 15:06:40 -0700 Subject: [PATCH] Add asset server ping to stats --- interface/resources/qml/Stats.qml | 149 +++++++++++++++--------------- interface/src/ui/Stats.cpp | 2 + interface/src/ui/Stats.h | 2 + 3 files changed, 81 insertions(+), 72 deletions(-) diff --git a/interface/resources/qml/Stats.qml b/interface/resources/qml/Stats.qml index b7081afadf..878d784bdf 100644 --- a/interface/resources/qml/Stats.qml +++ b/interface/resources/qml/Stats.qml @@ -28,39 +28,39 @@ Item { anchors.fill: parent onClicked: { root.expanded = !root.expanded; } } - + Column { id: generalCol spacing: 4; x: 4; y: 4; - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize text: "Servers: " + root.serverCount } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - text: "Avatars: " + root.avatarCount + text: "Avatars: " + root.avatarCount } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - text: "Framerate: " + root.framerate + text: "Framerate: " + root.framerate } Text { color: root.fontColor; font.pixelSize: root.fontSize text: "Simrate: " + root.simrate } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - text: "Packets In/Out: " + root.packetInCount + "/" + root.packetOutCount + text: "Packets In/Out: " + root.packetInCount + "/" + root.packetOutCount } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - text: "Mbps In/Out: " + root.mbpsIn.toFixed(2) + "/" + root.mbpsOut.toFixed(2) + text: "Mbps In/Out: " + root.mbpsIn.toFixed(2) + "/" + root.mbpsOut.toFixed(2) } } } @@ -77,30 +77,35 @@ Item { Column { id: pingCol spacing: 4; x: 4; y: 4; - Text { + Text { color: root.fontColor font.pixelSize: root.fontSize - text: "Audio ping: " + root.audioPing + text: "Audio ping: " + root.audioPing } - Text { + Text { color: root.fontColor font.pixelSize: root.fontSize - text: "Avatar ping: " + root.avatarPing + text: "Avatar ping: " + root.avatarPing } - Text { + Text { color: root.fontColor font.pixelSize: root.fontSize - text: "Entities avg ping: " + root.entitiesPing + text: "Entities avg ping: " + root.entitiesPing } - Text { + Text { color: root.fontColor font.pixelSize: root.fontSize - visible: root.expanded; + text: "Asset ping: " + root.assetPing + } + Text { + color: root.fontColor + font.pixelSize: root.fontSize + visible: root.expanded; text: "Voxel max ping: " + 0 } } } - + Rectangle { width: geoCol.width + 8 height: geoCol.height + 8 @@ -112,34 +117,34 @@ Item { Column { id: geoCol spacing: 4; x: 4; y: 4; - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - text: "Position: " + root.position.x.toFixed(1) + ", " + - root.position.y.toFixed(1) + ", " + root.position.z.toFixed(1) + text: "Position: " + root.position.x.toFixed(1) + ", " + + root.position.y.toFixed(1) + ", " + root.position.z.toFixed(1) } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - text: "Velocity: " + root.velocity.toFixed(1) + text: "Velocity: " + root.velocity.toFixed(1) } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - text: "Yaw: " + root.yaw.toFixed(1) + text: "Yaw: " + root.yaw.toFixed(1) } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - visible: root.expanded; - text: "Avatar Mixer: " + root.avatarMixerKbps + " kbps, " + - root.avatarMixerPps + "pps"; + visible: root.expanded; + text: "Avatar Mixer: " + root.avatarMixerKbps + " kbps, " + + root.avatarMixerPps + "pps"; } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - visible: root.expanded; - text: "Downloads: "; + visible: root.expanded; + text: "Downloads: "; } } } @@ -154,72 +159,72 @@ Item { Column { id: octreeCol spacing: 4; x: 4; y: 4; - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - text: "Triangles: " + root.triangles + - " / Quads: " + root.quads + " / Material Switches: " + root.materialSwitches + text: "Triangles: " + root.triangles + + " / Quads: " + root.quads + " / Material Switches: " + root.materialSwitches } - Text { - color: root.fontColor; - font.pixelSize: root.fontSize - visible: root.expanded; - text: "\tMesh Parts Rendered Opaque: " + root.meshOpaque + - " / Translucent: " + root.meshTranslucent; - } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize visible: root.expanded; - text: "\tOpaque considered: " + root.opaqueConsidered + - " / Out of view: " + root.opaqueOutOfView + " / Too small: " + root.opaqueTooSmall; + text: "\tMesh Parts Rendered Opaque: " + root.meshOpaque + + " / Translucent: " + root.meshTranslucent; } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - visible: !root.expanded - text: "Octree Elements Server: " + root.serverElements + - " Local: " + root.localElements; + visible: root.expanded; + text: "\tOpaque considered: " + root.opaqueConsidered + + " / Out of view: " + root.opaqueOutOfView + " / Too small: " + root.opaqueTooSmall; } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - visible: root.expanded - text: "Octree Sending Mode: " + root.sendingMode; + visible: !root.expanded + text: "Octree Elements Server: " + root.serverElements + + " Local: " + root.localElements; } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - visible: root.expanded - text: "Octree Packets to Process: " + root.packetStats; + visible: root.expanded + text: "Octree Sending Mode: " + root.sendingMode; } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - visible: root.expanded - text: "Octree Elements - "; + visible: root.expanded + text: "Octree Packets to Process: " + root.packetStats; } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - visible: root.expanded - text: "\tServer: " + root.serverElements + - " Internal: " + root.serverInternal + - " Leaves: " + root.serverLeaves; + visible: root.expanded + text: "Octree Elements - "; } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - visible: root.expanded - text: "\tLocal: " + root.localElements + - " Internal: " + root.localInternal + - " Leaves: " + root.localLeaves; + visible: root.expanded + text: "\tServer: " + root.serverElements + + " Internal: " + root.serverInternal + + " Leaves: " + root.serverLeaves; } - Text { + Text { color: root.fontColor; font.pixelSize: root.fontSize - visible: root.expanded - text: "LOD: " + root.lodStatus; + visible: root.expanded + text: "\tLocal: " + root.localElements + + " Internal: " + root.localInternal + + " Leaves: " + root.localLeaves; + } + Text { + color: root.fontColor; + font.pixelSize: root.fontSize + visible: root.expanded + text: "LOD: " + root.lodStatus; } } } diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index 74e3a8f44f..74e6452d7f 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -126,8 +126,10 @@ void Stats::updateStats() { if (Menu::getInstance()->isOptionChecked(MenuOption::TestPing)) { SharedNodePointer audioMixerNode = nodeList->soloNodeOfType(NodeType::AudioMixer); SharedNodePointer avatarMixerNode = nodeList->soloNodeOfType(NodeType::AvatarMixer); + SharedNodePointer assetServerNode = nodeList->soloNodeOfType(NodeType::AssetServer); STAT_UPDATE(audioPing, audioMixerNode ? audioMixerNode->getPingMs() : -1); STAT_UPDATE(avatarPing, avatarMixerNode ? avatarMixerNode->getPingMs() : -1); + STAT_UPDATE(assetPing, assetServerNode ? assetServerNode->getPingMs() : -1); //// Now handle voxel servers, since there could be more than one, we average their ping times unsigned long totalPingOctree = 0; diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index 4f0619d9c8..096469a84d 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -39,6 +39,7 @@ class Stats : public QQuickItem { STATS_PROPERTY(int, audioPing, 0) STATS_PROPERTY(int, avatarPing, 0) STATS_PROPERTY(int, entitiesPing, 0) + STATS_PROPERTY(int, assetPing, 0) STATS_PROPERTY(QVector3D, position, QVector3D(0, 0, 0) ) STATS_PROPERTY(float, velocity, 0) STATS_PROPERTY(float, yaw, 0) @@ -105,6 +106,7 @@ signals: void audioPingChanged(); void avatarPingChanged(); void entitiesPingChanged(); + void assetPingChanged(); void positionChanged(); void velocityChanged(); void yawChanged();