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.0.6.5-rc1
parent
07c113a766
commit
b4cb45bb79
|
@ -205,6 +205,8 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
|
|||
= new CommunicationsOGS1(m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, libraryRootFolder);
|
||||
|
||||
m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler());
|
||||
m_httpServer.AddStreamHandler(new OpenSim.XSimStatusHandler(m_openSim));
|
||||
|
||||
}
|
||||
|
||||
protected virtual void InitialiseHGStandaloneServices(LibraryRootFolder libraryRootFolder)
|
||||
|
@ -240,6 +242,7 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
|
|||
HGServices = ((HGCommunicationsGridMode) m_commsManager).HGServices;
|
||||
|
||||
m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler());
|
||||
m_httpServer.AddStreamHandler(new OpenSim.XSimStatusHandler(m_openSim));
|
||||
}
|
||||
|
||||
private void CreateGridInfoService()
|
||||
|
@ -250,4 +253,4 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
|
|||
m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,10 @@ using OpenSim.Framework.Console;
|
|||
using OpenSim.Framework.Statistics;
|
||||
using Timer=System.Timers.Timer;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
|
||||
namespace OpenSim.Framework.Servers
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -454,6 +458,10 @@ namespace OpenSim.Framework.Servers
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public string StatReport() {
|
||||
return m_stats.XReport();
|
||||
}
|
||||
|
||||
protected void RemovePIDFile()
|
||||
{
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
|
||||
namespace OpenSim.Framework.Statistics
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -47,5 +51,10 @@ namespace OpenSim.Framework.Statistics
|
|||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public virtual string XReport()
|
||||
{
|
||||
return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,5 +37,13 @@ namespace OpenSim.Framework.Statistics
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string Report();
|
||||
|
||||
/// <summary>
|
||||
/// Report back collected statistical information in json
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="System.String"/>
|
||||
/// </returns>
|
||||
string XReport();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,9 @@ using System.Text;
|
|||
using OpenMetaverse;
|
||||
using OpenSim.Framework.Statistics.Interfaces;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
namespace OpenSim.Framework.Statistics
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -380,6 +383,53 @@ Asset service request failures: {3}" + Environment.NewLine,
|
|||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Report back collected statistical information.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string XReport()
|
||||
{
|
||||
OSDMap args = new OSDMap(28);
|
||||
args["AssetsInCache"] = OSD.FromReal(AssetsInCache);
|
||||
args["TimeAfterCacheMiss"] = OSD.FromReal(assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0);
|
||||
args["BlockedMissingTextureRequests"] = OSD.FromReal(BlockedMissingTextureRequests);
|
||||
args["AssetServiceRequestFailures"] = OSD.FromReal(AssetServiceRequestFailures);
|
||||
args["abnormalClientThreadTerminations"] = OSD.FromReal(abnormalClientThreadTerminations);
|
||||
args["InventoryServiceRetrievalFailures"] = OSD.FromReal(InventoryServiceRetrievalFailures);
|
||||
args["Dilatn"] = OSD.FromReal(timeDilation);
|
||||
args["SimFPS"] = OSD.FromReal(simFps);
|
||||
args["PhyFPS"] = OSD.FromReal(physicsFps);
|
||||
args["AgntUp"] = OSD.FromReal(agentUpdates);
|
||||
args["RootAg"] = OSD.FromReal(rootAgents);
|
||||
args["ChldAg"] = OSD.FromReal(childAgents);
|
||||
args["Prims"] = OSD.FromReal(totalPrims);
|
||||
args["AtvPrm"] = OSD.FromReal(activePrims);
|
||||
args["AtvScr"] = OSD.FromReal(activeScripts);
|
||||
args["ScrLPS"] = OSD.FromReal(scriptLinesPerSecond);
|
||||
args["PktsIn"] = OSD.FromReal(inPacketsPerSecond);
|
||||
args["PktOut"] = OSD.FromReal(outPacketsPerSecond);
|
||||
args["PendDl"] = OSD.FromReal(pendingDownloads);
|
||||
args["PendUl"] = OSD.FromReal(pendingUploads);
|
||||
args["UnackB"] = OSD.FromReal(unackedBytes);
|
||||
args["TotlFt"] = OSD.FromReal(totalFrameTime);
|
||||
args["NetFt"] = OSD.FromReal(netFrameTime);
|
||||
args["PhysFt"] = OSD.FromReal(physicsFrameTime);
|
||||
args["OthrFt"] = OSD.FromReal(otherFrameTime);
|
||||
args["AgntFt"] = OSD.FromReal(agentFrameTime);
|
||||
args["ImgsFt"] = OSD.FromReal(imageFrameTime);
|
||||
args["Memory"] = OSD.FromString(base.XReport());
|
||||
|
||||
string strBuffer = "";
|
||||
byte[] buffer = new byte[1];
|
||||
|
||||
strBuffer = OSDParser.SerializeJsonString(args);
|
||||
UTF8Encoding str = new UTF8Encoding();
|
||||
buffer = str.GetBytes(strBuffer);
|
||||
|
||||
return strBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -402,5 +452,10 @@ Asset service request failures: {3}" + Environment.NewLine,
|
|||
{
|
||||
return m_statsProvider.GetStats();
|
||||
}
|
||||
|
||||
public string XReport()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -807,6 +807,43 @@ namespace OpenSim
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handler to supply the current extended status of this sim
|
||||
/// </summary>
|
||||
/// Currently prints the same a "show stats" plus the uptime of the sim
|
||||
public class XSimStatusHandler : IStreamedRequestHandler
|
||||
{
|
||||
OpenSimBase m_opensim;
|
||||
|
||||
public XSimStatusHandler(OpenSimBase sim)
|
||||
// public XSimStatusHandler(BaseOpenSimServer sim)
|
||||
{
|
||||
m_opensim = sim;
|
||||
}
|
||||
|
||||
public byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
{
|
||||
return Encoding.UTF8.GetBytes(m_opensim.StatReport());
|
||||
}
|
||||
|
||||
public string ContentType
|
||||
{
|
||||
get { return "text/plain"; }
|
||||
}
|
||||
|
||||
public string HttpMethod
|
||||
{
|
||||
get { return "GET"; }
|
||||
}
|
||||
|
||||
public string Path
|
||||
{
|
||||
get { return "/simstatusx/"; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -10290,5 +10290,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
LLPacketHandler handler = (LLPacketHandler) m_PacketHandler;
|
||||
return handler.PacketQueue.GetStats();
|
||||
}
|
||||
|
||||
public string XReport()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,6 +146,7 @@
|
|||
<Reference name="System"/>
|
||||
<Reference name="OpenMetaverseTypes.dll"/>
|
||||
<Reference name="OpenMetaverse.dll"/>
|
||||
<Reference name="OpenMetaverse.StructuredData.dll"/>
|
||||
<Reference name="OpenSim.Framework"/>
|
||||
|
||||
<Files>
|
||||
|
@ -3287,3 +3288,4 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue