diff options
Diffstat (limited to 'indra/newview')
26 files changed, 103 insertions, 124 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 751b73e1eb..8d80e3aa0a 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1081,8 +1081,8 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) LLQuaternion av_inv_rot = ~gAgentAvatarp->mRoot.getWorldRotation(); LLVector3 root_at = LLVector3::x_axis * gAgentAvatarp->mRoot.getWorldRotation(); - if ((gViewerWindow->getMouseVelocityStat()->getCurrent() < 0.01f) && - (root_at * last_at_axis > 0.95f)) + if (LLTrace::get_frame_recording().getLastRecordingPeriod().getLastValue(*gViewerWindow->getMouseVelocityStat()) < 0.01f + && (root_at * last_at_axis > 0.95f)) { LLVector3 vel = gAgentAvatarp->getVelocity(); if (vel.magVecSquared() > 4.f) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 559f427de6..2d090f0f74 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4305,6 +4305,9 @@ void LLAppViewer::idle() update_statistics(); } + LLTrace::get_frame_recording().nextPeriod(); + + //////////////////////////////////////// // // Handle the regular UI idle callbacks as well as diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 4dfb93f1bc..065b20ba2b 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -46,7 +46,6 @@ #include "llviewertexturelist.h" #include "llui.h" #include "llviewercontrol.h" -#include "llstat.h" #include "llfasttimer.h" #include "lltreeiterators.h" diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index f7b2670b8e..e2813a8272 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -33,7 +33,7 @@ #include "llerror.h" #include "llrect.h" #include "llstring.h" -#include "llstat.h" +#include "lltrace.h" // project includes #include "lluictrlfactory.h" @@ -42,6 +42,16 @@ #include "llviewerjoystick.h" #include "llcheckboxctrl.h" +static LLTrace::Measurement<> sJoystickAxes[6] = +{ + LLTrace::Measurement<>("Joystick axis 1"), + LLTrace::Measurement<>("Joystick axis 2"), + LLTrace::Measurement<>("Joystick axis 3"), + LLTrace::Measurement<>("Joystick axis 4"), + LLTrace::Measurement<>("Joystick axis 5"), + LLTrace::Measurement<>("Joystick axis 6") +}; + LLFloaterJoystick::LLFloaterJoystick(const LLSD& data) : LLFloater(data) { @@ -61,7 +71,7 @@ void LLFloaterJoystick::draw() for (U32 i = 0; i < 6; i++) { F32 value = joystick->getJoystickAxis(i); - mAxisStats[i]->addValue(value * gFrameIntervalSeconds.value()); + sJoystickAxes[i].sample(value * gFrameIntervalSeconds.value()); if (mAxisStatsBar[i]) { F32 minbar, maxbar; @@ -85,12 +95,11 @@ BOOL LLFloaterJoystick::postBuild() for (U32 i = 0; i < 6; i++) { std::string stat_name(llformat("Joystick axis %d", i)); - mAxisStats[i] = new LLStat(stat_name, 4); std::string axisname = llformat("axis%d", i); mAxisStatsBar[i] = getChild<LLStatBar>(axisname); if (mAxisStatsBar[i]) { - mAxisStatsBar[i]->setStat(mAxisStats[i]); + mAxisStatsBar[i]->setStat(stat_name); mAxisStatsBar[i]->setRange(-range, range, range * 0.25f, range * 0.5f); } } diff --git a/indra/newview/llfloaterjoystick.h b/indra/newview/llfloaterjoystick.h index dfdb108ff8..9c3752540d 100644 --- a/indra/newview/llfloaterjoystick.h +++ b/indra/newview/llfloaterjoystick.h @@ -84,7 +84,6 @@ private: LLCheckBoxCtrl *mCheckFlycamEnabled; // stats view - LLStat* mAxisStats[6]; LLStatBar* mAxisStatsBar[6]; }; diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 482294c8a6..56fbdb429a 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -30,6 +30,7 @@ #include "llhudnametag.h" #include "llrender.h" +#include "lltracerecording.h" #include "llagent.h" #include "llviewercontrol.h" @@ -899,8 +900,8 @@ void LLHUDNameTag::updateAll() // } } - LLStat* camera_vel_stat = LLViewerCamera::getInstance()->getVelocityStat(); - F32 camera_vel = camera_vel_stat->getCurrent(); + LLTrace::Count<>* camera_vel_stat = LLViewerCamera::getVelocityStat(); + F32 camera_vel = LLTrace::get_frame_recording().getLastRecordingPeriod().getPerSec(*camera_vel_stat); if (camera_vel > MAX_STABLE_CAMERA_VELOCITY) { return; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 5720395d05..b945ec2318 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -198,7 +198,7 @@ BOOL LLStatusBar::postBuild() sgp.rect(r); sgp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); sgp.mouse_opaque(false); - sgp.stat.count_stat(&LLStatViewer::KBIT); + sgp.stat.count_stat_float(&LLStatViewer::KBIT); sgp.units("Kbps"); sgp.precision(0); mSGBandwidth = LLUICtrlFactory::create<LLStatGraph>(sgp); @@ -212,7 +212,7 @@ BOOL LLStatusBar::postBuild() pgp.rect(r); pgp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); pgp.mouse_opaque(false); - pgp.stat.measurement_stat(&LLStatViewer::PACKETS_LOST_PERCENT); + pgp.stat.measurement_stat_float(&LLStatViewer::PACKETS_LOST_PERCENT); pgp.units("%"); pgp.min(0.f); pgp.max(5.f); diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h index 9d24bf8771..33a64ae7d5 100644 --- a/indra/newview/llsurface.h +++ b/indra/newview/llsurface.h @@ -45,7 +45,6 @@ class LLTimer; class LLUUID; class LLAgent; -class LLStat; static const U8 NO_EDGE = 0x00; static const U8 EAST_EDGE = 0x01; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 2a72e77672..fa0e3acf5e 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -59,8 +59,8 @@ #include "llviewerstats.h" bool LLTextureFetchDebugger::sDebuggerEnabled = false ; -LLStat LLTextureFetch::sCacheHitRate("texture_cache_hits", 128); -LLStat LLTextureFetch::sCacheReadLatency("texture_cache_read_latency", 128); +LLTrace::Measurement<> LLTextureFetch::sCacheHitRate("texture_cache_hits"); +LLTrace::Measurement<> LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); ////////////////////////////////////////////////////////////////////////////// class LLTextureFetchWorker : public LLWorkerClass @@ -895,7 +895,7 @@ bool LLTextureFetchWorker::doWork(S32 param) LL_DEBUGS("Texture") << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize() << " Size: " << llformat("%dx%d",mFormattedImage->getWidth(),mFormattedImage->getHeight()) << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL; - LLTextureFetch::sCacheHitRate.addValue(100.f); + LLTextureFetch::sCacheHitRate.sample(100.f); } else { @@ -912,7 +912,7 @@ bool LLTextureFetchWorker::doWork(S32 param) } // fall through - LLTextureFetch::sCacheHitRate.addValue(0.f); + LLTextureFetch::sCacheHitRate.sample(0.f); } } @@ -2039,7 +2039,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, F32 cache_read_time = worker->mCacheReadTime; if (cache_read_time != 0.f) { - sCacheReadLatency.addValue(cache_read_time * 1000.f); + sCacheReadLatency.sample(cache_read_time * 1000.f); } res = true; LL_DEBUGS("Texture") << id << ": Request Finished. State: " << worker->mState << " Discard: " << discard_level << LL_ENDL; diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 7ffa58660e..4ec67c8cdb 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -35,8 +35,7 @@ #include "lltextureinfo.h" #include "llapr.h" #include "llimageworker.h" -#include "llstat.h" -//#include "lltexturecache.h" +#include "lltrace.h" class LLViewerTexture; class LLTextureFetchWorker; @@ -166,8 +165,8 @@ private: LLMutex mQueueMutex; //to protect mRequestMap and mCommands only LLMutex mNetworkQueueMutex; //to protect mNetworkQueue, mHTTPTextureQueue and mCancelQueue. - static LLStat sCacheHitRate; - static LLStat sCacheReadLatency; + static LLTrace::Measurement<> sCacheHitRate; + static LLTrace::Measurement<> sCacheReadLatency; LLTextureCache* mTextureCache; LLImageDecodeThread* mImageDecodeThread; diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index a437a8b3b5..831304f428 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -49,10 +49,14 @@ #include "llglheaders.h" #include "llquaternion.h" #include "llwindow.h" // getPixelAspectRatio() +#include "lltracerecording.h" // System includes #include <iomanip> // for setprecision +LLTrace::Count<> LLViewerCamera::sVelocityStat("camera_velocity"); +LLTrace::Count<> LLViewerCamera::sAngularVelocityStat("camera_angular_velocity"); + U32 LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; //glu pick matrix implementation borrowed from Mesa3D @@ -163,11 +167,12 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, F32 drot; rotation.getAngleAxis(&drot, &x, &y, &z); - mVelocityStat.addValue(dpos); - mAngularVelocityStat.addValue(drot); + sVelocityStat.add(dpos); + sAngularVelocityStat.add(drot); - mAverageSpeed = mVelocityStat.getMeanPerSec() ; - mAverageAngularSpeed = mAngularVelocityStat.getMeanPerSec() ; + LLTrace::Recording& recording = LLTrace::get_frame_recording().getTotalRecording(); + mAverageSpeed = LLTrace::get_frame_recording().getPeriodMeanPerSec(sVelocityStat); + mAverageAngularSpeed = LLTrace::get_frame_recording().getPeriodMeanPerSec(sAngularVelocityStat); mCosHalfCameraFOV = cosf(0.5f * getView() * llmax(1.0f, getAspect())); // update pixel meter ratio using default fov, not modified one diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index b857c7fe89..399eed7695 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -29,10 +29,10 @@ #include "llcamera.h" #include "llsingleton.h" -#include "llstat.h" #include "lltimer.h" #include "m4math.h" #include "llcoord.h" +#include "lltrace.h" class LLViewerObject; @@ -100,12 +100,12 @@ public: BOOL projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoordGL &out_point, const BOOL clamp = TRUE) const; BOOL projectPosAgentToScreenEdge(const LLVector3 &pos_agent, LLCoordGL &out_point) const; - const LLVector3* getVelocityDir() const {return &mVelocityDir;} - LLStat *getVelocityStat() { return &mVelocityStat; } - LLStat *getAngularVelocityStat() { return &mAngularVelocityStat; } - F32 getCosHalfFov() {return mCosHalfCameraFOV;} - F32 getAverageSpeed() {return mAverageSpeed ;} - F32 getAverageAngularSpeed() {return mAverageAngularSpeed;} + const LLVector3* getVelocityDir() const {return &mVelocityDir;} + static LLTrace::Count<>* getVelocityStat() {return &sVelocityStat; } + static LLTrace::Count<>* getAngularVelocityStat() {return &sAngularVelocityStat; } + F32 getCosHalfFov() {return mCosHalfCameraFOV;} + F32 getAverageSpeed() {return mAverageSpeed ;} + F32 getAverageAngularSpeed() {return mAverageAngularSpeed;} void getPixelVectors(const LLVector3 &pos_agent, LLVector3 &up, LLVector3 &right); LLVector3 roundToPixel(const LLVector3 &pos_agent); @@ -117,9 +117,9 @@ public: F32 getDefaultFOV() { return mCameraFOVDefault; } BOOL cameraUnderWater() const; - - const LLVector3 &getPointOfInterest() { return mLastPointOfInterest; } BOOL areVertsVisible(LLViewerObject* volumep, BOOL all_verts); + + const LLVector3 &getPointOfInterest() { return mLastPointOfInterest; } F32 getPixelMeterRatio() const { return mPixelMeterRatio; } S32 getScreenPixelArea() const { return mScreenPixelArea; } @@ -130,12 +130,12 @@ public: protected: void calcProjection(const F32 far_distance) const; - LLStat mVelocityStat; - LLStat mAngularVelocityStat; - LLVector3 mVelocityDir ; - F32 mAverageSpeed ; - F32 mAverageAngularSpeed ; + static LLTrace::Count<> sVelocityStat; + static LLTrace::Count<> sAngularVelocityStat; + LLVector3 mVelocityDir ; + F32 mAverageSpeed ; + F32 mAverageAngularSpeed ; mutable LLMatrix4 mProjectionMatrix; // Cache of perspective matrix mutable LLMatrix4 mModelviewMatrix; F32 mCameraFOVDefault; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 169b45c14e..41a08398bb 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -748,8 +748,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { LLFastTimer t(FTM_IMAGE_UPDATE_CLASS); - LLViewerTexture::updateClass(LLViewerCamera::getInstance()->getVelocityStat()->getMean(), - LLViewerCamera::getInstance()->getAngularVelocityStat()->getMean()); + LLTrace::Count<>* velocity_stat = LLViewerCamera::getVelocityStat(); + LLTrace::Count<>* angular_velocity_stat = LLViewerCamera::getAngularVelocityStat(); + LLViewerTexture::updateClass(LLTrace::get_frame_recording().getPeriodMeanPerSec(*velocity_stat), + LLTrace::get_frame_recording().getPeriodMeanPerSec(*angular_velocity_stat)); } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 82caa05983..acbe836c29 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4765,28 +4765,6 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) } } - /* - msg->getF32Fast(_PREHASH_Statistics, _PREHASH_PhysicsTimeDilation, time_dilation); - LLViewerStats::getInstance()->mSimTDStat.addValue(time_dilation); - - // Process information - // { CpuUsage F32 } - // { SimMemTotal F32 } - // { SimMemRSS F32 } - // { ProcessUptime F32 } - F32 cpu_usage; - F32 sim_mem_total; - F32 sim_mem_rss; - F32 process_uptime; - msg->getF32Fast(_PREHASH_Statistics, _PREHASH_CpuUsage, cpu_usage); - msg->getF32Fast(_PREHASH_Statistics, _PREHASH_SimMemTotal, sim_mem_total); - msg->getF32Fast(_PREHASH_Statistics, _PREHASH_SimMemRSS, sim_mem_rss); - msg->getF32Fast(_PREHASH_Statistics, _PREHASH_ProcessUptime, process_uptime); - LLViewerStats::getInstance()->mSimCPUUsageStat.addValue(cpu_usage); - LLViewerStats::getInstance()->mSimMemTotalStat.addValue(sim_mem_total); - LLViewerStats::getInstance()->mSimMemRSSStat.addValue(sim_mem_rss); - */ - // // Various hacks that aren't statistics, but are being handled here. // diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 14a2ac3384..9c6045943f 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -93,7 +93,7 @@ extern LLPipeline gPipeline; U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check. std::map<U64, U32> LLViewerObjectList::sIPAndPortToIndex; std::map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID; -LLStat LLViewerObjectList::sCacheHitRate("object_cache_hits", 128); +LLTrace::Measurement<> LLViewerObjectList::sCacheHitRate("object_cache_hits"); LLViewerObjectList::LLViewerObjectList() { @@ -520,7 +520,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, } justCreated = TRUE; mNumNewObjects++; - sCacheHitRate.addValue(cached ? 100.f : 0.f); + sCacheHitRate.sample(cached ? 100.f : 0.f); } diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 9936432a71..ca4110230f 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -31,8 +31,8 @@ #include <set> // common includes -#include "llstat.h" #include "llstring.h" +#include "lltrace.h" // project includes #include "llviewerobject.h" @@ -194,7 +194,7 @@ protected: std::vector<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects S32 mNumOrphans; - static LLStat sCacheHitRate; + static LLTrace::Measurement<> sCacheHitRate; typedef std::vector<LLPointer<LLViewerObject> > vobj_list_t; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 31e3820a21..652e0ee70b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -291,7 +291,9 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mCacheLoaded(FALSE), mCacheDirty(FALSE), mReleaseNotesRequested(FALSE), - mCapabilitiesReceived(false) + mCapabilitiesReceived(false), + mBitsReceived(0.f), + mPacketsReceived(0.f) { mWidth = region_width_meters; mImpl->mOriginGlobal = from_region_handle(handle); @@ -909,9 +911,8 @@ void LLViewerRegion::updateNetStats() mPacketsLost = cdp->getPacketsLost(); mPingDelay = cdp->getPingDelay(); - mBitStat.addValue(mBitsIn - mLastBitsIn); - mPacketsStat.addValue(mPacketsIn - mLastPacketsIn); - mPacketsLostStat.addValue(mPacketsLost); + mBitsReceived += mBitsIn - mLastBitsIn; + mPacketsReceived += mPacketsIn - mLastPacketsIn; } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index c9fffaf30e..756c0dc61f 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -34,7 +34,6 @@ #include "lldarray.h" #include "llwind.h" -#include "llstat.h" #include "v3dmath.h" #include "llstring.h" #include "llregionflags.h" @@ -351,9 +350,8 @@ public: LLWind mWind; LLViewerParcelOverlay *mParcelOverlay; - LLStat mBitStat; - LLStat mPacketsStat; - LLStat mPacketsLostStat; + F32 mBitsReceived; + F32 mPacketsReceived; LLMatrix4 mRenderMatrix; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 04b0c30b40..a42368cec4 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -94,8 +94,8 @@ LLTrace::Count<LLTrace::Kilobits> KBIT("kbitstat"), OBJECT_KBIT("objectkbitstat"), ASSET_KBIT("assetkbitstat"), TEXTURE_KBIT("texturekbitstat"), - ACTUAL_IN_KBIT("actualinkbit"), - ACTUAL_OUT_KBIT("actualoutkbit"); + ACTUAL_IN_KBIT("actualinkbitstat"), + ACTUAL_OUT_KBIT("actualoutkbitstat"); LLTrace::Count<LLTrace::Seconds> AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), @@ -276,20 +276,25 @@ void LLViewerStats::addToMessage(LLSD &body) const // *NOTE:Mani The following methods used to exist in viewer.cpp // Moving them here, but not merging them into LLViewerStats yet. -U32 gTotalLandIn = 0, gTotalLandOut = 0; -U32 gTotalWaterIn = 0, gTotalWaterOut = 0; - -F32 gAveLandCompression = 0.f, gAveWaterCompression = 0.f; -F32 gBestLandCompression = 1.f, gBestWaterCompression = 1.f; -F32 gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; +U32 gTotalLandIn = 0, + gTotalLandOut = 0, + gTotalWaterIn = 0, + gTotalWaterOut = 0; + +F32 gAveLandCompression = 0.f, + gAveWaterCompression = 0.f, + gBestLandCompression = 1.f, + gBestWaterCompression = 1.f, + gWorstLandCompression = 0.f, + gWorstWaterCompression = 0.f; LLUnit::Bytes<U32> gTotalWorldData = 0, gTotalObjectData = 0, gTotalTextureData = 0; -U32 gSimPingCount = 0; +U32 gSimPingCount = 0; LLUnit::Bits<U32> gObjectData = 0; -F32 gAvgSimPing = 0.f; -LLUnit::Bytes<U32> gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +F32 gAvgSimPing = 0.f; +LLUnit::Bytes<U32> gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; extern U32 gVisCompared; extern U32 gVisTested; @@ -334,13 +339,13 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - LLStatViewer::SIM_PING.sample<LLTrace::Seconds>(cdp->getPingDelay()); + LLStatViewer::SIM_PING.sample<LLTrace::Milliseconds>(cdp->getPingDelay()); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - LLStatViewer::SIM_PING.sample<LLTrace::Seconds>(10000); + LLStatViewer::SIM_PING.sample<LLTrace::Seconds>(10); } LLStatViewer::FPS.add(1); @@ -390,8 +395,6 @@ void update_statistics() texture_stats_timer.reset(); } } - - LLTrace::get_frame_recording().nextPeriod(); } class ViewerStatsResponder : public LLHTTPClient::Responder diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 34731481f5..eda7b3329d 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -27,7 +27,6 @@ #ifndef LL_LLVIEWERSTATS_H #define LL_LLVIEWERSTATS_H -#include "llstat.h" #include "llstatenums.h" #include "lltextureinfo.h" #include "lltracerecording.h" diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index a00f48b5a2..e3df71cca2 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -30,7 +30,6 @@ #include "lluuid.h" //#include "message.h" #include "llgl.h" -#include "llstat.h" #include "llviewertexture.h" #include "llui.h" #include <list> diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 06daf15c08..b7415669bb 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -77,7 +77,6 @@ #include "llmediaentry.h" #include "llurldispatcher.h" #include "raytrace.h" -#include "llstat.h" // newview includes #include "llagent.h" @@ -249,6 +248,9 @@ std::string LLViewerWindow::sSnapshotDir; std::string LLViewerWindow::sMovieBaseName; +LLTrace::Measurement<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity"); + + class RecordToChatConsole : public LLError::Recorder, public LLSingleton<RecordToChatConsole> { public: @@ -1541,8 +1543,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) mResDirty(false), mStatesDirty(false), mCurrResolutionIndex(0), - mProgressView(NULL), - mMouseVelocityStat(new LLStat("Mouse Velocity")) + mProgressView(NULL) { // gKeyboard is still NULL, so it doesn't do LLWindowListener any good to // pass its value right now. Instead, pass it a nullary function that @@ -2072,8 +2073,6 @@ LLViewerWindow::~LLViewerWindow() delete mDebugText; mDebugText = NULL; - - delete mMouseVelocityStat; } @@ -3247,7 +3246,7 @@ void LLViewerWindow::updateMouseDelta() mouse_vel.setVec((F32) dx, (F32) dy); } - mMouseVelocityStat->addValue(mouse_vel.magVec()); + sMouseVelocityStat.sample(mouse_vel.magVec()); } void LLViewerWindow::updateKeyboardFocus() diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 5f475fe145..be2d6d885e 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -44,12 +44,12 @@ #include "llmousehandler.h" #include "llhandle.h" #include "llinitparam.h" +#include "lltrace.h" #include <boost/function.hpp> #include <boost/signals2.hpp> #include <boost/scoped_ptr.hpp> -class LLStat; class LLView; class LLViewerObject; class LLUUID; @@ -250,7 +250,7 @@ public: S32 getCurrentMouseDX() const { return mCurrentMouseDelta.mX; } S32 getCurrentMouseDY() const { return mCurrentMouseDelta.mY; } LLCoordGL getCurrentMouseDelta() const { return mCurrentMouseDelta; } - LLStat* getMouseVelocityStat() { return mMouseVelocityStat; } + static LLTrace::Measurement<>* getMouseVelocityStat() { return &sMouseVelocityStat; } BOOL getLeftMouseDown() const { return mLeftMouseDown; } BOOL getMiddleMouseDown() const { return mMiddleMouseDown; } BOOL getRightMouseDown() const { return mRightMouseDown; } @@ -427,7 +427,6 @@ private: LLCoordGL mCurrentMousePoint; // last mouse position in GL coords LLCoordGL mLastMousePoint; // Mouse point at last frame. LLCoordGL mCurrentMouseDelta; //amount mouse moved this frame - LLStat* mMouseVelocityStat; BOOL mLeftMouseDown; BOOL mMiddleMouseDown; BOOL mRightMouseDown; @@ -482,6 +481,8 @@ private: // Object temporarily hovered over while dragging LLPointer<LLViewerObject> mDragHoveredObject; + + static LLTrace::Measurement<> sMouseVelocityStat; }; // diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 97c1b07ebc..3c1f8ca6b0 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4318,8 +4318,6 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) //-------------------------------------------------------------------- // render all geometry attached to the skeleton //-------------------------------------------------------------------- - static LLStat render_stat; - LLViewerJointMesh::sRenderPass = pass; if (pass == AVATAR_RENDER_PASS_SINGLE) @@ -4372,10 +4370,6 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) LLViewerJointMesh::sRenderPass = AVATAR_RENDER_PASS_SINGLE; - //llinfos << "Avatar render: " << render_timer.getElapsedTimeF32() << llendl; - - //render_stat.addValue(render_timer.getElapsedTimeF32()*1000.f); - return num_indices; } diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index dced5a847b..e140f3b23b 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -692,8 +692,10 @@ void LLWorld::updateNetStats() { LLViewerRegion* regionp = *iter; regionp->updateNetStats(); - bits += regionp->mBitStat.getCurrent(); - packets += llfloor( regionp->mPacketsStat.getCurrent() ); + bits += regionp->mBitsReceived; + packets += llfloor( regionp->mPacketsReceived ); + regionp->mBitsReceived = 0.f; + regionp->mPacketsReceived = 0.f; } S32 packets_in = gMessageSystem->mPacketsIn - mLastPacketsIn; @@ -705,26 +707,15 @@ void LLWorld::updateNetStats() LLStatViewer::ACTUAL_IN_KBIT.add<LLTrace::Bits>(actual_in_bits); LLStatViewer::ACTUAL_OUT_KBIT.add<LLTrace::Bits>(actual_out_bits); - //LLViewerStats::getInstance()->mActualInKBitStat.addValue(actual_in_bits/1024.f); - //LLViewerStats::getInstance()->mActualOutKBitStat.addValue(actual_out_bits/1024.f); LLStatViewer::KBIT.add<LLTrace::Bits>(bits); - //LLViewerStats::getInstance()->mKBitStat.addValue(bits/1024.f); LLStatViewer::PACKETS_IN.add(packets_in); LLStatViewer::PACKETS_OUT.add(packets_out); LLStatViewer::PACKETS_LOST.add(packets_lost); LLStatViewer::PACKETS_LOST_PERCENT.sample(100.f*((F32)packets_lost/(F32)packets_in)); - //LLViewerStats::getInstance()->mPacketsInStat.addValue(packets_in); - //LLViewerStats::getInstance()->mPacketsOutStat.addValue(packets_out); - //LLViewerStats::getInstance()->mPacketsLostStat.addValue(gMessageSystem->mDroppedPackets); if (packets_in) { LLStatViewer::PACKETS_LOST_PERCENT.sample(100.f*((F32)packets_lost/(F32)packets_in)); - // LLViewerStats::getInstance()->mPacketsLostPercentStat.addValue(100.f*((F32)packets_lost/(F32)packets_in)); } - //else - //{ - // LLViewerStats::getInstance()->mPacketsLostPercentStat.addValue(0.f); - //} mLastPacketsIn = gMessageSystem->mPacketsIn; mLastPacketsOut = gMessageSystem->mPacketsOut; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 75af605ad7..1e050d2588 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -488,7 +488,6 @@ void LLPipeline::init() getPool(LLDrawPool::POOL_BUMP); getPool(LLDrawPool::POOL_GLOW); - //LLViewerStats::getInstance()->mTrianglesDrawnStat.reset(); resetFrameStats(); for (U32 i = 0; i < NUM_RENDER_TYPES; ++i) @@ -1769,7 +1768,6 @@ void LLPipeline::resetFrameStats() assertInitialized(); LLStatViewer::TRIANGLES_DRAWN.add(mTrianglesDrawn); - //LLViewerStats::getInstance()->mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f); if (mBatchCount > 0) { @@ -9756,7 +9754,9 @@ void LLPipeline::generateSunShadow(LLCamera& camera) if (gen_shadow) { - F32 fade_amt = gFrameIntervalSeconds.value() * llmax(LLViewerCamera::getInstance()->getVelocityStat()->getCurrentPerSec(), 1.f); + LLTrace::Measurement<>* velocity_stat = LLViewerCamera::getVelocityStat(); + F32 fade_amt = gFrameIntervalSeconds.value() + * llmax(LLTrace::get_frame_recording().getLastRecordingPeriod().getLastValue(*velocity_stat), 1.0); //update shadow targets for (U32 i = 0; i < 2; i++) |