diff options
Diffstat (limited to 'OpenSim/Framework')
5 files changed, 77 insertions, 4 deletions
diff --git a/OpenSim/Framework/Monitoring/AssetStatsCollector.cs b/OpenSim/Framework/Monitoring/AssetStatsCollector.cs index 2a4d45b..6a0f676 100644 --- a/OpenSim/Framework/Monitoring/AssetStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/AssetStatsCollector.cs | |||
@@ -28,6 +28,8 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Timers; | 29 | using System.Timers; |
30 | 30 | ||
31 | using OpenMetaverse.StructuredData; | ||
32 | |||
31 | namespace OpenSim.Framework.Monitoring | 33 | namespace OpenSim.Framework.Monitoring |
32 | { | 34 | { |
33 | /// <summary> | 35 | /// <summary> |
@@ -100,5 +102,29 @@ Asset requests yesterday : {3} ({4} per hour) of which {5} were not found", | |||
100 | AssetRequestsToday, assetRequestsTodayPerHour, AssetRequestsNotFoundToday, | 102 | AssetRequestsToday, assetRequestsTodayPerHour, AssetRequestsNotFoundToday, |
101 | AssetRequestsYesterday, assetRequestsYesterdayPerHour, AssetRequestsNotFoundYesterday); | 103 | AssetRequestsYesterday, assetRequestsYesterdayPerHour, AssetRequestsNotFoundYesterday); |
102 | } | 104 | } |
105 | |||
106 | public override string XReport(string uptime, string version) | ||
107 | { | ||
108 | return OSDParser.SerializeJsonString(OReport(uptime, version)); | ||
109 | } | ||
110 | |||
111 | public override OSDMap OReport(string uptime, string version) | ||
112 | { | ||
113 | double elapsedHours = (DateTime.Now - startTime).TotalHours; | ||
114 | if (elapsedHours <= 0) { elapsedHours = 1; } // prevent divide by zero | ||
115 | |||
116 | long assetRequestsTodayPerHour = (long)Math.Round(AssetRequestsToday / elapsedHours); | ||
117 | long assetRequestsYesterdayPerHour = (long)Math.Round(AssetRequestsYesterday / 24.0); | ||
118 | |||
119 | OSDMap ret = new OSDMap(); | ||
120 | ret.Add("AssetRequestsToday", OSD.FromLong(AssetRequestsToday)); | ||
121 | ret.Add("AssetRequestsTodayPerHour", OSD.FromLong(assetRequestsTodayPerHour)); | ||
122 | ret.Add("AssetRequestsNotFoundToday", OSD.FromLong(AssetRequestsNotFoundToday)); | ||
123 | ret.Add("AssetRequestsYesterday", OSD.FromLong(AssetRequestsYesterday)); | ||
124 | ret.Add("AssetRequestsYesterdayPerHour", OSD.FromLong(assetRequestsYesterdayPerHour)); | ||
125 | ret.Add("AssetRequestsNotFoundYesterday", OSD.FromLong(assetRequestsNotFoundYesterday)); | ||
126 | |||
127 | return ret; | ||
128 | } | ||
103 | } | 129 | } |
104 | } | 130 | } |
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs index 2903b6e..be1d02b 100644 --- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs | |||
@@ -67,5 +67,12 @@ namespace OpenSim.Framework.Monitoring | |||
67 | { | 67 | { |
68 | return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ; | 68 | return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ; |
69 | } | 69 | } |
70 | |||
71 | public virtual OSDMap OReport(string uptime, string version) | ||
72 | { | ||
73 | OSDMap ret = new OSDMap(); | ||
74 | ret.Add("TotalMemory", new OSDReal(Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0))); | ||
75 | return ret; | ||
76 | } | ||
70 | } | 77 | } |
71 | } | 78 | } |
diff --git a/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs b/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs index 99f75e3..40df562 100644 --- a/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs | |||
@@ -25,6 +25,8 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse.StructuredData; | ||
29 | |||
28 | namespace OpenSim.Framework.Monitoring | 30 | namespace OpenSim.Framework.Monitoring |
29 | { | 31 | { |
30 | /// <summary> | 32 | /// <summary> |
@@ -45,5 +47,12 @@ namespace OpenSim.Framework.Monitoring | |||
45 | /// A <see cref="System.String"/> | 47 | /// A <see cref="System.String"/> |
46 | /// </returns> | 48 | /// </returns> |
47 | string XReport(string uptime, string version); | 49 | string XReport(string uptime, string version); |
50 | |||
51 | /// <summary> | ||
52 | /// Report back collected statistical information as an OSDMap of key/values | ||
53 | /// </summary> | ||
54 | /// <returns> | ||
55 | /// </returns> | ||
56 | OSDMap OReport(string uptime, string version); | ||
48 | } | 57 | } |
49 | } | 58 | } |
diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs index 3765efb..109a58f 100644 --- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs | |||
@@ -405,6 +405,15 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
405 | /// <returns></returns> | 405 | /// <returns></returns> |
406 | public override string XReport(string uptime, string version) | 406 | public override string XReport(string uptime, string version) |
407 | { | 407 | { |
408 | return OSDParser.SerializeJsonString(OReport(uptime, version)); | ||
409 | } | ||
410 | |||
411 | /// <summary> | ||
412 | /// Report back collected statistical information as an OSDMap | ||
413 | /// </summary> | ||
414 | /// <returns></returns> | ||
415 | public override OSDMap OReport(string uptime, string version) | ||
416 | { | ||
408 | OSDMap args = new OSDMap(30); | 417 | OSDMap args = new OSDMap(30); |
409 | // args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache)); | 418 | // args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache)); |
410 | // args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}", | 419 | // args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}", |
@@ -442,13 +451,11 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
442 | args["Uptime"] = OSD.FromString (uptime); | 451 | args["Uptime"] = OSD.FromString (uptime); |
443 | args["Version"] = OSD.FromString (version); | 452 | args["Version"] = OSD.FromString (version); |
444 | 453 | ||
445 | string strBuffer = ""; | 454 | return args; |
446 | strBuffer = OSDParser.SerializeJsonString(args); | ||
447 | |||
448 | return strBuffer; | ||
449 | } | 455 | } |
450 | } | 456 | } |
451 | 457 | ||
458 | |||
452 | /// <summary> | 459 | /// <summary> |
453 | /// Pull packet queue stats from packet queues and report | 460 | /// Pull packet queue stats from packet queues and report |
454 | /// </summary> | 461 | /// </summary> |
@@ -474,5 +481,11 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
474 | { | 481 | { |
475 | return ""; | 482 | return ""; |
476 | } | 483 | } |
484 | |||
485 | public OSDMap OReport(string uptime, string version) | ||
486 | { | ||
487 | OSDMap ret = new OSDMap(); | ||
488 | return ret; | ||
489 | } | ||
477 | } | 490 | } |
478 | } | 491 | } |
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 | } |