From 7d63676cfc04f87a1a8e5d805b80e6a195366057 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 21 Feb 2013 15:48:19 -0800 Subject: [PATCH] Add a virtual ToOSDMap() function to Monitoring.Stat for future overloading by aggregation statistics and browser based stat viewers. --- OpenSim/Framework/Monitoring/Stats/Stat.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index fccc4601ca..c8d91744c1 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs @@ -29,6 +29,8 @@ using System; using System.Collections.Generic; using System.Text; +using OpenMetaverse.StructuredData; + namespace OpenSim.Framework.Monitoring { /// @@ -216,6 +218,20 @@ namespace OpenSim.Framework.Monitoring return sb.ToString(); } + public virtual OSDMap ToOSDMap() + { + OSDMap ret = new OSDMap(); + ret.Add("Category", OSD.FromString(Category)); + ret.Add("Container", OSD.FromString(Container)); + ret.Add("ShortName", OSD.FromString(ShortName)); + ret.Add("Name", OSD.FromString(Name)); + ret.Add("Description", OSD.FromString(Description)); + ret.Add("UnitName", OSD.FromString(UnitName)); + ret.Add("Value", OSD.FromReal(Value)); + + return ret; + } + protected void AppendMeasuresOfInterest(StringBuilder sb) { if ((MeasuresOfInterest & MeasuresOfInterest.AverageChangeOverTime)