diff options
author | Robert Adams | 2013-02-21 15:48:19 -0800 |
---|---|---|
committer | Robert Adams | 2013-02-21 15:53:04 -0800 |
commit | 76ee47c7972969d7dbadff2c66d050ad84b10078 (patch) | |
tree | a8f4aa4b3a46807ace5401d58c1c975c57679d7f /OpenSim/Framework | |
parent | Add CounterStat which is a wrapper for a counter stat but, because (diff) | |
download | opensim-SC_OLD-76ee47c7972969d7dbadff2c66d050ad84b10078.zip opensim-SC_OLD-76ee47c7972969d7dbadff2c66d050ad84b10078.tar.gz opensim-SC_OLD-76ee47c7972969d7dbadff2c66d050ad84b10078.tar.bz2 opensim-SC_OLD-76ee47c7972969d7dbadff2c66d050ad84b10078.tar.xz |
Add a virtual ToOSDMap() function to Monitoring.Stat for future
overloading by aggregation statistics and browser based stat viewers.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Monitoring/Stats/Stat.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index fccc460..c8d9174 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs | |||
@@ -29,6 +29,8 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Text; | 30 | using System.Text; |
31 | 31 | ||
32 | using OpenMetaverse.StructuredData; | ||
33 | |||
32 | namespace OpenSim.Framework.Monitoring | 34 | namespace OpenSim.Framework.Monitoring |
33 | { | 35 | { |
34 | /// <summary> | 36 | /// <summary> |
@@ -216,6 +218,20 @@ namespace OpenSim.Framework.Monitoring | |||
216 | return sb.ToString(); | 218 | return sb.ToString(); |
217 | } | 219 | } |
218 | 220 | ||
221 | public virtual OSDMap ToOSDMap() | ||
222 | { | ||
223 | OSDMap ret = new OSDMap(); | ||
224 | ret.Add("Category", OSD.FromString(Category)); | ||
225 | ret.Add("Container", OSD.FromString(Container)); | ||
226 | ret.Add("ShortName", OSD.FromString(ShortName)); | ||
227 | ret.Add("Name", OSD.FromString(Name)); | ||
228 | ret.Add("Description", OSD.FromString(Description)); | ||
229 | ret.Add("UnitName", OSD.FromString(UnitName)); | ||
230 | ret.Add("Value", OSD.FromReal(Value)); | ||
231 | |||
232 | return ret; | ||
233 | } | ||
234 | |||
219 | protected void AppendMeasuresOfInterest(StringBuilder sb) | 235 | protected void AppendMeasuresOfInterest(StringBuilder sb) |
220 | { | 236 | { |
221 | if ((MeasuresOfInterest & MeasuresOfInterest.AverageChangeOverTime) | 237 | if ((MeasuresOfInterest & MeasuresOfInterest.AverageChangeOverTime) |