From 43a4253689db86877fe815d46310ce8fdfb75087 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 10 Nov 2013 12:23:44 -0800 Subject: [PATCH] added interface points to VoxelScriptingInterface to access stats from _voxelPacketSender --- .../src/voxels/VoxelScriptingInterface.cpp | 4 -- .../src/voxels/VoxelScriptingInterface.h | 40 ++++++++++++++++++- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/assignment-client/src/voxels/VoxelScriptingInterface.cpp b/assignment-client/src/voxels/VoxelScriptingInterface.cpp index 687b0fe0b8..1801c621c4 100644 --- a/assignment-client/src/voxels/VoxelScriptingInterface.cpp +++ b/assignment-client/src/voxels/VoxelScriptingInterface.cpp @@ -42,7 +42,3 @@ void VoxelScriptingInterface::queueVoxelDelete(float x, float y, float z, float _voxelPacketSender.queueVoxelEditMessages(PACKET_TYPE_ERASE_VOXEL, 1, &deleteVoxelDetail); } - -int VoxelScriptingInterface::packetsToSendCount() const { - return _voxelPacketSender.packetsToSendCount(); -} diff --git a/assignment-client/src/voxels/VoxelScriptingInterface.h b/assignment-client/src/voxels/VoxelScriptingInterface.h index 60a4fbc0b1..79fde44866 100644 --- a/assignment-client/src/voxels/VoxelScriptingInterface.h +++ b/assignment-client/src/voxels/VoxelScriptingInterface.h @@ -50,8 +50,44 @@ public slots: /// \param scale the scale of the voxel (in VS space) void queueVoxelDelete(float x, float y, float z, float scale); - /// get the current number of pending, queued, but unsent packets - int packetsToSendCount() const; + /// does a voxel server exist to send to + bool voxelServersExist() const { return _voxelPacketSender.voxelServersExist(); } + + /// are there packets waiting in the send queue to be sent + bool hasPacketsToSend() const { return _voxelPacketSender.hasPacketsToSend(); } + + /// how many packets are there in the send queue waiting to be sent + int packetsToSendCount() const { return _voxelPacketSender.packetsToSendCount(); } + + /// returns the packets per second send rate of this object over its lifetime + float getLifetimePPS() const { return _voxelPacketSender.getLifetimePPS(); } + + /// returns the bytes per second send rate of this object over its lifetime + float getLifetimeBPS() const { return _voxelPacketSender.getLifetimeBPS(); } + + /// returns the packets per second queued rate of this object over its lifetime + float getLifetimePPSQueued() const { return _voxelPacketSender.getLifetimePPSQueued(); } + + /// returns the bytes per second queued rate of this object over its lifetime + float getLifetimeBPSQueued() const { return _voxelPacketSender.getLifetimeBPSQueued(); } + + /// returns lifetime of this object from first packet sent to now in usecs + long long unsigned int getLifetimeInUsecs() const { return _voxelPacketSender.getLifetimeInUsecs(); } + + /// returns lifetime of this object from first packet sent to now in usecs + float getLifetimeInSeconds() const { return _voxelPacketSender.getLifetimeInSeconds(); } + + /// returns the total packets sent by this object over its lifetime + long long unsigned int getLifetimePacketsSent() const { return _voxelPacketSender.getLifetimePacketsSent(); } + + /// returns the total bytes sent by this object over its lifetime + long long unsigned int getLifetimeBytesSent() const { return _voxelPacketSender.getLifetimeBytesSent(); } + + /// returns the total packets queued by this object over its lifetime + long long unsigned int getLifetimePacketsQueued() const { return _voxelPacketSender.getLifetimePacketsQueued(); } + + /// returns the total bytes queued by this object over its lifetime + long long unsigned int getLifetimeBytesQueued() const { return _voxelPacketSender.getLifetimeBytesQueued(); } private: /// attached VoxelEditPacketSender that handles queuing and sending of packets to VS