From 8d2f7a526545a10cd3669bf837a0b6f02cf5fe71 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 15 Oct 2012 19:43:35 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system converted all remaining LLViewerStats to lltrace --- indra/newview/llviewermenufile.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index be78603e2d..7ce8cdcfd8 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -1096,17 +1096,20 @@ void upload_new_resource( if( LLAssetType::AT_SOUND == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); + LLStatViewer::UPLOAD_SOUND.add(1); + //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); } else if( LLAssetType::AT_TEXTURE == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + LLStatViewer::UPLOAD_TEXTURE.add(1); + //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); } else if( LLAssetType::AT_ANIMATION == asset_type) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); + LLStatViewer::ANIMATION_UPLOADS.add(1); + //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); } if(LLInventoryType::IT_NONE == inv_type) @@ -1231,18 +1234,21 @@ void increase_new_upload_stats(LLAssetType::EType asset_type) { if ( LLAssetType::AT_SOUND == asset_type ) { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_SOUND_COUNT ); + LLStatViewer::UPLOAD_SOUND.add(1); + //LLViewerStats::getInstance()->incStat( + // LLViewerStats::ST_UPLOAD_SOUND_COUNT ); } else if ( LLAssetType::AT_TEXTURE == asset_type ) { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + LLStatViewer::UPLOAD_TEXTURE.add(1); + //LLViewerStats::getInstance()->incStat( + // LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); } else if ( LLAssetType::AT_ANIMATION == asset_type ) { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_ANIM_COUNT ); + LLStatViewer::ANIMATION_UPLOADS.add(1); + //LLViewerStats::getInstance()->incStat( + // LLViewerStats::ST_UPLOAD_ANIM_COUNT ); } } -- cgit v1.2.3 From a52d203a4f1d2988e8ffba16258f3f132f22f56d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 17 Oct 2012 20:00:07 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system started conversion of llviewerassetstats removed old, dead LLViewerStats code made units tracing require units declaration clean up of units handling --- indra/newview/llviewermenufile.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 7ce8cdcfd8..50ca8db267 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -1097,19 +1097,16 @@ void upload_new_resource( if( LLAssetType::AT_SOUND == asset_type ) { LLStatViewer::UPLOAD_SOUND.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); } else if( LLAssetType::AT_TEXTURE == asset_type ) { LLStatViewer::UPLOAD_TEXTURE.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); } else if( LLAssetType::AT_ANIMATION == asset_type) { LLStatViewer::ANIMATION_UPLOADS.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); } if(LLInventoryType::IT_NONE == inv_type) @@ -1235,20 +1232,14 @@ void increase_new_upload_stats(LLAssetType::EType asset_type) if ( LLAssetType::AT_SOUND == asset_type ) { LLStatViewer::UPLOAD_SOUND.add(1); - //LLViewerStats::getInstance()->incStat( - // LLViewerStats::ST_UPLOAD_SOUND_COUNT ); } else if ( LLAssetType::AT_TEXTURE == asset_type ) { LLStatViewer::UPLOAD_TEXTURE.add(1); - //LLViewerStats::getInstance()->incStat( - // LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); } else if ( LLAssetType::AT_ANIMATION == asset_type ) { LLStatViewer::ANIMATION_UPLOADS.add(1); - //LLViewerStats::getInstance()->incStat( - // LLViewerStats::ST_UPLOAD_ANIM_COUNT ); } } -- cgit v1.2.3 From f07b9c2c69f1f6882dcf249aacf33cdfacf878ab Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 6 Mar 2013 11:08:25 -0800 Subject: renamed LLTrace stat gathering classes/methods to make the structure of LLTrace clearer Count becomes CountStatHandle Count.sum becomes sum(Count, value), etc. --- indra/newview/llviewermenufile.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 50ca8db267..b7282a8493 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -1096,17 +1096,17 @@ void upload_new_resource( if( LLAssetType::AT_SOUND == asset_type ) { - LLStatViewer::UPLOAD_SOUND.add(1); + add(LLStatViewer::UPLOAD_SOUND, 1); } else if( LLAssetType::AT_TEXTURE == asset_type ) { - LLStatViewer::UPLOAD_TEXTURE.add(1); + add(LLStatViewer::UPLOAD_TEXTURE, 1); } else if( LLAssetType::AT_ANIMATION == asset_type) { - LLStatViewer::ANIMATION_UPLOADS.add(1); + add(LLStatViewer::ANIMATION_UPLOADS, 1); } if(LLInventoryType::IT_NONE == inv_type) @@ -1231,15 +1231,15 @@ void increase_new_upload_stats(LLAssetType::EType asset_type) { if ( LLAssetType::AT_SOUND == asset_type ) { - LLStatViewer::UPLOAD_SOUND.add(1); + add(LLStatViewer::UPLOAD_SOUND, 1); } else if ( LLAssetType::AT_TEXTURE == asset_type ) { - LLStatViewer::UPLOAD_TEXTURE.add(1); + add(LLStatViewer::UPLOAD_TEXTURE, 1); } else if ( LLAssetType::AT_ANIMATION == asset_type ) { - LLStatViewer::ANIMATION_UPLOADS.add(1); + add(LLStatViewer::ANIMATION_UPLOADS, 1); } } -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/newview/llviewermenufile.cpp | 60 +++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index b7282a8493..2930c130df 100755 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -253,7 +253,7 @@ const std::string upload_pick(void* data) LLFilePicker& picker = LLFilePicker::instance(); if (!picker.getOpenFile(type)) { - llinfos << "Couldn't import objects from file" << llendl; + LL_INFOS() << "Couldn't import objects from file" << LL_ENDL; return std::string(); } @@ -327,7 +327,7 @@ const std::string upload_pick(void* data) std::string error_msg; if (check_for_invalid_wav_formats(filename,error_msg)) { - llinfos << error_msg << ": " << filename << llendl; + LL_INFOS() << error_msg << ": " << filename << LL_ENDL; LLSD args; args["FILE"] = filename; LLNotificationsUtil::add( error_msg, args ); @@ -455,7 +455,7 @@ class LLFileUploadBulk : public view_listener_t } else { - llinfos << "Couldn't import objects from file" << llendl; + LL_INFOS() << "Couldn't import objects from file" << LL_ENDL; } return true; } @@ -463,11 +463,11 @@ class LLFileUploadBulk : public view_listener_t void upload_error(const std::string& error_message, const std::string& label, const std::string& filename, const LLSD& args) { - llwarns << error_message << llendl; + LL_WARNS() << error_message << LL_ENDL; LLNotificationsUtil::add(label, args); if(LLFile::remove(filename) == -1) { - lldebugs << "unable to remove temp file" << llendl; + LL_DEBUGS() << "unable to remove temp file" << LL_ENDL; } LLFilePicker::instance().reset(); } @@ -542,7 +542,7 @@ class LLFileTakeSnapshotToDisk : public view_listener_t formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality")); break; default: - llwarns << "Unknown local snapshot format: " << fmt << llendl; + LL_WARNS() << "Unknown local snapshot format: " << fmt << LL_ENDL; case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG: formatted = new LLImagePNG; break; @@ -579,8 +579,8 @@ void handle_compress_image(void*) { std::string outfile = infile + ".j2c"; - llinfos << "Input: " << infile << llendl; - llinfos << "Output: " << outfile << llendl; + LL_INFOS() << "Input: " << infile << LL_ENDL; + LL_INFOS() << "Output: " << outfile << LL_ENDL; BOOL success; @@ -588,11 +588,11 @@ void handle_compress_image(void*) if (success) { - llinfos << "Compression complete" << llendl; + LL_INFOS() << "Compression complete" << LL_ENDL; } else { - llinfos << "Compression failed: " << LLImage::getLastError() << llendl; + LL_INFOS() << "Compression failed: " << LLImage::getLastError() << LL_ENDL; } infile = picker.getNextFile(); @@ -660,7 +660,7 @@ LLUUID upload_new_resource( asset_type = LLAssetType::AT_SOUND; // tag it as audio S32 encode_result = 0; - llinfos << "Attempting to encode wav as an ogg file" << llendl; + LL_INFOS() << "Attempting to encode wav as an ogg file" << LL_ENDL; encode_result = encode_vorbis_file(src_filename, filename); @@ -711,8 +711,8 @@ LLUUID upload_new_resource( "%254s %254s\n", label, value); - llinfos << "got: " << label << " = " << value - << llendl; + LL_INFOS() << "got: " << label << " = " << value + << LL_ENDL; if (EOF == tokens_read) { @@ -765,7 +765,7 @@ LLUUID upload_new_resource( // read in and throw out most of the header except for the type if (fread(buf, header_size, 1, in) != 1) { - llwarns << "Short read" << llendl; + LL_WARNS() << "Short read" << LL_ENDL; } memcpy(&type_num, buf + 16, sizeof(S16)); /* Flawfinder: ignore */ asset_type = (LLAssetType::EType)type_num; @@ -779,7 +779,7 @@ LLUUID upload_new_resource( { if (fwrite(buf, 1, readbytes, out) != readbytes) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } fclose(out); @@ -797,7 +797,7 @@ LLUUID upload_new_resource( } else { - llinfos << "Couldn't open .lin file " << src_filename << llendl; + LL_INFOS() << "Couldn't open .lin file " << src_filename << LL_ENDL; } } else if (exten == "bvh") @@ -873,13 +873,13 @@ LLUUID upload_new_resource( } else { - llwarns << error_message << llendl; + LL_WARNS() << error_message << LL_ENDL; LLSD args; args["ERROR_MESSAGE"] = error_message; LLNotificationsUtil::add("ErrorMessage", args); if(LLFile::remove(filename) == -1) { - lldebugs << "unable to remove temp file" << llendl; + LL_DEBUGS() << "unable to remove temp file" << LL_ENDL; } LLFilePicker::instance().reset(); } @@ -947,7 +947,7 @@ void upload_done_callback( if(is_balance_sufficient) { // Actually add the upload to inventory - llinfos << "Adding " << uuid << " to inventory." << llendl; + LL_INFOS() << "Adding " << uuid << " to inventory." << LL_ENDL; const LLUUID folder_id = gInventory.findCategoryUUIDForType(dest_loc); if(folder_id.notNull()) { @@ -964,7 +964,7 @@ void upload_done_callback( } else { - llwarns << "Can't find a folder to put it in" << llendl; + LL_WARNS() << "Can't find a folder to put it in" << LL_ENDL; } } } @@ -1129,21 +1129,21 @@ void upload_new_resource( upload_message.append(display_name); LLUploadDialog::modalUploadDialog(upload_message); - llinfos << "*** Uploading: " << llendl; - llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl; - llinfos << "UUID: " << uuid << llendl; - llinfos << "Name: " << name << llendl; - llinfos << "Desc: " << desc << llendl; - llinfos << "Expected Upload Cost: " << expected_upload_cost << llendl; - lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type) << llendl; - lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; + LL_INFOS() << "*** Uploading: " << LL_ENDL; + LL_INFOS() << "Type: " << LLAssetType::lookup(asset_type) << LL_ENDL; + LL_INFOS() << "UUID: " << uuid << LL_ENDL; + LL_INFOS() << "Name: " << name << LL_ENDL; + LL_INFOS() << "Desc: " << desc << LL_ENDL; + LL_INFOS() << "Expected Upload Cost: " << expected_upload_cost << LL_ENDL; + LL_DEBUGS() << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type) << LL_ENDL; + LL_DEBUGS() << "Asset Type: " << LLAssetType::lookup(asset_type) << LL_ENDL; std::string url = gAgent.getRegion()->getCapability( "NewFileAgentInventory"); if ( !url.empty() ) { - llinfos << "New Agent Inventory via capability" << llendl; + LL_INFOS() << "New Agent Inventory via capability" << LL_ENDL; LLSD body; body = generate_new_resource_upload_capability_body( @@ -1166,7 +1166,7 @@ void upload_new_resource( } else { - llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl; + LL_INFOS() << "NewAgentInventory capability not found, new agent inventory via asset system." << LL_ENDL; // check for adequate funds // TODO: do this check on the sim if (LLAssetType::AT_SOUND == asset_type || -- cgit v1.2.3