diff options
author | Robert Adams | 2013-02-20 14:11:02 -0800 |
---|---|---|
committer | Robert Adams | 2013-02-20 16:13:51 -0800 |
commit | 681653ca130eaf15c62aae6fd1a7c5276036a0e9 (patch) | |
tree | 23e97348c4ad5911ca9689bcaaa44f50378173a2 /OpenSim/Framework/Monitoring/UserStatsCollector.cs | |
parent | Add flush after write feature to LogWriter (diff) | |
download | opensim-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.cs | 18 |
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 | ||
28 | using System.Timers; | 28 | using System.Timers; |
29 | 29 | ||
30 | using OpenMetaverse.StructuredData; | ||
31 | |||
30 | namespace OpenSim.Framework.Monitoring | 32 | namespace 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 | } |