diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ObjectCountMonitor.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ObjectCountMonitor.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ObjectCountMonitor.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ObjectCountMonitor.cs new file mode 100644 index 0000000..dd9b19d --- /dev/null +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Monitors/ObjectCountMonitor.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using OpenSim.Region.Framework.Scenes; | ||
2 | |||
3 | namespace OpenSim.Region.CoreModules.Framework.Monitoring.Monitors | ||
4 | { | ||
5 | class ObjectCountMonitor : IMonitor | ||
6 | { | ||
7 | private readonly Scene m_scene; | ||
8 | |||
9 | public ObjectCountMonitor(Scene scene) | ||
10 | { | ||
11 | m_scene = scene; | ||
12 | } | ||
13 | |||
14 | #region Implementation of IMonitor | ||
15 | |||
16 | public double GetValue() | ||
17 | { | ||
18 | return m_scene.SceneGraph.GetTotalObjectsCount(); | ||
19 | } | ||
20 | |||
21 | public string GetName() | ||
22 | { | ||
23 | return "Total Objects Count"; | ||
24 | } | ||
25 | |||
26 | public string GetFriendlyValue() | ||
27 | { | ||
28 | return (int)GetValue() + " Object(s)"; | ||
29 | } | ||
30 | |||
31 | #endregion | ||
32 | } | ||
33 | } | ||