aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorRobert Adams2013-02-21 15:48:19 -0800
committerRobert Adams2013-02-21 15:53:04 -0800
commit76ee47c7972969d7dbadff2c66d050ad84b10078 (patch)
treea8f4aa4b3a46807ace5401d58c1c975c57679d7f /OpenSim
parentAdd CounterStat which is a wrapper for a counter stat but, because (diff)
downloadopensim-SC-76ee47c7972969d7dbadff2c66d050ad84b10078.zip
opensim-SC-76ee47c7972969d7dbadff2c66d050ad84b10078.tar.gz
opensim-SC-76ee47c7972969d7dbadff2c66d050ad84b10078.tar.bz2
opensim-SC-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')
-rw-r--r--OpenSim/Framework/Monitoring/Stats/Stat.cs16
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;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text; 30using System.Text;
31 31
32using OpenMetaverse.StructuredData;
33
32namespace OpenSim.Framework.Monitoring 34namespace 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)