diff options
Diffstat (limited to 'OpenSim/Framework/Monitoring/Stats/Stat.cs')
-rw-r--r-- | OpenSim/Framework/Monitoring/Stats/Stat.cs | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index a7cb2a6..2402acd 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs | |||
@@ -121,17 +121,17 @@ namespace OpenSim.Framework.Monitoring | |||
121 | string container, | 121 | string container, |
122 | StatType type, | 122 | StatType type, |
123 | Action<Stat> pullAction, | 123 | Action<Stat> pullAction, |
124 | StatVerbosity verbosity) | 124 | StatVerbosity verbosity) |
125 | : this( | 125 | : this( |
126 | shortName, | 126 | shortName, |
127 | name, | 127 | name, |
128 | description, | 128 | description, |
129 | unitName, | 129 | unitName, |
130 | category, | 130 | category, |
131 | container, | 131 | container, |
132 | type, | 132 | type, |
133 | MeasuresOfInterest.None, | 133 | MeasuresOfInterest.None, |
134 | pullAction, | 134 | pullAction, |
135 | verbosity) | 135 | verbosity) |
136 | { | 136 | { |
137 | } | 137 | } |
@@ -227,11 +227,11 @@ namespace OpenSim.Framework.Monitoring | |||
227 | { | 227 | { |
228 | StringBuilder sb = new StringBuilder(); | 228 | StringBuilder sb = new StringBuilder(); |
229 | sb.AppendFormat( | 229 | sb.AppendFormat( |
230 | "{0}.{1}.{2} : {3}{4}", | 230 | "{0}.{1}.{2} : {3}{4}", |
231 | Category, | 231 | Category, |
232 | Container, | 232 | Container, |
233 | ShortName, | 233 | ShortName, |
234 | Value, | 234 | Value, |
235 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); | 235 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); |
236 | 236 | ||
237 | AppendMeasuresOfInterest(sb); | 237 | AppendMeasuresOfInterest(sb); |
@@ -239,6 +239,17 @@ namespace OpenSim.Framework.Monitoring | |||
239 | return sb.ToString(); | 239 | return sb.ToString(); |
240 | } | 240 | } |
241 | 241 | ||
242 | public virtual OSDMap ToBriefOSDMap() | ||
243 | { | ||
244 | OSDMap ret = new OSDMap(); | ||
245 | |||
246 | ret.Add("Value", OSD.FromReal(Value)); | ||
247 | |||
248 | double lastChangeOverTime, averageChangeOverTime; | ||
249 | |||
250 | return ret; | ||
251 | } | ||
252 | |||
242 | public virtual OSDMap ToOSDMap() | 253 | public virtual OSDMap ToOSDMap() |
243 | { | 254 | { |
244 | OSDMap ret = new OSDMap(); | 255 | OSDMap ret = new OSDMap(); |
@@ -279,7 +290,7 @@ namespace OpenSim.Framework.Monitoring | |||
279 | lock (m_samples) | 290 | lock (m_samples) |
280 | { | 291 | { |
281 | // m_log.DebugFormat( | 292 | // m_log.DebugFormat( |
282 | // "[STAT]: Samples for {0} are {1}", | 293 | // "[STAT]: Samples for {0} are {1}", |
283 | // Name, string.Join(",", m_samples.Select(s => s.ToString()).ToArray())); | 294 | // Name, string.Join(",", m_samples.Select(s => s.ToString()).ToArray())); |
284 | 295 | ||
285 | foreach (double s in m_samples) | 296 | foreach (double s in m_samples) |
@@ -315,12 +326,12 @@ namespace OpenSim.Framework.Monitoring | |||
315 | if (ComputeMeasuresOfInterest(out lastChangeOverTime, out averageChangeOverTime)) | 326 | if (ComputeMeasuresOfInterest(out lastChangeOverTime, out averageChangeOverTime)) |
316 | { | 327 | { |
317 | sb.AppendFormat( | 328 | sb.AppendFormat( |
318 | ", {0:0.##}{1}/s, {2:0.##}{3}/s", | 329 | ", {0:0.##}{1}/s, {2:0.##}{3}/s", |
319 | lastChangeOverTime, | 330 | lastChangeOverTime, |
320 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName), | 331 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName), |
321 | averageChangeOverTime, | 332 | averageChangeOverTime, |
322 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); | 333 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); |
323 | } | 334 | } |
324 | } | 335 | } |
325 | } | 336 | } |
326 | } \ No newline at end of file | 337 | } |