aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
diff options
context:
space:
mode:
authorCharles Krinke2009-04-17 21:48:48 +0000
committerCharles Krinke2009-04-17 21:48:48 +0000
commitb4cb45bb79619306b25c67c770165ab752aeb742 (patch)
tree3d1a7d763a3cc3647aff6a07462971c9f12b2d5c /OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
parent* Add Implementation of Linear Motor and Linear friction from the LSL Vehicle... (diff)
downloadopensim-SC_OLD-b4cb45bb79619306b25c67c770165ab752aeb742.zip
opensim-SC_OLD-b4cb45bb79619306b25c67c770165ab752aeb742.tar.gz
opensim-SC_OLD-b4cb45bb79619306b25c67c770165ab752aeb742.tar.bz2
opensim-SC_OLD-b4cb45bb79619306b25c67c770165ab752aeb742.tar.xz
Fixes Mantis # 3469. Thank you kindly, BlueWall, for a patch that:
This patch adds extended status reporting with the url http://server:port/simstatusx/ [^] . The data is returned in json format as "text/plain" type.
Diffstat (limited to 'OpenSim/Framework/Statistics/SimExtraStatsCollector.cs')
-rw-r--r--OpenSim/Framework/Statistics/SimExtraStatsCollector.cs55
1 files changed, 55 insertions, 0 deletions
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
index d6e26e4..8b8b52a 100644
--- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
@@ -31,6 +31,9 @@ using System.Text;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework.Statistics.Interfaces; 32using OpenSim.Framework.Statistics.Interfaces;
33 33
34using OpenMetaverse;
35using OpenMetaverse.StructuredData;
36
34namespace OpenSim.Framework.Statistics 37namespace OpenSim.Framework.Statistics
35{ 38{
36 /// <summary> 39 /// <summary>
@@ -380,6 +383,53 @@ Asset service request failures: {3}" + Environment.NewLine,
380 383
381 return sb.ToString(); 384 return sb.ToString();
382 } 385 }
386
387
388 /// <summary>
389 /// Report back collected statistical information.
390 /// </summary>
391 /// <returns></returns>
392 public override string XReport()
393 {
394 OSDMap args = new OSDMap(28);
395 args["AssetsInCache"] = OSD.FromReal(AssetsInCache);
396 args["TimeAfterCacheMiss"] = OSD.FromReal(assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0);
397 args["BlockedMissingTextureRequests"] = OSD.FromReal(BlockedMissingTextureRequests);
398 args["AssetServiceRequestFailures"] = OSD.FromReal(AssetServiceRequestFailures);
399 args["abnormalClientThreadTerminations"] = OSD.FromReal(abnormalClientThreadTerminations);
400 args["InventoryServiceRetrievalFailures"] = OSD.FromReal(InventoryServiceRetrievalFailures);
401 args["Dilatn"] = OSD.FromReal(timeDilation);
402 args["SimFPS"] = OSD.FromReal(simFps);
403 args["PhyFPS"] = OSD.FromReal(physicsFps);
404 args["AgntUp"] = OSD.FromReal(agentUpdates);
405 args["RootAg"] = OSD.FromReal(rootAgents);
406 args["ChldAg"] = OSD.FromReal(childAgents);
407 args["Prims"] = OSD.FromReal(totalPrims);
408 args["AtvPrm"] = OSD.FromReal(activePrims);
409 args["AtvScr"] = OSD.FromReal(activeScripts);
410 args["ScrLPS"] = OSD.FromReal(scriptLinesPerSecond);
411 args["PktsIn"] = OSD.FromReal(inPacketsPerSecond);
412 args["PktOut"] = OSD.FromReal(outPacketsPerSecond);
413 args["PendDl"] = OSD.FromReal(pendingDownloads);
414 args["PendUl"] = OSD.FromReal(pendingUploads);
415 args["UnackB"] = OSD.FromReal(unackedBytes);
416 args["TotlFt"] = OSD.FromReal(totalFrameTime);
417 args["NetFt"] = OSD.FromReal(netFrameTime);
418 args["PhysFt"] = OSD.FromReal(physicsFrameTime);
419 args["OthrFt"] = OSD.FromReal(otherFrameTime);
420 args["AgntFt"] = OSD.FromReal(agentFrameTime);
421 args["ImgsFt"] = OSD.FromReal(imageFrameTime);
422 args["Memory"] = OSD.FromString(base.XReport());
423
424 string strBuffer = "";
425 byte[] buffer = new byte[1];
426
427 strBuffer = OSDParser.SerializeJsonString(args);
428 UTF8Encoding str = new UTF8Encoding();
429 buffer = str.GetBytes(strBuffer);
430
431 return strBuffer;
432 }
383 } 433 }
384 434
385 /// <summary> 435 /// <summary>
@@ -402,5 +452,10 @@ Asset service request failures: {3}" + Environment.NewLine,
402 { 452 {
403 return m_statsProvider.GetStats(); 453 return m_statsProvider.GetStats();
404 } 454 }
455
456 public string XReport()
457 {
458 return "";
459 }
405 } 460 }
406} 461}