cleanup - renamed valueAs to valueInUnits and made it a symmetrical getter/setter
parent
e87ba58755
commit
bd5808765f
|
|
@ -397,7 +397,7 @@ void TimeBlock::dumpCurTimes()
|
|||
}
|
||||
|
||||
out_str << timerp->getName() << " "
|
||||
<< std::setprecision(3) << total_time.valueAs<LLUnits::Milliseconds>() << " ms, "
|
||||
<< std::setprecision(3) << total_time.valueInUnits<LLUnits::Milliseconds>() << " ms, "
|
||||
<< num_calls << " calls";
|
||||
|
||||
llinfos << out_str.str() << llendl;
|
||||
|
|
|
|||
|
|
@ -74,10 +74,21 @@ struct LLUnit
|
|||
return mValue;
|
||||
}
|
||||
|
||||
template<typename NEW_UNIT_TYPE>
|
||||
STORAGE_TYPE valueAs()
|
||||
void value(storage_t value)
|
||||
{
|
||||
return LLUnit<STORAGE_TYPE, NEW_UNIT_TYPE>(*this).value();
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
template<typename NEW_UNIT_TYPE>
|
||||
storage_t valueInUnits()
|
||||
{
|
||||
return LLUnit<storage_t, NEW_UNIT_TYPE>(*this).value();
|
||||
}
|
||||
|
||||
template<typename NEW_UNIT_TYPE>
|
||||
void valueInUnits(storage_t value)
|
||||
{
|
||||
*this = LLUnit<storage_t, NEW_UNIT_TYPE>(value);
|
||||
}
|
||||
|
||||
void operator += (storage_t value)
|
||||
|
|
|
|||
|
|
@ -1427,7 +1427,7 @@ void LLFastTimerView::updateTotalTime()
|
|||
break;
|
||||
}
|
||||
|
||||
mTotalTimeDisplay = LLUnits::Milliseconds::fromValue(llceil(mTotalTimeDisplay.valueAs<LLUnits::Milliseconds>() / 20.f) * 20.f);
|
||||
mTotalTimeDisplay = LLUnits::Milliseconds::fromValue(llceil(mTotalTimeDisplay.valueInUnits<LLUnits::Milliseconds>() / 20.f) * 20.f);
|
||||
}
|
||||
|
||||
void LLFastTimerView::drawBars()
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
|
|||
|
||||
for (S32 frame = 1; frame <= frame_count; frame++)
|
||||
{
|
||||
os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMax(*it).valueAs<LLUnits::Kibibytes>();
|
||||
os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMax(*it).valueInUnits<LLUnits::Kibibytes>();
|
||||
}
|
||||
|
||||
os << '\n';
|
||||
|
|
|
|||
|
|
@ -200,11 +200,11 @@ LLSD LLTextureInfo::getAverages()
|
|||
}
|
||||
else
|
||||
{
|
||||
averageDownloadRate = mRecording.getSum(sTextureDataDownloaded).valueAs<LLUnits::Bits>() / download_time.valueAs<LLUnits::Seconds>();
|
||||
averageDownloadRate = mRecording.getSum(sTextureDataDownloaded).valueInUnits<LLUnits::Bits>() / download_time.valueInUnits<LLUnits::Seconds>();
|
||||
}
|
||||
|
||||
averagedTextureData["bits_per_second"] = averageDownloadRate;
|
||||
averagedTextureData["bytes_downloaded"] = mRecording.getSum(sTextureDataDownloaded).valueAs<LLUnits::Bytes>();
|
||||
averagedTextureData["bytes_downloaded"] = mRecording.getSum(sTextureDataDownloaded).valueInUnits<LLUnits::Bytes>();
|
||||
averagedTextureData["texture_downloads_started"] = mRecording.getSum(sTextureDownloadsStarted);
|
||||
averagedTextureData["texture_downloads_completed"] = mRecording.getSum(sTextureDownloadsCompleted);
|
||||
averagedTextureData["transport"] = mTextureDownloadProtocol;
|
||||
|
|
|
|||
Loading…
Reference in New Issue