30 using OpenMetaverse.StructuredData;
32 namespace OpenSim.Framework.Monitoring
39 private Timer ageStatsTimer =
new Timer(24 * 60 * 60 * 1000);
41 private int successfulLoginsToday;
42 public int SuccessfulLoginsToday {
get {
return successfulLoginsToday; } }
44 private int successfulLoginsYesterday;
45 public int SuccessfulLoginsYesterday {
get {
return successfulLoginsYesterday; } }
47 private int successfulLogins;
48 public int SuccessfulLogins {
get {
return successfulLogins; } }
51 public int Logouts {
get {
return logouts; } }
55 ageStatsTimer.Elapsed +=
new ElapsedEventHandler(OnAgeing);
56 ageStatsTimer.Enabled =
true;
59 private void OnAgeing(
object source, ElapsedEventArgs e)
61 successfulLoginsYesterday = successfulLoginsToday;
65 successfulLoginsToday = 0;
74 successfulLoginsToday++;
89 @"Successful logins total : {0}, today : {1}, yesterday : {2}
91 SuccessfulLogins, SuccessfulLoginsToday, SuccessfulLoginsYesterday, Logouts);
94 public override string XReport(
string uptime,
string version)
96 return OSDParser.SerializeJsonString(OReport(uptime, version));
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));
override OSDMap OReport(string uptime, string version)
Report back collected statistical information as an OSDMap of key/values
OpenMetaverse.StructuredData.OSDMap OSDMap
override string Report()
Report back collected statistical information.
System.Timers.Timer Timer
override string XReport(string uptime, string version)
Report back collected statistical information in json
Statistics which all collectors are interested in reporting
Collects user service statistics
void AddSuccessfulLogin()
Record a successful login