diff options
author | Dahlia Trimble | 2009-04-25 05:06:01 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-04-25 05:06:01 +0000 |
commit | 4792e6139a86f2dd93ced34582eef3599b804794 (patch) | |
tree | 6aa308eb6d29c94b882051cea5a6fc92224627db /OpenSim/Framework | |
parent | * More debug warning message removal in the FreeSwitchVoiceModule (diff) | |
download | opensim-SC_OLD-4792e6139a86f2dd93ced34582eef3599b804794.zip opensim-SC_OLD-4792e6139a86f2dd93ced34582eef3599b804794.tar.gz opensim-SC_OLD-4792e6139a86f2dd93ced34582eef3599b804794.tar.bz2 opensim-SC_OLD-4792e6139a86f2dd93ced34582eef3599b804794.tar.xz |
Thanks Bluewall for Mantis #3519: a patch that adds simulator uptime and version to REST/json statistics reporting
Diffstat (limited to 'OpenSim/Framework')
4 files changed, 12 insertions, 13 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 45b45b2..483f8b6 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -37,6 +37,7 @@ using log4net.Appender; | |||
37 | using log4net.Core; | 37 | using log4net.Core; |
38 | using log4net.Repository; | 38 | using log4net.Repository; |
39 | using OpenSim.Framework.Console; | 39 | using OpenSim.Framework.Console; |
40 | using OpenSim.Framework.Servers; | ||
40 | using OpenSim.Framework.Statistics; | 41 | using OpenSim.Framework.Statistics; |
41 | using Timer=System.Timers.Timer; | 42 | using Timer=System.Timers.Timer; |
42 | 43 | ||
@@ -458,9 +459,9 @@ namespace OpenSim.Framework.Servers | |||
458 | } | 459 | } |
459 | } | 460 | } |
460 | 461 | ||
461 | public string StatReport() | 462 | public string StatReport(OSHttpRequest httpRequest) |
462 | { | 463 | { |
463 | return m_stats.XReport(); | 464 | return m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version ); |
464 | } | 465 | } |
465 | 466 | ||
466 | protected void RemovePIDFile() | 467 | protected void RemovePIDFile() |
diff --git a/OpenSim/Framework/Statistics/BaseStatsCollector.cs b/OpenSim/Framework/Statistics/BaseStatsCollector.cs index ca0907d..38e2dd5 100644 --- a/OpenSim/Framework/Statistics/BaseStatsCollector.cs +++ b/OpenSim/Framework/Statistics/BaseStatsCollector.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Framework.Statistics | |||
52 | return sb.ToString(); | 52 | return sb.ToString(); |
53 | } | 53 | } |
54 | 54 | ||
55 | public virtual string XReport() | 55 | public virtual string XReport(string uptime, string version) |
56 | { | 56 | { |
57 | return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ; | 57 | return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ; |
58 | } | 58 | } |
diff --git a/OpenSim/Framework/Statistics/Interfaces/IStatsCollector.cs b/OpenSim/Framework/Statistics/Interfaces/IStatsCollector.cs index ac8133d..c1a8f73 100644 --- a/OpenSim/Framework/Statistics/Interfaces/IStatsCollector.cs +++ b/OpenSim/Framework/Statistics/Interfaces/IStatsCollector.cs | |||
@@ -44,6 +44,6 @@ namespace OpenSim.Framework.Statistics | |||
44 | /// <returns> | 44 | /// <returns> |
45 | /// A <see cref="System.String"/> | 45 | /// A <see cref="System.String"/> |
46 | /// </returns> | 46 | /// </returns> |
47 | string XReport(); | 47 | string XReport(string uptime, string version); |
48 | } | 48 | } |
49 | } | 49 | } |
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs index bab2764..75cc23c 100644 --- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs | |||
@@ -384,12 +384,12 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
384 | } | 384 | } |
385 | 385 | ||
386 | /// <summary> | 386 | /// <summary> |
387 | /// Report back collected statistical information. | 387 | /// Report back collected statistical information as json serialization. |
388 | /// </summary> | 388 | /// </summary> |
389 | /// <returns></returns> | 389 | /// <returns></returns> |
390 | public override string XReport() | 390 | public override string XReport(string uptime, string version) |
391 | { | 391 | { |
392 | OSDMap args = new OSDMap(28); | 392 | OSDMap args = new OSDMap(30); |
393 | args["AssetsInCache"] = OSD.FromReal(AssetsInCache); | 393 | args["AssetsInCache"] = OSD.FromReal(AssetsInCache); |
394 | args["TimeAfterCacheMiss"] = OSD.FromReal(assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0); | 394 | args["TimeAfterCacheMiss"] = OSD.FromReal(assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0); |
395 | args["BlockedMissingTextureRequests"] = OSD.FromReal(BlockedMissingTextureRequests); | 395 | args["BlockedMissingTextureRequests"] = OSD.FromReal(BlockedMissingTextureRequests); |
@@ -417,14 +417,12 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
417 | args["OthrFt"] = OSD.FromReal(otherFrameTime); | 417 | args["OthrFt"] = OSD.FromReal(otherFrameTime); |
418 | args["AgntFt"] = OSD.FromReal(agentFrameTime); | 418 | args["AgntFt"] = OSD.FromReal(agentFrameTime); |
419 | args["ImgsFt"] = OSD.FromReal(imageFrameTime); | 419 | args["ImgsFt"] = OSD.FromReal(imageFrameTime); |
420 | args["Memory"] = OSD.FromString(base.XReport()); | 420 | args["Memory"] = OSD.FromString(base.XReport(uptime, version)); |
421 | args["Uptime"] = OSD.FromString(uptime); | ||
422 | args["Version"] = OSD.FromString(version); | ||
421 | 423 | ||
422 | string strBuffer = ""; | 424 | string strBuffer = ""; |
423 | // byte[] buffer = new byte[1]; | ||
424 | |||
425 | strBuffer = OSDParser.SerializeJsonString(args); | 425 | strBuffer = OSDParser.SerializeJsonString(args); |
426 | // UTF8Encoding str = new UTF8Encoding(); | ||
427 | // buffer = str.GetBytes(strBuffer); | ||
428 | 426 | ||
429 | return strBuffer; | 427 | return strBuffer; |
430 | } | 428 | } |
@@ -451,7 +449,7 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
451 | return m_statsProvider.GetStats(); | 449 | return m_statsProvider.GetStats(); |
452 | } | 450 | } |
453 | 451 | ||
454 | public string XReport() | 452 | public string XReport(string uptime, string version) |
455 | { | 453 | { |
456 | return ""; | 454 | return ""; |
457 | } | 455 | } |