diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/Monitoring/Monitors')
13 files changed, 152 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/AgentCountMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/AgentCountMonitor.cs index 4a2029e..3fb5e3a 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/AgentCountMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/AgentCountMonitor.cs | |||
@@ -40,12 +40,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
40 | 40 | ||
41 | #region Implementation of IMonitor | 41 | #region Implementation of IMonitor |
42 | 42 | ||
43 | public string GetName() | ||
44 | { | ||
45 | return "AgentCountMonitor"; | ||
46 | } | ||
47 | |||
43 | public double GetValue() | 48 | public double GetValue() |
44 | { | 49 | { |
45 | return m_scene.SceneGraph.GetRootAgentCount(); | 50 | return m_scene.SceneGraph.GetRootAgentCount(); |
46 | } | 51 | } |
47 | 52 | ||
48 | public string GetName() | 53 | public string GetFriendlyName() |
49 | { | 54 | { |
50 | return "Root Agent Count"; | 55 | return "Root Agent Count"; |
51 | } | 56 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ChildAgentCountMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ChildAgentCountMonitor.cs index 4ab3edd..be0e8fb 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ChildAgentCountMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ChildAgentCountMonitor.cs | |||
@@ -40,12 +40,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
40 | 40 | ||
41 | #region Implementation of IMonitor | 41 | #region Implementation of IMonitor |
42 | 42 | ||
43 | public string GetName() | ||
44 | { | ||
45 | return "ChildAgentCountMonitor"; | ||
46 | } | ||
47 | |||
43 | public double GetValue() | 48 | public double GetValue() |
44 | { | 49 | { |
45 | return m_scene.SceneGraph.GetChildAgentCount(); | 50 | return m_scene.SceneGraph.GetChildAgentCount(); |
46 | } | 51 | } |
47 | 52 | ||
48 | public string GetName() | 53 | public string GetFriendlyName() |
49 | { | 54 | { |
50 | return "Child Agent Count"; | 55 | return "Child Agent Count"; |
51 | } | 56 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/EventFrameMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/EventFrameMonitor.cs index 356458d..1c44c78 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/EventFrameMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/EventFrameMonitor.cs | |||
@@ -40,12 +40,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
40 | 40 | ||
41 | #region Implementation of IMonitor | 41 | #region Implementation of IMonitor |
42 | 42 | ||
43 | public string GetName() | ||
44 | { | ||
45 | return "EventFrameMonitor"; | ||
46 | } | ||
47 | |||
43 | public double GetValue() | 48 | public double GetValue() |
44 | { | 49 | { |
45 | return m_scene.MonitorEventTime; | 50 | return m_scene.MonitorEventTime; |
46 | } | 51 | } |
47 | 52 | ||
48 | public string GetName() | 53 | public string GetFriendlyName() |
49 | { | 54 | { |
50 | return "Total Event Frame Time"; | 55 | return "Total Event Frame Time"; |
51 | } | 56 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/GCMemoryMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/GCMemoryMonitor.cs index aa2e9c0..3f4d4a2 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/GCMemoryMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/GCMemoryMonitor.cs | |||
@@ -33,12 +33,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
33 | { | 33 | { |
34 | #region Implementation of IMonitor | 34 | #region Implementation of IMonitor |
35 | 35 | ||
36 | public string GetName() | ||
37 | { | ||
38 | return "GCMemoryMonitor"; | ||
39 | } | ||
40 | |||
36 | public double GetValue() | 41 | public double GetValue() |
37 | { | 42 | { |
38 | return GC.GetTotalMemory(false); | 43 | return GC.GetTotalMemory(false); |
39 | } | 44 | } |
40 | 45 | ||
41 | public string GetName() | 46 | public string GetFriendlyName() |
42 | { | 47 | { |
43 | return "GC Reported Memory"; | 48 | return "GC Reported Memory"; |
44 | } | 49 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/GenericMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/GenericMonitor.cs new file mode 100644 index 0000000..551c49c --- /dev/null +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/GenericMonitor.cs | |||
@@ -0,0 +1,80 @@ | |||
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 | |||
28 | using System; | ||
29 | using OpenSim.Region.Framework.Scenes; | ||
30 | |||
31 | namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | ||
32 | { | ||
33 | class GenericMonitor : IMonitor | ||
34 | { | ||
35 | public Scene Scene { get; private set; } | ||
36 | public string Name { get; private set; } | ||
37 | public string FriendlyName { get; private set; } | ||
38 | |||
39 | private readonly Func<GenericMonitor, double> m_getValueAction; | ||
40 | private readonly Func<GenericMonitor, string> m_getFriendlyValueAction; | ||
41 | |||
42 | public GenericMonitor( | ||
43 | Scene scene, | ||
44 | string name, | ||
45 | string friendlyName, | ||
46 | Func<GenericMonitor, double> getValueAction, | ||
47 | Func<GenericMonitor, string> getFriendlyValueAction) | ||
48 | { | ||
49 | Scene = scene; | ||
50 | Name = name; | ||
51 | FriendlyName = name; | ||
52 | m_getFriendlyValueAction = getFriendlyValueAction; | ||
53 | m_getValueAction = getValueAction; | ||
54 | } | ||
55 | |||
56 | public double GetValue() | ||
57 | { | ||
58 | return m_getValueAction(this); | ||
59 | } | ||
60 | |||
61 | public string GetName() | ||
62 | { | ||
63 | return Name; | ||
64 | } | ||
65 | |||
66 | public string GetFriendlyName() | ||
67 | { | ||
68 | return FriendlyName; | ||
69 | } | ||
70 | |||
71 | public string GetFriendlyValue() | ||
72 | { | ||
73 | return m_getFriendlyValueAction(this); | ||
74 | } | ||
75 | } | ||
76 | } | ||
77 | |||
78 | |||
79 | |||
80 | |||
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/LandFrameMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/LandFrameMonitor.cs index e1c36de..262735e 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/LandFrameMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/LandFrameMonitor.cs | |||
@@ -40,12 +40,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
40 | 40 | ||
41 | #region Implementation of IMonitor | 41 | #region Implementation of IMonitor |
42 | 42 | ||
43 | public string GetName() | ||
44 | { | ||
45 | return "LandFrameMonitor"; | ||
46 | } | ||
47 | |||
43 | public double GetValue() | 48 | public double GetValue() |
44 | { | 49 | { |
45 | return m_scene.MonitorLandTime; | 50 | return m_scene.MonitorLandTime; |
46 | } | 51 | } |
47 | 52 | ||
48 | public string GetName() | 53 | public string GetFriendlyName() |
49 | { | 54 | { |
50 | return "Land Frame Time"; | 55 | return "Land Frame Time"; |
51 | } | 56 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/LastFrameTimeMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/LastFrameTimeMonitor.cs index f21a3ae..3acb4ad 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/LastFrameTimeMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/LastFrameTimeMonitor.cs | |||
@@ -41,12 +41,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
41 | 41 | ||
42 | #region Implementation of IMonitor | 42 | #region Implementation of IMonitor |
43 | 43 | ||
44 | public string GetName() | ||
45 | { | ||
46 | return "LastFrameTimeMonitor"; | ||
47 | } | ||
48 | |||
44 | public double GetValue() | 49 | public double GetValue() |
45 | { | 50 | { |
46 | return Environment.TickCount - m_scene.MonitorLastFrameTick; | 51 | return Environment.TickCount - m_scene.MonitorLastFrameTick; |
47 | } | 52 | } |
48 | 53 | ||
49 | public string GetName() | 54 | public string GetFriendlyName() |
50 | { | 55 | { |
51 | return "Last Completed Frame At"; | 56 | return "Last Completed Frame At"; |
52 | } | 57 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ObjectCountMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ObjectCountMonitor.cs index 10804f9..52a2df1 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ObjectCountMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ObjectCountMonitor.cs | |||
@@ -40,12 +40,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
40 | 40 | ||
41 | #region Implementation of IMonitor | 41 | #region Implementation of IMonitor |
42 | 42 | ||
43 | public string GetName() | ||
44 | { | ||
45 | return "ObjectCountMonitor"; | ||
46 | } | ||
47 | |||
43 | public double GetValue() | 48 | public double GetValue() |
44 | { | 49 | { |
45 | return m_scene.SceneGraph.GetTotalObjectsCount(); | 50 | return m_scene.SceneGraph.GetTotalObjectsCount(); |
46 | } | 51 | } |
47 | 52 | ||
48 | public string GetName() | 53 | public string GetFriendlyName() |
49 | { | 54 | { |
50 | return "Total Objects Count"; | 55 | return "Total Objects Count"; |
51 | } | 56 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PWSMemoryMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PWSMemoryMonitor.cs index 5f6190c..07c13d1 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PWSMemoryMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PWSMemoryMonitor.cs | |||
@@ -33,12 +33,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
33 | { | 33 | { |
34 | #region Implementation of IMonitor | 34 | #region Implementation of IMonitor |
35 | 35 | ||
36 | public string GetName() | ||
37 | { | ||
38 | return "PWSMemoryMonitor"; | ||
39 | } | ||
40 | |||
36 | public double GetValue() | 41 | public double GetValue() |
37 | { | 42 | { |
38 | return System.Diagnostics.Process.GetCurrentProcess().PrivateMemorySize64; | 43 | return System.Diagnostics.Process.GetCurrentProcess().PrivateMemorySize64; |
39 | } | 44 | } |
40 | 45 | ||
41 | public string GetName() | 46 | public string GetFriendlyName() |
42 | { | 47 | { |
43 | return "Private Working Set Memory"; | 48 | return "Private Working Set Memory"; |
44 | } | 49 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PhysicsFrameMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PhysicsFrameMonitor.cs index 7c5bb0a..b10fa75 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PhysicsFrameMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PhysicsFrameMonitor.cs | |||
@@ -40,12 +40,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
40 | 40 | ||
41 | #region Implementation of IMonitor | 41 | #region Implementation of IMonitor |
42 | 42 | ||
43 | public string GetName() | ||
44 | { | ||
45 | return "PhysicsFrameMonitor"; | ||
46 | } | ||
47 | |||
43 | public double GetValue() | 48 | public double GetValue() |
44 | { | 49 | { |
45 | return m_scene.MonitorPhysicsSyncTime + m_scene.MonitorPhysicsUpdateTime; | 50 | return m_scene.MonitorPhysicsSyncTime + m_scene.MonitorPhysicsUpdateTime; |
46 | } | 51 | } |
47 | 52 | ||
48 | public string GetName() | 53 | public string GetFriendlyName() |
49 | { | 54 | { |
50 | return "Total Physics Frame Time"; | 55 | return "Total Physics Frame Time"; |
51 | } | 56 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PhysicsUpdateFrameMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PhysicsUpdateFrameMonitor.cs index 1894b3b..a85d8cc 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PhysicsUpdateFrameMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/PhysicsUpdateFrameMonitor.cs | |||
@@ -40,12 +40,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
40 | 40 | ||
41 | #region Implementation of IMonitor | 41 | #region Implementation of IMonitor |
42 | 42 | ||
43 | public string GetName() | ||
44 | { | ||
45 | return "PhysicsUpdateFrameMonitor"; | ||
46 | } | ||
47 | |||
43 | public double GetValue() | 48 | public double GetValue() |
44 | { | 49 | { |
45 | return m_scene.MonitorPhysicsUpdateTime; | 50 | return m_scene.MonitorPhysicsUpdateTime; |
46 | } | 51 | } |
47 | 52 | ||
48 | public string GetName() | 53 | public string GetFriendlyName() |
49 | { | 54 | { |
50 | return "Physics Update Frame Time"; | 55 | return "Physics Update Frame Time"; |
51 | } | 56 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ThreadCountMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ThreadCountMonitor.cs index 63ddf07..fcfe32a 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ThreadCountMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ThreadCountMonitor.cs | |||
@@ -32,12 +32,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
32 | { | 32 | { |
33 | #region Implementation of IMonitor | 33 | #region Implementation of IMonitor |
34 | 34 | ||
35 | public string GetName() | ||
36 | { | ||
37 | return "ThreadCountMonitor"; | ||
38 | } | ||
39 | |||
35 | public double GetValue() | 40 | public double GetValue() |
36 | { | 41 | { |
37 | return System.Diagnostics.Process.GetCurrentProcess().Threads.Count; | 42 | return System.Diagnostics.Process.GetCurrentProcess().Threads.Count; |
38 | } | 43 | } |
39 | 44 | ||
40 | public string GetName() | 45 | public string GetFriendlyName() |
41 | { | 46 | { |
42 | return "Total Threads"; | 47 | return "Total Threads"; |
43 | } | 48 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/TotalFrameMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/TotalFrameMonitor.cs index c3942bf..a46795d 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/TotalFrameMonitor.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/TotalFrameMonitor.cs | |||
@@ -40,12 +40,17 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | |||
40 | 40 | ||
41 | #region Implementation of IMonitor | 41 | #region Implementation of IMonitor |
42 | 42 | ||
43 | public string GetName() | ||
44 | { | ||
45 | return "TotalFrameMonitor"; | ||
46 | } | ||
47 | |||
43 | public double GetValue() | 48 | public double GetValue() |
44 | { | 49 | { |
45 | return m_scene.MonitorFrameTime; | 50 | return m_scene.MonitorFrameTime; |
46 | } | 51 | } |
47 | 52 | ||
48 | public string GetName() | 53 | public string GetFriendlyName() |
49 | { | 54 | { |
50 | return "Total Frame Time"; | 55 | return "Total Frame Time"; |
51 | } | 56 | } |