29 using System.Diagnostics;
 
   32 using OpenMetaverse.StructuredData;
 
   34 namespace OpenSim.Framework.Monitoring
 
   43             StringBuilder sb = 
new StringBuilder(Environment.NewLine);
 
   44             sb.Append(
"MEMORY STATISTICS");
 
   45             sb.Append(Environment.NewLine);
 
   47                 "Heap allocated to OpenSim   : {0} MB\n",
 
   48                 Math.Round(GC.GetTotalMemory(
false) / 1024.0 / 1024.0));
 
   51                 "Last heap allocation rate   : {0} MB/s\n",
 
   52                 Math.Round((MemoryWatchdog.LastHeapAllocationRate * 1000) / 1024.0 / 1024, 3));
 
   55                 "Average heap allocation rate: {0} MB/s\n",
 
   56                 Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3));
 
   58             Process myprocess = Process.GetCurrentProcess();
 
   64                         "Process memory:      Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
 
   65                         Math.Round(myprocess.WorkingSet64 / 1024.0 / 1024.0),
 
   66                         Math.Round(myprocess.PagedMemorySize64 / 1024.0 / 1024.0),
 
   67                         Math.Round(myprocess.VirtualMemorySize64 / 1024.0 / 1024.0));
 
   69                         "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
 
   70                         Math.Round(myprocess.PeakWorkingSet64 / 1024.0 / 1024.0),
 
   71                         Math.Round(myprocess.PeakPagedMemorySize64 / 1024.0 / 1024.0),
 
   72                         Math.Round(myprocess.PeakVirtualMemorySize64 / 1024.0 / 1024.0));
 
   82         public virtual string XReport(
string uptime, 
string version)
 
   84             return (
string) Math.Round(GC.GetTotalMemory(
false) / 1024.0 / 1024.0).ToString() ;
 
   90             ret.Add(
"TotalMemory", 
new OSDReal(Math.Round(GC.GetTotalMemory(
false) / 1024.0 / 1024.0)));
 
Implemented by classes which collect up non-viewer statistical information 
OpenMetaverse.StructuredData.OSDMap OSDMap
virtual string Report()
Report back collected statistical information. 
virtual OSDMap OReport(string uptime, string version)
Report back collected statistical information as an OSDMap of key/values 
Statistics which all collectors are interested in reporting 
virtual string XReport(string uptime, string version)
Report back collected statistical information in json