mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
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.
This commit is contained in:
@@ -224,5 +224,26 @@ public class CounterStat : Stat
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CounterStat is a basic stat plus histograms
|
||||
public override OSDMap ToOSDMap()
|
||||
{
|
||||
// Get the foundational instance
|
||||
OSDMap map = base.ToOSDMap();
|
||||
|
||||
map["StatType"] = "CounterStat";
|
||||
|
||||
// If there are any histograms, add a new field that is an array of histograms as OSDMaps
|
||||
if (m_histograms.Count > 0)
|
||||
{
|
||||
OSDArray histos = new OSDArray();
|
||||
foreach (EventHistogram histo in m_histograms.Values)
|
||||
{
|
||||
histos.Add(histo.GetHistogramAsOSDMap());
|
||||
}
|
||||
map.Add("Histograms", histos);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user