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