aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llassetstorage.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llmessage/llassetstorage.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/llmessage/llassetstorage.cpp')
-rw-r--r--linden/indra/llmessage/llassetstorage.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/linden/indra/llmessage/llassetstorage.cpp b/linden/indra/llmessage/llassetstorage.cpp
index 74b55d9..13b1525 100644
--- a/linden/indra/llmessage/llassetstorage.cpp
+++ b/linden/indra/llmessage/llassetstorage.cpp
@@ -53,7 +53,10 @@
53#include "lltransfersourceasset.h" 53#include "lltransfersourceasset.h"
54#include "lltransfertargetvfile.h" // For debugging 54#include "lltransfertargetvfile.h" // For debugging
55 55
56#include "llmetrics.h"
57
56LLAssetStorage *gAssetStorage = NULL; 58LLAssetStorage *gAssetStorage = NULL;
59LLMetrics *LLAssetStorage::metric_recipient = NULL;
57 60
58const LLUUID CATEGORIZE_LOST_AND_FOUND_ID("00000000-0000-0000-0000-000000000010"); 61const LLUUID CATEGORIZE_LOST_AND_FOUND_ID("00000000-0000-0000-0000-000000000010");
59 62
@@ -1279,6 +1282,8 @@ void LLAssetStorage::storeAssetData(
1279 F64 timeout) 1282 F64 timeout)
1280{ 1283{
1281 llwarns << "storeAssetData: wrong version called" << llendl; 1284 llwarns << "storeAssetData: wrong version called" << llendl;
1285 // LLAssetStorage metric: Virtual base call
1286 reportMetric( LLUUID::null, asset_type, NULL, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 1" );
1282} 1287}
1283 1288
1284// virtual 1289// virtual
@@ -1296,6 +1301,8 @@ void LLAssetStorage::storeAssetData(
1296 F64 timeout) 1301 F64 timeout)
1297{ 1302{
1298 llwarns << "storeAssetData: wrong version called" << llendl; 1303 llwarns << "storeAssetData: wrong version called" << llendl;
1304 // LLAssetStorage metric: Virtual base call
1305 reportMetric( asset_id, asset_type, NULL, requesting_agent_id, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 2" );
1299} 1306}
1300 1307
1301// virtual 1308// virtual
@@ -1312,6 +1319,8 @@ void LLAssetStorage::storeAssetData(
1312 F64 timeout) 1319 F64 timeout)
1313{ 1320{
1314 llwarns << "storeAssetData: wrong version called" << llendl; 1321 llwarns << "storeAssetData: wrong version called" << llendl;
1322 // LLAssetStorage metric: Virtual base call
1323 reportMetric( asset_id, asset_type, NULL, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 3" );
1315} 1324}
1316 1325
1317// virtual 1326// virtual
@@ -1328,6 +1337,8 @@ void LLAssetStorage::storeAssetData(
1328 F64 timeout) 1337 F64 timeout)
1329{ 1338{
1330 llwarns << "storeAssetData: wrong version called" << llendl; 1339 llwarns << "storeAssetData: wrong version called" << llendl;
1340 // LLAssetStorage metric: Virtual base call
1341 reportMetric( LLUUID::null, asset_type, NULL, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 4" );
1331} 1342}
1332 1343
1333// static 1344// static
@@ -1372,3 +1383,51 @@ void LLAssetStorage::dumpTempAssetData(const LLUUID& avatar_id) const
1372// virtual 1383// virtual
1373void LLAssetStorage::clearTempAssetData() 1384void LLAssetStorage::clearTempAssetData()
1374{ } 1385{ }
1386
1387// static
1388void LLAssetStorage::reportMetric( const LLUUID& asset_id, const LLAssetType::EType asset_type, const char *filename,
1389 const LLUUID& agent_id, S32 asset_size, EMetricResult result,
1390 const char *file, const S32 line, const char *message )
1391{
1392 if( !metric_recipient )
1393 {
1394 llinfos << "Couldn't store LLAssetStoreage::reportMetric - no metrics_recipient" << llendl;
1395 return;
1396 }
1397
1398 filename = filename ? filename : "";
1399 file = file ? file : "";
1400
1401 // Create revised message - message = "message :: file:line"
1402 std::string new_message; //( message );
1403 new_message = message; // << " " << file << " " << line;
1404 new_message += " :: ";
1405 new_message += filename;
1406 char line_string[16];
1407 sprintf( line_string, ":%d", line );
1408 new_message += line_string;
1409 message = new_message.c_str();
1410
1411 // Change always_report to true if debugging... do not check it in this way
1412 static bool always_report = false;
1413 const char *metric_name = "LLAssetStorage::Metrics";
1414
1415 bool success = result == MR_OKAY;
1416
1417 if( (!success) || always_report )
1418 {
1419 LLSD stats;
1420 stats["asset_id"] = asset_id;
1421 stats["asset_type"] = asset_type;
1422 stats["filename"] = filename? filename : "";
1423 stats["agent_id"] = agent_id;
1424 stats["asset_size"] = (S32)asset_size;
1425 stats["result"] = (S32)result;
1426
1427 metric_recipient->recordEventDetails( metric_name, message, success, stats);
1428 }
1429 else
1430 {
1431 metric_recipient->recordEvent(metric_name, message, success);
1432 }
1433}