diff options
author | Robert Adams | 2013-07-12 14:04:14 -0700 |
---|---|---|
committer | Robert Adams | 2013-07-12 14:04:14 -0700 |
commit | fa02f28dbfef9b9dc3621f5bbd6b026c827459a5 (patch) | |
tree | 178edf9db976b49c1272cf4566661af27986d47f /OpenSim/Framework/Monitoring/Stats/CounterStat.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-fa02f28dbfef9b9dc3621f5bbd6b026c827459a5.zip opensim-SC-fa02f28dbfef9b9dc3621f5bbd6b026c827459a5.tar.gz opensim-SC-fa02f28dbfef9b9dc3621f5bbd6b026c827459a5.tar.bz2 opensim-SC-fa02f28dbfef9b9dc3621f5bbd6b026c827459a5.tar.xz |
Add ToOSDMap() overrides to the Stat subclass CounterStat.
Add a GetStatsAsOSDMap method to StatsManager which allows the filtered
fetching of stats for eventual returning over the internets.
Diffstat (limited to 'OpenSim/Framework/Monitoring/Stats/CounterStat.cs')
-rwxr-xr-x | OpenSim/Framework/Monitoring/Stats/CounterStat.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Framework/Monitoring/Stats/CounterStat.cs b/OpenSim/Framework/Monitoring/Stats/CounterStat.cs index caea30d..04442c3 100755 --- a/OpenSim/Framework/Monitoring/Stats/CounterStat.cs +++ b/OpenSim/Framework/Monitoring/Stats/CounterStat.cs | |||
@@ -224,5 +224,26 @@ public class CounterStat : Stat | |||
224 | } | 224 | } |
225 | } | 225 | } |
226 | } | 226 | } |
227 | |||
228 | // CounterStat is a basic stat plus histograms | ||
229 | public override OSDMap ToOSDMap() | ||
230 | { | ||
231 | // Get the foundational instance | ||
232 | OSDMap map = base.ToOSDMap(); | ||
233 | |||
234 | map["StatType"] = "CounterStat"; | ||
235 | |||
236 | // If there are any histograms, add a new field that is an array of histograms as OSDMaps | ||
237 | if (m_histograms.Count > 0) | ||
238 | { | ||
239 | OSDArray histos = new OSDArray(); | ||
240 | foreach (EventHistogram histo in m_histograms.Values) | ||
241 | { | ||
242 | histos.Add(histo.GetHistogramAsOSDMap()); | ||
243 | } | ||
244 | map.Add("Histograms", histos); | ||
245 | } | ||
246 | return map; | ||
247 | } | ||
227 | } | 248 | } |
228 | } | 249 | } |