Display existing statistic of how many http requests a server is making as server.network.HTTPRequestsMade in "show stats all"
parent
8a86e29579
commit
84af1cab9b
|
@ -113,11 +113,16 @@ namespace OpenSim.Framework.Monitoring
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MakeStat(string pName, string pDesc, string pUnit, string pContainer, Action<Stat> act)
|
private void MakeStat(string pName, string pDesc, string pUnit, string pContainer, Action<Stat> act)
|
||||||
|
{
|
||||||
|
MakeStat(pName, pDesc, pUnit, pContainer, act, MeasuresOfInterest.None);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MakeStat(string pName, string pDesc, string pUnit, string pContainer, Action<Stat> act, MeasuresOfInterest moi)
|
||||||
{
|
{
|
||||||
string desc = pDesc;
|
string desc = pDesc;
|
||||||
if (desc == null)
|
if (desc == null)
|
||||||
desc = pName;
|
desc = pName;
|
||||||
Stat stat = new Stat(pName, pName, desc, pUnit, CategoryServer, pContainer, StatType.Pull, act, StatVerbosity.Debug);
|
Stat stat = new Stat(pName, pName, desc, pUnit, CategoryServer, pContainer, StatType.Pull, moi, act, StatVerbosity.Debug);
|
||||||
StatsManager.RegisterStat(stat);
|
StatsManager.RegisterStat(stat);
|
||||||
RegisteredStats.Add(pName, stat);
|
RegisteredStats.Add(pName, stat);
|
||||||
}
|
}
|
||||||
|
@ -141,7 +146,7 @@ namespace OpenSim.Framework.Monitoring
|
||||||
StatsManager.RegisterStat(tempStat);
|
StatsManager.RegisterStat(tempStat);
|
||||||
RegisteredStats.Add(tempName, tempStat);
|
RegisteredStats.Add(tempName, tempStat);
|
||||||
|
|
||||||
MakeStat("TotalProcessorTime", null, "sec", ContainerProcessor,
|
MakeStat("TotalProcessorTime", null, "sec", ContainerProcessor,
|
||||||
(s) => { s.Value = Process.GetCurrentProcess().TotalProcessorTime.TotalSeconds; });
|
(s) => { s.Value = Process.GetCurrentProcess().TotalProcessorTime.TotalSeconds; });
|
||||||
|
|
||||||
MakeStat("UserProcessorTime", null, "sec", ContainerProcessor,
|
MakeStat("UserProcessorTime", null, "sec", ContainerProcessor,
|
||||||
|
@ -158,7 +163,7 @@ namespace OpenSim.Framework.Monitoring
|
||||||
m_log.ErrorFormat("{0} Exception creating 'Process': {1}", LogHeader, e);
|
m_log.ErrorFormat("{0} Exception creating 'Process': {1}", LogHeader, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeStat("BuiltinThreadpoolWorkerThreadsAvailable", null, "threads", ContainerThreadpool,
|
MakeStat("BuiltinThreadpoolWorkerThreadsAvailable", null, "threads", ContainerThreadpool,
|
||||||
s =>
|
s =>
|
||||||
{
|
{
|
||||||
int workerThreads, iocpThreads;
|
int workerThreads, iocpThreads;
|
||||||
|
@ -166,7 +171,7 @@ namespace OpenSim.Framework.Monitoring
|
||||||
s.Value = workerThreads;
|
s.Value = workerThreads;
|
||||||
});
|
});
|
||||||
|
|
||||||
MakeStat("BuiltinThreadpoolIOCPThreadsAvailable", null, "threads", ContainerThreadpool,
|
MakeStat("BuiltinThreadpoolIOCPThreadsAvailable", null, "threads", ContainerThreadpool,
|
||||||
s =>
|
s =>
|
||||||
{
|
{
|
||||||
int workerThreads, iocpThreads;
|
int workerThreads, iocpThreads;
|
||||||
|
@ -184,6 +189,14 @@ namespace OpenSim.Framework.Monitoring
|
||||||
MakeStat("STPWorkItemsWaiting", null, "threads", ContainerThreadpool, s => s.Value = Util.GetSmartThreadPoolInfo().WaitingCallbacks);
|
MakeStat("STPWorkItemsWaiting", null, "threads", ContainerThreadpool, s => s.Value = Util.GetSmartThreadPoolInfo().WaitingCallbacks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MakeStat(
|
||||||
|
"HTTPRequestsMade",
|
||||||
|
"Number of outbound HTTP requests made",
|
||||||
|
"requests",
|
||||||
|
ContainerNetwork,
|
||||||
|
s => s.Value = WebUtil.RequestNumber,
|
||||||
|
MeasuresOfInterest.AverageChangeOverTime);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<string> okInterfaceTypes = new List<string>(NetworkInterfaceTypes.Split(','));
|
List<string> okInterfaceTypes = new List<string>(NetworkInterfaceTypes.Split(','));
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
@ -247,6 +248,10 @@ namespace OpenSim.Framework.Monitoring
|
||||||
|
|
||||||
lock (m_samples)
|
lock (m_samples)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[STAT]: Samples for {0} are {1}",
|
||||||
|
// Name, string.Join(",", m_samples.Select(s => s.ToString()).ToArray()));
|
||||||
|
|
||||||
foreach (double s in m_samples)
|
foreach (double s in m_samples)
|
||||||
{
|
{
|
||||||
if (lastSample != null)
|
if (lastSample != null)
|
||||||
|
|
|
@ -1829,7 +1829,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
|
|
||||||
m_requestsProcessedStat
|
m_requestsProcessedStat
|
||||||
= new Stat(
|
= new Stat(
|
||||||
"IncomingHTTPRequestsProcessed",
|
"HTTPRequestsServed",
|
||||||
"Number of inbound HTTP requests processed",
|
"Number of inbound HTTP requests processed",
|
||||||
"",
|
"",
|
||||||
"requests",
|
"requests",
|
||||||
|
|
Loading…
Reference in New Issue