diff options
Diffstat (limited to 'indra/newview/llviewerstatsrecorder.cpp')
-rwxr-xr-x | indra/newview/llviewerstatsrecorder.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index 3ff2dfa4fe..2b3e293229 100755 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -166,6 +166,7 @@ void LLViewerStatsRecorder::recordRequestCacheMissesEvent(S32 count) void LLViewerStatsRecorder::writeToLog( F32 interval ) { + size_t data_size = 0; F64 delta_time = LLTimer::getTotalSeconds() - mLastSnapshotTime; S32 total_objects = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures; @@ -216,10 +217,10 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "Texture Fetch bps\t" << "\n"; - size_t data_size = data_msg.str().size(); - if ( data_size != fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile )) + data_size = data_msg.str().size(); + if (fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile ) != data_size) { - llwarns << "Unable to write complete column headings to " << STATS_FILE_NAME << llendl; + llwarns << "failed to write full headers to " << STATS_FILE_NAME << llendl; } } else @@ -253,11 +254,12 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "\t" << (mTextureFetchSize * 8 / delta_time) << "\n"; - size_t data_size = data_msg.str().size(); + data_size = data_msg.str().size(); if ( data_size != fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile )) { llwarns << "Unable to write complete column data to " << STATS_FILE_NAME << llendl; } + clearStats(); } |