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)
|
||||
{
|
||||
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;
|
||||
if (desc == null)
|
||||
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);
|
||||
RegisteredStats.Add(pName, stat);
|
||||
}
|
||||
|
@ -184,6 +189,14 @@ namespace OpenSim.Framework.Monitoring
|
|||
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
|
||||
{
|
||||
List<string> okInterfaceTypes = new List<string>(NetworkInterfaceTypes.Split(','));
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
|
@ -247,6 +248,10 @@ namespace OpenSim.Framework.Monitoring
|
|||
|
||||
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)
|
||||
{
|
||||
if (lastSample != null)
|
||||
|
|
|
@ -1829,7 +1829,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
m_requestsProcessedStat
|
||||
= new Stat(
|
||||
"IncomingHTTPRequestsProcessed",
|
||||
"HTTPRequestsServed",
|
||||
"Number of inbound HTTP requests processed",
|
||||
"",
|
||||
"requests",
|
||||
|
|
Loading…
Reference in New Issue