Add AICurlInterface::getNumHTTPRunning
Replaces LLTextureFetch::getNumHTTPRequests. Returns AICurlInterface::Stats::running_handles. This is work in progress that temporarily doesn't compile because LLTextureFetch::getNumHTTPRequests is still being used somewhere.
This commit is contained in:
@@ -298,6 +298,7 @@ LLAtomicU32 Stats::easy_init_errors;
|
||||
LLAtomicU32 Stats::easy_cleanup_calls;
|
||||
LLAtomicU32 Stats::multi_calls;
|
||||
LLAtomicU32 Stats::multi_errors;
|
||||
LLAtomicU32 Stats::running_handles;
|
||||
LLAtomicU32 Stats::AICurlEasyRequest_count;
|
||||
LLAtomicU32 Stats::AICurlEasyRequestStateMachine_count;
|
||||
LLAtomicU32 Stats::BufferedCurlEasyRequest_count;
|
||||
@@ -460,6 +461,12 @@ void setCAPath(std::string const& path)
|
||||
CertificateAuthority_w->path = path;
|
||||
}
|
||||
|
||||
// THREAD-SAFE
|
||||
U32 getNumHTTPRunning(void)
|
||||
{
|
||||
return Stats::running_handles;
|
||||
}
|
||||
|
||||
//static
|
||||
void Stats::print(void)
|
||||
{
|
||||
|
||||
@@ -133,6 +133,7 @@ struct Stats {
|
||||
static LLAtomicU32 easy_cleanup_calls;
|
||||
static LLAtomicU32 multi_calls;
|
||||
static LLAtomicU32 multi_errors;
|
||||
static LLAtomicU32 running_handles;
|
||||
static LLAtomicU32 AICurlEasyRequest_count;
|
||||
static LLAtomicU32 AICurlEasyRequestStateMachine_count;
|
||||
static LLAtomicU32 BufferedCurlEasyRequest_count;
|
||||
@@ -185,6 +186,10 @@ void setCAFile(std::string const& file);
|
||||
// Can be used to set the path to the Certificate Authority file.
|
||||
void setCAPath(std::string const& file);
|
||||
|
||||
// This used to be LLAppViewer::getTextureFetch()->getNumHTTPRequests().
|
||||
// Returns the number of active curl easy handles (that are actually attempting to download something).
|
||||
U32 getNumHTTPRunning(void);
|
||||
|
||||
} // namespace AICurlInterface
|
||||
|
||||
// Forward declaration (see aicurlprivate.h).
|
||||
|
||||
@@ -1653,6 +1653,7 @@ CURLMcode MultiHandle::socket_action(curl_socket_t sockfd, int ev_bitmask)
|
||||
}
|
||||
while(res == CURLM_CALL_MULTI_PERFORM);
|
||||
llassert(mAddedEasyRequests.size() >= (size_t)running_handles);
|
||||
AICurlInterface::Stats::running_handles = running_handles;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1696,7 +1697,8 @@ void MultiHandle::add_easy_request(AICurlEasyRequest const& easy_request)
|
||||
{ // ... to here.
|
||||
std::pair<addedEasyRequests_type::iterator, bool> res = mAddedEasyRequests.insert(easy_request);
|
||||
llassert(res.second); // May not have been added before.
|
||||
Dout(dc::curl, "MultiHandle::add_easy_request: Added AICurlEasyRequest " << (void*)easy_request.get_ptr().get() << "; now processing " << mAddedEasyRequests.size() << " easy handles.");
|
||||
Dout(dc::curl, "MultiHandle::add_easy_request: Added AICurlEasyRequest " << (void*)easy_request.get_ptr().get() <<
|
||||
"; now processing " << mAddedEasyRequests.size() << " easy handles [running_handles = " << AICurlInterface::Stats::running_handles << "].");
|
||||
return;
|
||||
}
|
||||
// The request could not be added, we have to queue it.
|
||||
@@ -1748,7 +1750,8 @@ CURLMcode MultiHandle::remove_easy_request(addedEasyRequests_type::iterator cons
|
||||
#endif
|
||||
mAddedEasyRequests.erase(iter);
|
||||
#if CWDEBUG
|
||||
Dout(dc::curl, "MultiHandle::remove_easy_request: Removed AICurlEasyRequest " << (void*)lockobj << "; now processing " << mAddedEasyRequests.size() << " easy handles.");
|
||||
Dout(dc::curl, "MultiHandle::remove_easy_request: Removed AICurlEasyRequest " << (void*)lockobj <<
|
||||
"; now processing " << mAddedEasyRequests.size() << " easy handles [running_handles = " << AICurlInterface::Stats::running_handles << "].");
|
||||
#endif
|
||||
|
||||
// Attempt to add a queued request, if any.
|
||||
|
||||
@@ -1305,6 +1305,12 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
||||
mLoaded = FALSE;
|
||||
mGetStatus = 0;
|
||||
mGetReason.clear();
|
||||
// Note: comparing mFetcher->getTextureBandwidth() with throttle_bandwidth is a bit like
|
||||
// comparing apples and oranges, but it's only debug output. The first is the averaged
|
||||
// bandwidth used for the body of successfully downloaded textures, averaged over roughtly
|
||||
// 10 seconds, in kbits/s. The latter is the limit of the actual http curl downloads,
|
||||
// including header and failures for anything (not just textures), averaged over the last
|
||||
// second, also in kbits/s.
|
||||
static const LLCachedControl<F32> throttle_bandwidth("HTTPThrottleBandwidth", 2000);
|
||||
LL_DEBUGS("Texture") << "HTTP GET: " << mID << " Offset: " << mRequestedOffset
|
||||
<< " Bytes: " << mRequestedSize
|
||||
@@ -2261,15 +2267,6 @@ S32 LLTextureFetch::getNumRequests()
|
||||
return size ;
|
||||
}
|
||||
|
||||
S32 LLTextureFetch::getNumHTTPRequests()
|
||||
{
|
||||
mNetworkQueueMutex.lock() ;
|
||||
S32 size = (S32)mHTTPTextureQueue.size();
|
||||
mNetworkQueueMutex.unlock() ;
|
||||
|
||||
return size ;
|
||||
}
|
||||
|
||||
U32 LLTextureFetch::getTotalNumHTTPRequests()
|
||||
{
|
||||
mNetworkQueueMutex.lock() ;
|
||||
|
||||
@@ -88,7 +88,6 @@ public:
|
||||
U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p, bool& can_use_http);
|
||||
void dump();
|
||||
S32 getNumRequests() ;
|
||||
S32 getNumHTTPRequests() ;
|
||||
U32 getTotalNumHTTPRequests() ;
|
||||
|
||||
// Public for access by callbacks
|
||||
|
||||
@@ -64,6 +64,11 @@ LLTextureSizeView *gTextureCategoryView = NULL;
|
||||
//static
|
||||
std::set<LLViewerFetchedTexture*> LLTextureView::sDebugImages;
|
||||
|
||||
// Forward declaration.
|
||||
namespace AICurlInterface {
|
||||
U32 getNumHTTPRunning(void);
|
||||
} // namespace AICurlInterface
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static std::string title_string1a("Tex UUID Area DDis(Req) DecodePri(Fetch) [download] pk/max");
|
||||
@@ -601,7 +606,7 @@ void LLGLTexMemBar::draw()
|
||||
LLLFSThread::sLocal->getPending(),
|
||||
LLAppViewer::getImageDecodeThread()->getPending(),
|
||||
LLImageRaw::sRawImageCount, LLImageRaw::sRawImageCachedCount,
|
||||
LLAppViewer::getTextureFetch()->getNumHTTPRequests(),
|
||||
AICurlInterface::getNumHTTPRunning(),
|
||||
LLAppViewer::getImageDecodeThread()->getPending(),
|
||||
gTextureList.mCreateTextureList.size());
|
||||
|
||||
@@ -609,7 +614,13 @@ void LLGLTexMemBar::draw()
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
|
||||
left += LLFontGL::getFontMonospace()->getWidth(text);
|
||||
// This bandwidth is averaged over roughly 10 seconds (in kbps) and therefore pretty inaccurate.
|
||||
// Also, it only takes into account actual texture data (not headers etc). But all it is used for
|
||||
// is for the color of some text in the texture console, so I guess it doesn't matter.
|
||||
F32 bandwidth = LLAppViewer::getTextureFetch()->getTextureBandwidth();
|
||||
// This is the maximum bandwidth allowed for curl transactions (of any type and averaged per second),
|
||||
// that is actually used to limit the number of HTTP texture requests (and only those).
|
||||
// Comparing that with 'bandwidth' is a bit like comparing apples and oranges, but again... who really cares.
|
||||
F32 max_bandwidth = gSavedSettings.getF32("HTTPThrottleBandwidth");
|
||||
color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color;
|
||||
color[VALPHA] = text_color[VALPHA];
|
||||
|
||||
@@ -1340,6 +1340,7 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d
|
||||
{
|
||||
received_size = msg->getReceiveSize() ;
|
||||
}
|
||||
// Only used for statistics and texture console.
|
||||
gTextureList.sTextureBits += received_size * 8;
|
||||
gTextureList.sTexturePackets++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user