diff options
author | Richard Linden <none@none> | 2013-08-18 22:30:27 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-08-18 22:30:27 -0700 |
commit | 612892b45a3413b16e40c49d3bfde77a4ca927fd (patch) | |
tree | 2272a24c7f0a8354791f74c7485a376abb377f67 /indra/llmessage | |
parent | f8e3a34348ab98ecd56d53360b8f2b6512ad6bba (diff) |
SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms
continued conversion to units system
made units perform type promotion correctly and preserve type in arithmetic
e.g. can now do LLVector3 in units
added typedefs for remaining common unit types, including implicits
Diffstat (limited to 'indra/llmessage')
-rwxr-xr-x | indra/llmessage/llassetstorage.cpp | 8 | ||||
-rwxr-xr-x | indra/llmessage/llassetstorage.h | 12 | ||||
-rwxr-xr-x | indra/llmessage/llcircuit.cpp | 32 | ||||
-rwxr-xr-x | indra/llmessage/llcircuit.h | 4 | ||||
-rwxr-xr-x | indra/llmessage/llhttpassetstorage.cpp | 4 | ||||
-rwxr-xr-x | indra/llmessage/llhttpassetstorage.h | 4 | ||||
-rwxr-xr-x | indra/llmessage/llpacketack.h | 2 | ||||
-rwxr-xr-x | indra/llmessage/llthrottle.cpp | 8 | ||||
-rwxr-xr-x | indra/llmessage/message.cpp | 18 | ||||
-rwxr-xr-x | indra/llmessage/message.h | 2 |
10 files changed, 47 insertions, 47 deletions
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index 413266a29d..94552750f4 100755 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -1405,7 +1405,7 @@ void LLAssetStorage::storeAssetData( bool is_priority, bool store_local, bool user_waiting, - F64 timeout) + F64Seconds timeout) { LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call @@ -1424,7 +1424,7 @@ void LLAssetStorage::storeAssetData( bool store_local, const LLUUID& requesting_agent_id, bool user_waiting, - F64 timeout) + F64Seconds timeout) { LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call @@ -1442,7 +1442,7 @@ void LLAssetStorage::storeAssetData( bool temp_file, bool is_priority, bool user_waiting, - F64 timeout) + F64Seconds timeout) { LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call @@ -1460,7 +1460,7 @@ void LLAssetStorage::storeAssetData( bool temp_file, bool is_priority, bool user_waiting, - F64 timeout) + F64Seconds timeout) { LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h index 6ed1027cee..1bb4acea9e 100755 --- a/indra/llmessage/llassetstorage.h +++ b/indra/llmessage/llassetstorage.h @@ -49,7 +49,7 @@ class LLSD; // anything that takes longer than this to download will abort. // HTTP Uploads also timeout if they take longer than this. -const F32 LL_ASSET_STORAGE_TIMEOUT = 5 * 60.0f; +const F32Minutes LL_ASSET_STORAGE_TIMEOUT(5); // Specific error codes @@ -103,7 +103,7 @@ public: void setUUID(const LLUUID& id) { mUUID = id; } void setType(LLAssetType::EType type) { mType = type; } - void setTimeout (F64 timeout) { mTimeout = timeout; } + void setTimeout (F64Seconds timeout) { mTimeout = timeout; } protected: LLUUID mUUID; @@ -279,7 +279,7 @@ public: bool is_priority = false, bool store_local = false, bool user_waiting= false, - F64 timeout=LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); /* * AssetID version @@ -295,7 +295,7 @@ public: bool store_local = false, const LLUUID& requesting_agent_id = LLUUID::null, bool user_waiting= false, - F64 timeout=LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); virtual void checkForTimeouts(); @@ -403,7 +403,7 @@ public: bool temp_file = false, bool is_priority = false, bool user_waiting = false, - F64 timeout = LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout = LL_ASSET_STORAGE_TIMEOUT); /* * TransactionID version @@ -417,7 +417,7 @@ public: bool temp_file = false, bool is_priority = false, bool user_waiting = false, - F64 timeout = LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout = LL_ASSET_STORAGE_TIMEOUT); static void legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType, void *user_data, S32 status, LLExtStat ext_status); static void legacyStoreDataCallback(const LLUUID &uuid, void *user_data, S32 status, LLExtStat ext_status); diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 1ace4d9b70..5aaada63b1 100755 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -207,7 +207,7 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num) } if (packetp->mCallback) { - if (packetp->mTimeout < 0.f) // negative timeout will always return timeout even for successful ack, for debugging + if (packetp->mTimeout < F32Seconds(0.f)) // negative timeout will always return timeout even for successful ack, for debugging { packetp->mCallback(packetp->mCallbackData,LL_ERR_TCP_TIMEOUT); } @@ -241,7 +241,7 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num) } if (packetp->mCallback) { - if (packetp->mTimeout < 0.f) // negative timeout will always return timeout even for successful ack, for debugging + if (packetp->mTimeout < F32Seconds(0.f)) // negative timeout will always return timeout even for successful ack, for debugging { packetp->mCallback(packetp->mCallbackData,LL_ERR_TCP_TIMEOUT); } @@ -540,8 +540,8 @@ void LLCircuitData::checkPeriodTime() mBytesInLastPeriod = mBytesInThisPeriod; mBytesOutLastPeriod = mBytesOutThisPeriod; - mBytesInThisPeriod = 0; - mBytesOutThisPeriod = 0; + mBytesInThisPeriod = S32Bytes(0); + mBytesOutThisPeriod = S32Bytes(0); mLastPeriodLength = period_length; mPeriodTime = mt_sec; @@ -549,14 +549,14 @@ void LLCircuitData::checkPeriodTime() } -void LLCircuitData::addBytesIn(S32 bytes) +void LLCircuitData::addBytesIn(S32Bytes bytes) { mBytesIn += bytes; mBytesInThisPeriod += bytes; } -void LLCircuitData::addBytesOut(S32 bytes) +void LLCircuitData::addBytesOut(S32Bytes bytes) { mBytesOut += bytes; mBytesOutThisPeriod += bytes; @@ -743,7 +743,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) } // LL_INFOS() << "adding potential lost: " << index << LL_ENDL; - mPotentialLostPackets[index] = time.value(); + mPotentialLostPackets[index] = time; index++; index = index % LL_MAX_OUT_PACKET_ID; gap_count++; @@ -1152,23 +1152,23 @@ std::ostream& operator<<(std::ostream& s, LLCircuitData& circuit) << endl; s << "Global In/Out " << S32(age) << " sec" - << " KBytes: " << circuit.mBytesIn.valueInUnits<LLUnits::Kibibytes>() << "/" << circuit.mBytesOut.valueInUnits<LLUnits::Kibibytes>() + << " KBytes: " << circuit.mBytesIn.valueInUnits<LLUnits::Kilobytes>() << "/" << circuit.mBytesOut.valueInUnits<LLUnits::Kilobytes>() << " Kbps: " - << S32(circuit.mBytesIn.valueInUnits<LLUnits::Kibibits>() / circuit.mExistenceTimer.getElapsedTimeF32().value()) + << S32(circuit.mBytesIn.valueInUnits<LLUnits::Kilobits>() / circuit.mExistenceTimer.getElapsedTimeF32().value()) << "/" - << S32(circuit.mBytesOut.valueInUnits<LLUnits::Kibibits>() / circuit.mExistenceTimer.getElapsedTimeF32().value()) + << S32(circuit.mBytesOut.valueInUnits<LLUnits::Kilobits>() / circuit.mExistenceTimer.getElapsedTimeF32().value()) << " Packets: " << circuit.mPacketsIn << "/" << circuit.mPacketsOut << endl; s << "Recent In/Out " << circuit.mLastPeriodLength << " KBytes: " - << circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kibibytes>() + << circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kilobytes>() << "/" - << circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kibibytes>() + << circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kilobytes>() << " Kbps: " - << (S32)(circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kibibits>() / circuit.mLastPeriodLength.value()) + << (S32)(circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kilobits>() / circuit.mLastPeriodLength.value()) << "/" - << (S32)(circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kibibits>() / circuit.mLastPeriodLength.value()) + << (S32)(circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kilobits>() / circuit.mLastPeriodLength.value()) << " Peak kbps: " << S32(circuit.mPeakBPSIn / 1024.f) << "/" @@ -1261,7 +1261,7 @@ void LLCircuitData::pingTimerStop(const U8 ping_id) // Nota Bene: no averaging of ping times until we get a feel for how this works F64Seconds time = mt_secs - mPingTime; - if (time == 0.0) + if (time == F32Seconds(0.0)) { // Ack, we got our ping response on the same frame! Sigh, let's get a real time otherwise // all of our ping calculations will be skewed. @@ -1368,7 +1368,7 @@ F32Milliseconds LLCircuitData::getPingInTransitTime() if (mPingsInTransit) { - time_since_ping_was_sent = ((mPingsInTransit*mHeartbeatInterval - 1) + time_since_ping_was_sent = ((mPingsInTransit*mHeartbeatInterval - F32Seconds(1)) + (LLMessageSystem::getMessageTimeSeconds() - mPingTime)); } diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h index bc29805859..5b109fc218 100755 --- a/indra/llmessage/llcircuit.h +++ b/indra/llmessage/llcircuit.h @@ -167,8 +167,8 @@ protected: void setPingDelay(U32Milliseconds ping); BOOL checkCircuitTimeout(); // Return FALSE if the circuit is dead and should be cleaned up - void addBytesIn(S32 bytes); - void addBytesOut(S32 bytes); + void addBytesIn(S32Bytes bytes); + void addBytesOut(S32Bytes bytes); U8 nextPingID() { mLastPingID++; return mLastPingID; } diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index d9b537941b..095da6f0f9 100755 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -456,7 +456,7 @@ void LLHTTPAssetStorage::storeAssetData( bool store_local, const LLUUID& requesting_agent_id, bool user_waiting, - F64 timeout) + F64Seconds timeout) { if (mVFS->getExists(uuid, type)) // VFS treats nonexistant and zero-length identically { @@ -516,7 +516,7 @@ void LLHTTPAssetStorage::storeAssetData( bool temp_file, bool is_priority, bool user_waiting, - F64 timeout) + F64Seconds timeout) { LL_INFOS() << "LLAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << LL_ENDL; diff --git a/indra/llmessage/llhttpassetstorage.h b/indra/llmessage/llhttpassetstorage.h index f743ccf0ac..783e95cac6 100755 --- a/indra/llmessage/llhttpassetstorage.h +++ b/indra/llmessage/llhttpassetstorage.h @@ -69,7 +69,7 @@ public: bool store_local = false, const LLUUID& requesting_agent_id = LLUUID::null, bool user_waiting=FALSE, - F64 timeout=LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); virtual void storeAssetData( const std::string& filename, @@ -80,7 +80,7 @@ public: bool temp_file, bool is_priority, bool user_waiting=FALSE, - F64 timeout=LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); virtual LLSD getPendingDetails(ERequestType rt, LLAssetType::EType asset_type, diff --git a/indra/llmessage/llpacketack.h b/indra/llmessage/llpacketack.h index 0a5604f74f..f55d5246f6 100755 --- a/indra/llmessage/llpacketack.h +++ b/indra/llmessage/llpacketack.h @@ -54,7 +54,7 @@ public: mHost.invalidate(); mRetries = 0; mPingBasedRetry = TRUE; - mTimeout = 0.f; + mTimeout = F32Seconds(0.f); mCallback = NULL; mCallbackData = NULL; mMessageName = NULL; diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp index 00eaa7e2ec..e484bd258d 100755 --- a/indra/llmessage/llthrottle.cpp +++ b/indra/llmessage/llthrottle.cpp @@ -356,7 +356,7 @@ BOOL LLThrottleGroup::throttleOverflow(S32 throttle_cat, F32 bits) BOOL LLThrottleGroup::dynamicAdjust() { - const F32 DYNAMIC_ADJUST_TIME = 1.0f; // seconds + const F32Seconds DYNAMIC_ADJUST_TIME(1.0f); const F32 CURRENT_PERIOD_WEIGHT = .25f; // how much weight to give to last period while determining BPS utilization const F32 BUSY_PERCENT = 0.75f; // if use more than this fraction of BPS, you are busy const F32 IDLE_PERCENT = 0.70f; // if use less than this fraction, you are "idle" @@ -405,7 +405,7 @@ BOOL LLThrottleGroup::dynamicAdjust() for (i = 0; i < TC_EOF; i++) { // Is this a busy channel? - if (mBitsSentHistory[i] >= BUSY_PERCENT * DYNAMIC_ADJUST_TIME * mCurrentBPS[i]) + if (mBitsSentHistory[i] >= BUSY_PERCENT * DYNAMIC_ADJUST_TIME.value() * mCurrentBPS[i]) { // this channel is busy channels_busy = TRUE; @@ -418,7 +418,7 @@ BOOL LLThrottleGroup::dynamicAdjust() } // Is this an idle channel? - if ((mBitsSentHistory[i] < IDLE_PERCENT * DYNAMIC_ADJUST_TIME * mCurrentBPS[i]) && + if ((mBitsSentHistory[i] < IDLE_PERCENT * DYNAMIC_ADJUST_TIME.value() * mCurrentBPS[i]) && (mBitsAvailable[i] > 0)) { channel_idle[i] = TRUE; @@ -462,7 +462,7 @@ BOOL LLThrottleGroup::dynamicAdjust() // Therefore it's a candidate to give up some bandwidth. // Figure out how much bandwidth it has been using, and how // much is available to steal. - used_bps = mBitsSentHistory[i] / DYNAMIC_ADJUST_TIME; + used_bps = mBitsSentHistory[i] / DYNAMIC_ADJUST_TIME.value(); // CRO make sure to keep a minimum amount of throttle available // CRO NB: channels set to < MINIMUM_BPS will never give up bps, diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 1f4dd11f73..88c73852af 100755 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -80,7 +80,7 @@ // Constants //const char* MESSAGE_LOG_FILENAME = "message.log"; -static const F32 CIRCUIT_DUMP_TIMEOUT = 30.f; +static const F32Seconds CIRCUIT_DUMP_TIMEOUT(30.f); static const S32 TRUST_TIME_WINDOW = 3; // *NOTE: This needs to be moved into a seperate file so that it never gets @@ -259,7 +259,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, mSendPacketFailureCount = 0; - mCircuitPrintFreq = 60.f; // seconds + mCircuitPrintFreq = F32Seconds(60.f); loadTemplateFile(filename, failure_is_fatal); @@ -312,11 +312,11 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, // Constants for dumping output based on message processing time/count mNumMessageCounts = 0; mMaxMessageCounts = 200; // >= 0 means dump warnings - mMaxMessageTime = 1.f; + mMaxMessageTime = F32Seconds(1.f); mTrueReceiveSize = 0; - mReceiveTime = 0.f; + mReceiveTime = F32Seconds(0.f); } @@ -833,7 +833,7 @@ void LLMessageSystem::processAcks() } } - if (mMaxMessageTime >= 0.f) + if (mMaxMessageTime >= F32Seconds(0.f)) { // This is one of the only places where we're required to get REAL message system time. mReceiveTime = getMessageTimeSeconds(TRUE) - mMessageCountTime; @@ -1337,7 +1337,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) else { // mCircuitInfo already points to the correct circuit data - cdp->addBytesOut( buffer_length ); + cdp->addBytesOut( (S32Bytes)buffer_length ); } if(mVerboseLog) @@ -1464,7 +1464,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r { // update circuit packet ID tracking (missing/out of order packets) cdp->checkPacketInID( mCurrentRecvPacketID, recv_resent ); - cdp->addBytesIn( mTrueReceiveSize ); + cdp->addBytesIn( (S32Bytes)mTrueReceiveSize ); } if(mVerboseLog) @@ -1731,7 +1731,7 @@ LLHost LLMessageSystem::findHost(const U32 circuit_code) void LLMessageSystem::setMaxMessageTime(const F32 seconds) { - mMaxMessageTime = seconds; + mMaxMessageTime = F32Seconds(seconds); } void LLMessageSystem::setMaxMessageCounts(const S32 num) @@ -2752,7 +2752,7 @@ void LLMessageSystem::dumpReceiveCounts() if (mt->mReceiveCount > 0) { LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes - << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime) << "%" << LL_ENDL; + << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL; } } } diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index 75eccc7f75..da06b64506 100755 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -267,7 +267,7 @@ public: LLCircuit mCircuitInfo; F64Seconds mCircuitPrintTime; // used to print circuit debug info every couple minutes - F32 mCircuitPrintFreq; // seconds + F32Seconds mCircuitPrintFreq; std::map<U64, U32> mIPPortToCircuitCode; std::map<U32, U64> mCircuitCodeToIPPort; |