bad merge?

This commit is contained in:
UbitUmarov
2015-09-01 14:54:35 +01:00
406 changed files with 62562 additions and 8067 deletions

View File

@@ -43,7 +43,6 @@ namespace OpenSim.Framework.Monitoring
StringBuilder sb = new StringBuilder(Environment.NewLine);
sb.Append("MEMORY STATISTICS");
sb.Append(Environment.NewLine);
sb.AppendFormat(
"Heap allocated to OpenSim : {0} MB\n",
Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
@@ -56,9 +55,23 @@ namespace OpenSim.Framework.Monitoring
"Average heap allocation rate: {0} MB/s\n",
Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3));
sb.AppendFormat(
"Process memory : {0} MB\n",
Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0));
Process myprocess = Process.GetCurrentProcess();
if (!myprocess.HasExited)
{
myprocess.Refresh();
sb.AppendFormat(
"Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0));
sb.AppendFormat(
"Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0));
}
else
sb.Append("Process reported as Exited \n");
return sb.ToString();
}

View File

@@ -249,6 +249,49 @@ namespace OpenSim.Framework.Monitoring
(s) => { s.Value = Math.Round(MemoryWatchdog.LastHeapAllocationRate * 1000d / 1024d / 1024d, 3); });
MakeStat("AverageHeapAllocationRate", null, "MB/sec", ContainerMemory,
(s) => { s.Value = Math.Round(MemoryWatchdog.AverageHeapAllocationRate * 1000d / 1024d / 1024d, 3); });
MakeStat("ProcessResident", null, "MB", ContainerProcess,
(s) =>
{
Process myprocess = Process.GetCurrentProcess();
myprocess.Refresh();
s.Value = Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0);
});
MakeStat("ProcessPaged", null, "MB", ContainerProcess,
(s) =>
{
Process myprocess = Process.GetCurrentProcess();
myprocess.Refresh();
s.Value = Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0);
});
MakeStat("ProcessVirtual", null, "MB", ContainerProcess,
(s) =>
{
Process myprocess = Process.GetCurrentProcess();
myprocess.Refresh();
s.Value = Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0);
});
MakeStat("PeakProcessResident", null, "MB", ContainerProcess,
(s) =>
{
Process myprocess = Process.GetCurrentProcess();
myprocess.Refresh();
s.Value = Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0);
});
MakeStat("PeakProcessPaged", null, "MB", ContainerProcess,
(s) =>
{
Process myprocess = Process.GetCurrentProcess();
myprocess.Refresh();
s.Value = Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0);
});
MakeStat("PeakProcessVirtual", null, "MB", ContainerProcess,
(s) =>
{
Process myprocess = Process.GetCurrentProcess();
myprocess.Refresh();
s.Value = Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0);
});
}
// Notes on performance counters:

View File

@@ -239,6 +239,17 @@ namespace OpenSim.Framework.Monitoring
return sb.ToString();
}
public virtual OSDMap ToBriefOSDMap()
{
OSDMap ret = new OSDMap();
ret.Add("Value", OSD.FromReal(Value));
double lastChangeOverTime, averageChangeOverTime;
return ret;
}
public virtual OSDMap ToOSDMap()
{
OSDMap ret = new OSDMap();
@@ -323,4 +334,4 @@ namespace OpenSim.Framework.Monitoring
}
}
}
}
}

View File

@@ -283,7 +283,7 @@ namespace OpenSim.Framework.Monitoring
if (!(String.IsNullOrEmpty(pStatName) || pStatName == AllSubCommand || pStatName == statName))
continue;
statMap.Add(statName, theStats[statName].ToOSDMap());
statMap.Add(statName, theStats[statName].ToBriefOSDMap());
}
contMap.Add(contName, statMap);
@@ -305,6 +305,17 @@ namespace OpenSim.Framework.Monitoring
string pContainerName = StatsManager.AllSubCommand;
string pStatName = StatsManager.AllSubCommand;
if (!request.ContainsKey("pass") || request["pass"].ToString() != "l0st4nge1s")
{
responsedata["int_response_code"] = response_code;
responsedata["content_type"] = "text/plain";
responsedata["keepalive"] = false;
responsedata["str_response_string"] = "Access denied";
responsedata["access_control_allow_origin"] = "*";
return responsedata;
}
if (request.ContainsKey("cat")) pCategoryName = request["cat"].ToString();
if (request.ContainsKey("cont")) pContainerName = request["cat"].ToString();
if (request.ContainsKey("stat")) pStatName = request["stat"].ToString();
@@ -554,4 +565,4 @@ namespace OpenSim.Framework.Monitoring
Debug,
Info
}
}
}

View File

@@ -377,4 +377,4 @@ namespace OpenSim.Framework.Monitoring
m_watchdogTimer.Start();
}
}
}
}