aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Monitoring/UserStatsCollector.cs
diff options
context:
space:
mode:
authorRobert Adams2013-02-20 14:11:02 -0800
committerRobert Adams2013-02-20 16:13:51 -0800
commit681653ca130eaf15c62aae6fd1a7c5276036a0e9 (patch)
tree23e97348c4ad5911ca9689bcaaa44f50378173a2 /OpenSim/Framework/Monitoring/UserStatsCollector.cs
parentAdd flush after write feature to LogWriter (diff)
downloadopensim-SC-681653ca130eaf15c62aae6fd1a7c5276036a0e9.zip
opensim-SC-681653ca130eaf15c62aae6fd1a7c5276036a0e9.tar.gz
opensim-SC-681653ca130eaf15c62aae6fd1a7c5276036a0e9.tar.bz2
opensim-SC-681653ca130eaf15c62aae6fd1a7c5276036a0e9.tar.xz
Add a method to IStatsCollector for returning stats as an OSDMap.
Extend implementors of IStatsCollector to return an OSDMap of stats. Update UserStatsCollector and AssetStatsCollector to return both string and OSDMap data (as well as console format).
Diffstat (limited to 'OpenSim/Framework/Monitoring/UserStatsCollector.cs')
-rw-r--r--OpenSim/Framework/Monitoring/UserStatsCollector.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Framework/Monitoring/UserStatsCollector.cs b/OpenSim/Framework/Monitoring/UserStatsCollector.cs
index e89c8e6..81e0fa4 100644
--- a/OpenSim/Framework/Monitoring/UserStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/UserStatsCollector.cs
@@ -27,6 +27,8 @@
27 27
28using System.Timers; 28using System.Timers;
29 29
30using OpenMetaverse.StructuredData;
31
30namespace OpenSim.Framework.Monitoring 32namespace OpenSim.Framework.Monitoring
31{ 33{
32 /// <summary> 34 /// <summary>
@@ -88,5 +90,21 @@ namespace OpenSim.Framework.Monitoring
88 Logouts total : {3}", 90 Logouts total : {3}",
89 SuccessfulLogins, SuccessfulLoginsToday, SuccessfulLoginsYesterday, Logouts); 91 SuccessfulLogins, SuccessfulLoginsToday, SuccessfulLoginsYesterday, Logouts);
90 } 92 }
93
94 public override string XReport(string uptime, string version)
95 {
96 return OSDParser.SerializeJsonString(OReport(uptime, version));
97 }
98
99 public override OSDMap OReport(string uptime, string version)
100 {
101 OSDMap ret = new OSDMap();
102 ret.Add("SuccessfulLogins", OSD.FromInteger(SuccessfulLogins));
103 ret.Add("SuccessfulLoginsToday", OSD.FromInteger(SuccessfulLoginsToday));
104 ret.Add("SuccessfulLoginsYesterday", OSD.FromInteger(SuccessfulLoginsYesterday));
105 ret.Add("Logouts", OSD.FromInteger(Logouts));
106
107 return ret;
108 }
91 } 109 }
92} 110}