// Dump out performance metrics over some time interval void LLPerfStats::dumpIntervalPerformanceStats() { // Ensure output file is OK openPerfStatsFile(); if ( mFrameStatsFile ) { LLSD stats = LLSD::emptyMap(); LLStatAccum::TimeScale scale; if ( getReportPerformanceInterval() == 0.f ) { scale = LLStatAccum::SCALE_PER_FRAME; } else if ( getReportPerformanceInterval() < 0.5f ) { scale = LLStatAccum::SCALE_100MS; } else { scale = LLStatAccum::SCALE_SECOND; } // Write LLSD into log stats["utc_time"] = (LLSD::String) LLError::utcTime(); stats["timestamp"] = U64_to_str((totalTime() / 1000) + (gUTCOffset * 1000)); // milliseconds since epoch stats["frame_number"] = (LLSD::Integer) LLFrameTimer::getFrameCount(); // Add process-specific frame info. addProcessFrameInfo(stats, scale); LLPerfBlock::addStatsToLLSDandReset( stats, scale ); mFrameStatsFile << LLSDNotationStreamer(stats) << std::endl; } }
// Open file for statistics void LLPerfStats::openPerfStatsFile() { if ( !mFrameStatsFile && !mFrameStatsFileFailure ) { std::string stats_file = llformat("/dev/shm/simperf/%s_proc.%d.llsd", mProcessName.c_str(), mProcessPID); mFrameStatsFile.close(); mFrameStatsFile.clear(); mFrameStatsFile.open(stats_file, llofstream::out); if ( mFrameStatsFile.fail() ) { llinfos << "Error opening statistics log file " << stats_file << llendl; mFrameStatsFileFailure = TRUE; } else { LLSD process_info = LLSD::emptyMap(); process_info["name"] = mProcessName; process_info["pid"] = (LLSD::Integer) mProcessPID; process_info["stat_rate"] = (LLSD::Integer) mReportPerformanceStatInterval; // Add process-specific info. addProcessHeaderInfo(process_info); mFrameStatsFile << LLSDNotationStreamer(process_info) << std::endl; } } }
void LLMetricsImpl::recordEventDetails(const std::string& location, const std::string& mesg, bool success, LLSD stats) { recordEvent(location,mesg,success); LLSD metrics = LLSD::emptyMap(); metrics["location"] = location; metrics["stats"] = stats; llinfos << "LLMETRICS: " << LLSDNotationStreamer(metrics) << llendl; }
//@brief Function to log a message to syslog for streambase to collect. void LLLogImpl::log(const std::string message, LLSD& info) { static S32 sequence = 0; LLSD log_config = mApp->getOption("log-messages"); if (log_config.has(message)) { LLSD message_config = log_config[message]; if (message_config.has("use-syslog")) { if (! message_config["use-syslog"].asBoolean()) { return; } } } llinfos << "LLLOGMESSAGE (" << (sequence++) << ") " << message << " " << LLSDNotationStreamer(info) << llendl; }
std::ostream& operator<<(std::ostream& s, const LLSD& llsd) { s << LLSDNotationStreamer(llsd); return s; }
//virtual void LLSDMessageBuilder::copyFromLLSD(const LLSD& msg) { mCurrentMessage = msg; lldebugs << LLSDNotationStreamer(mCurrentMessage) << llendl; }
/*virtual*/ void post( LLHTTPNode::ResponsePtr response, const LLSD& context, const LLSD& input) const { if (!input || !context || !input.isMap() || !input.has("body")) { llinfos << "malformed OpenRegionInfo update!" << llendl; return; } LLSD body = input["body"]; llinfos << "data: " << LLSDNotationStreamer(body) << llendl; llinfos << "data: " << LLSDXMLStreamer(body) << llendl; //set the default limits/settings for this simulator type, as limits from our //previous region may not exist in this one gHippoLimits->setLimits(); //limits are also reset in llviewermessage.cpp when we detect a new server //version, in case the destination simulator does not support OpenRegionInfo. BOOL limitschanged = FALSE; if ( body.has("AllowMinimap") ) { gHippoLimits->mAllowMinimap = body["AllowMinimap"].asInteger() == 1; } if ( body.has("AllowPhysicalPrims") ) { gHippoLimits->mAllowPhysicalPrims = body["AllowPhysicalPrims"].asInteger() == 1; limitschanged = TRUE; } ///* if ( body.has("DrawDistance") ) { F32 distance = body["DrawDistance"].asReal(); if (distance > 0) { gAgent.mDrawDistance = distance; //gHippoLimits->mDrawDistance = distance; } } if ( body.has("ForceDrawDistance") ) { gAgent.mLockedDrawDistance = body["ForceDrawDistance"].asInteger() == 1; } /* if ( body.has("LSLFunctions") ) { //IMPLEMENT ME//not yet avail } */ if ( body.has("TerrainDetailScale") ) { //gAgent.getRegion()->getComposition()->setScaleParams(body["TerrainDetailScale"].asReal(), body["TerrainDetailScale"].asReal()); gHippoLimits->mTerrainScale = body["TerrainDetailScale"].asReal(); gSavedSettings.setF32("RenderTerrainScale", body["TerrainDetailScale"].asReal()); LLDrawPoolTerrain::sDetailScale = 1.f/body["TerrainDetailScale"].asReal(); } if ( body.has("MaxDragDistance") ) { gHippoLimits->mMaxDragDistance = body["MaxDragDistance"].asReal(); } if ( body.has("MinHoleSize") ) { gHippoLimits->mMinHoleSize = body["MinHoleSize"].asReal(); limitschanged = TRUE; } if ( body.has("MaxHollowSize") ) { gHippoLimits->mMaxHollow = body["MaxHollowSize"].asReal(); limitschanged = TRUE; } if ( body.has("MaxInventoryItemsTransfer") ) { gHippoLimits->mMaxInventoryItemsTransfer = body["MaxInventoryItemsTransfer"].asReal(); } if ( body.has("MaxLinkCount") ) { gHippoLimits->mMaxLinkedPrims = body["MaxLinkCount"].asInteger(); } if ( body.has("MaxLinkCountPhys") ) { gHippoLimits->mMaxPhysLinkedPrims = body["MaxLinkCountPhys"].asInteger(); } if ( body.has("MaxPos") ) { gHippoLimits->mMaxPrimXPos = body["MaxPosX"].asReal(); gHippoLimits->mMaxPrimYPos = body["MaxPosY"].asReal(); gHippoLimits->mMaxPrimZPos = body["MaxPosZ"].asReal(); limitschanged = TRUE; } if ( body.has("MinPos") ) { gHippoLimits->mMinPrimXPos = body["MinPosX"].asReal(); gHippoLimits->mMinPrimYPos = body["MinPosY"].asReal(); gHippoLimits->mMinPrimZPos = body["MinPosZ"].asReal(); limitschanged = TRUE; } if ( body.has("MaxPrimScale") ) { gHippoLimits->mMaxPrimScale = body["MaxPrimScale"].asReal(); limitschanged = TRUE; } if ( body.has("MaxPhysPrimScale") ) { //IMPLEMENT ME } if ( body.has("MinPrimScale") ) { gHippoLimits->mMinPrimScale = body["MinPrimScale"].asReal(); limitschanged = TRUE; } if ( body.has("OffsetOfUTC") ) { gSavedSettings.setS32("TimeOffset", body["OffsetOfUTC"].asInteger()); gSavedSettings.setBOOL("UseTimeOffset", true); ViewerTime::sUseTimeOffset = true; ViewerTime::sTimeOffset = gSavedSettings.getS32("TimeOffset"); } if ( body.has("OffsetOfUTCDST") ) { gSavedSettings.setBOOL("TimeOffsetDST", body["OffsetOfUTCDST"].asInteger() == 1 ? TRUE : FALSE); ViewerTime::sTimeOffsetDST = gSavedSettings.getBOOL("TimeOffsetDST"); } if ( body.has("RenderWater") ) { gHippoLimits->mRenderWater = body["RenderWater"].asInteger() == 1 ? TRUE : FALSE; // gAgent.getRegion()->rebuildWater();//not yet } /* if ( body.has("SayDistance") ) { gSavedSettings.setU32("ChatDistance", body["SayDistance"].asReal()); //this should override chat_normal_radius //CHAT_NORMAL_RADIUS = 20.f; } if ( body.has("ShoutDistance") ) { gSavedSettings.setU32("ShoutDistance", body["ShoutDistance"].asReal()); //this should override chat_shout_radius //CHAT_SHOUT_RADIUS = 100.f; } if ( body.has("WhisperDistance") ) { gSavedSettings.setU32("WhisperDistance", body["WhisperDistance"].asReal()); // this should override chat_whisper_radius //CHAT_WHISPER_RADIUS = 10.f; } */ if ( body.has("ToggleTeenMode") ) { gHippoLimits->mEnableTeenMode = body["ToggleTeenMode"].asInteger() == 1 ? TRUE : FALSE; } if ( body.has("SetTeenMode") ) { gAgent.setTeen( body["SetTeenMode"].asInteger() == 1 ? TRUE : FALSE ); LLFloaterWorldMap::reloadIcons(NULL); llinfos << "PG status set to " << (S32)gAgent.isTeen() << llendl; } if ( body.has("ShowTags") ) { gHippoLimits->mRenderName = body["ShowTags"].asReal(); } if ( body.has("EnforceMaxBuild") ) { gHippoLimits->mEnforceMaxBuild = body["EnforceMaxBuild"].asInteger() == 1 ? TRUE : FALSE; limitschanged = TRUE; } if ( body.has("MaxGroups") ) { gHippoLimits->mMaxAgentGroups = body["MaxGroups"].asReal(); } if ( body.has("AllowParcelWindLight") ) { gHippoLimits->mAllowParcelWindLight = body["AllowParcelWindLight"].asInteger() == 1; } //Update the floater if its around LLPanelRegionOpenSettingsInfo* floater = LLFloaterRegionInfo::getPanelOpenSettings(); if (floater != NULL) { floater->refreshFromRegion(gAgent.getRegion()); } }
bool LLMessageConfigFile::isCapBanned(const std::string& cap_name) const { lldebugs << "mCapBans is " << LLSDNotationStreamer(mCapBans) << llendl; return mCapBans[cap_name]; }