aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Statistics/BaseStatsCollector.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-25 23:11:50 +0100
committerJustin Clark-Casey (justincc)2012-07-25 23:11:50 +0100
commit35efa88c26d249d315837fdca0faf643511e1a4e (patch)
tree00227cb097196ca172ed9639c536e4934326e89f /OpenSim/Framework/Statistics/BaseStatsCollector.cs
parentAdd MemoryWatchdog class missing from git master a1e9964 (diff)
downloadopensim-SC_OLD-35efa88c26d249d315837fdca0faf643511e1a4e.zip
opensim-SC_OLD-35efa88c26d249d315837fdca0faf643511e1a4e.tar.gz
opensim-SC_OLD-35efa88c26d249d315837fdca0faf643511e1a4e.tar.bz2
opensim-SC_OLD-35efa88c26d249d315837fdca0faf643511e1a4e.tar.xz
Rename OpenSim.Framework.Statistics to OpenSim.Framework.Monitoring.
This better reflects the long-term purpose of that project and matches Monitoring modules.
Diffstat (limited to 'OpenSim/Framework/Statistics/BaseStatsCollector.cs')
-rw-r--r--OpenSim/Framework/Statistics/BaseStatsCollector.cs68
1 files changed, 0 insertions, 68 deletions
diff --git a/OpenSim/Framework/Statistics/BaseStatsCollector.cs b/OpenSim/Framework/Statistics/BaseStatsCollector.cs
deleted file mode 100644
index 1fe086c..0000000
--- a/OpenSim/Framework/Statistics/BaseStatsCollector.cs
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Diagnostics;
30using System.Text;
31using OpenMetaverse;
32using OpenMetaverse.StructuredData;
33
34
35namespace OpenSim.Framework.Statistics
36{
37 /// <summary>
38 /// Statistics which all collectors are interested in reporting
39 /// </summary>
40 public class BaseStatsCollector : IStatsCollector
41 {
42 public virtual string Report()
43 {
44 StringBuilder sb = new StringBuilder(Environment.NewLine);
45 sb.Append("MEMORY STATISTICS");
46 sb.Append(Environment.NewLine);
47
48 sb.AppendFormat(
49 "Allocated to OpenSim objects: {0} MB\n",
50 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
51
52 sb.AppendFormat(
53 "OpenSim object memory churn : {0} MB/s\n",
54 Math.Round((MemoryWatchdog.AverageMemoryChurn * 1000) / 1024.0 / 1024, 3));
55
56 sb.AppendFormat(
57 "Process memory : {0} MB\n",
58 Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0));
59
60 return sb.ToString();
61 }
62
63 public virtual string XReport(string uptime, string version)
64 {
65 return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ;
66 }
67 }
68}