From 11eabf3c5137b3a52274708e51bfb8a584934694 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 18 Jul 2013 15:14:11 -0700 Subject: [PATCH] more stats --- libraries/voxels/src/VoxelSceneStats.cpp | 52 ++++++++++++++++++++++++ libraries/voxels/src/VoxelSceneStats.h | 12 ++++++ 2 files changed, 64 insertions(+) diff --git a/libraries/voxels/src/VoxelSceneStats.cpp b/libraries/voxels/src/VoxelSceneStats.cpp index 44c10e2bf9..254f099e3f 100644 --- a/libraries/voxels/src/VoxelSceneStats.cpp +++ b/libraries/voxels/src/VoxelSceneStats.cpp @@ -67,6 +67,18 @@ void VoxelSceneStats::reset() { _internalDidntFit = 0; _leavesDidntFit = 0; + _colorBitsWritten = 0; + _internalColorBitsWritten = 0; + _leavesColorBitsWritten = 0; + + _existsBitsWritten = 0; + _internalExistsBitsWritten = 0; + _leavesExistsBitsWritten = 0; + + _existsInPacketBitsWritten = 0; + _internalExistsInPacketBitsWritten = 0; + _leavesExistsInPacketBitsWritten = 0; + } void VoxelSceneStats::packetSent(int bytes) { @@ -146,6 +158,35 @@ void VoxelSceneStats::didntFit(const VoxelNode* node) { } } +void VoxelSceneStats::colorBitsWritten(const VoxelNode* node) { + _colorBitsWritten++; + if (node->isLeaf()) { + _leavesColorBitsWritten++; + } else { + _internalColorBitsWritten++; + } +} + +void VoxelSceneStats::existsBitsWritten(const VoxelNode* node) { + _existsBitsWritten++; + if (node->isLeaf()) { + _leavesExistsBitsWritten++; + } else { + _internalExistsBitsWritten++; + } +} + +void VoxelSceneStats::existsInPacketBitsWritten(const VoxelNode* node) { + _existsInPacketBitsWritten++; + if (node->isLeaf()) { + _leavesExistsInPacketBitsWritten++; + } else { + _internalExistsInPacketBitsWritten++; + } +} + + + void VoxelSceneStats::printDebugDetails() { qDebug("\n------------------------------\n"); qDebug("VoxelSceneStats:\n"); @@ -177,10 +218,21 @@ void VoxelSceneStats::printDebugDetails() { qDebug(" skipped occluded : %lu\n", _skippedOccluded ); qDebug(" internal : %lu\n", _internalSkippedOccluded ); qDebug(" leaves : %lu\n", _leavesSkippedOccluded ); + + qDebug("\n"); qDebug(" color sent : %lu\n", _colorSent ); qDebug(" internal : %lu\n", _internalColorSent ); qDebug(" leaves : %lu\n", _leavesColorSent ); qDebug(" Didn't Fit : %lu\n", _didntFit ); qDebug(" internal : %lu\n", _internalDidntFit ); qDebug(" leaves : %lu\n", _leavesDidntFit ); + qDebug(" color bits : %lu\n", _colorBitsWritten ); + qDebug(" internal : %lu\n", _internalColorBitsWritten ); + qDebug(" leaves : %lu\n", _leavesColorBitsWritten ); + qDebug(" exists bits : %lu\n", _existsBitsWritten ); + qDebug(" internal : %lu\n", _internalExistsBitsWritten); + qDebug(" leaves : %lu\n", _leavesExistsBitsWritten ); + qDebug(" in packet bit : %lu\n", _existsInPacketBitsWritten ); + qDebug(" internal : %lu\n", _internalExistsInPacketBitsWritten); + qDebug(" leaves : %lu\n", _leavesExistsInPacketBitsWritten ); } diff --git a/libraries/voxels/src/VoxelSceneStats.h b/libraries/voxels/src/VoxelSceneStats.h index d41091ae80..29461996b3 100644 --- a/libraries/voxels/src/VoxelSceneStats.h +++ b/libraries/voxels/src/VoxelSceneStats.h @@ -74,6 +74,18 @@ private: unsigned long _internalDidntFit; unsigned long _leavesDidntFit; + unsigned long _colorBitsWritten; + unsigned long _internalColorBitsWritten; + unsigned long _leavesColorBitsWritten; + + unsigned long _existsBitsWritten; + unsigned long _internalExistsBitsWritten; + unsigned long _leavesExistsBitsWritten; + + unsigned long _existsInPacketBitsWritten; + unsigned long _internalExistsInPacketBitsWritten; + unsigned long _leavesExistsInPacketBitsWritten; + unsigned long total; unsigned long internalOutOfView; unsigned long internalOccluded;