Add EventHistogram.GetHistogramAsOSDMap that returns that parameters

about the histogram as well as the values.
0.7.4-extended
Robert Adams 2013-02-23 17:50:24 -08:00 committed by Justin Clark-Casey (justincc)
parent caceca87e4
commit 452f6894ef
1 changed files with 228 additions and 211 deletions

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -125,6 +125,23 @@ public class EventHistogram
return ret; return ret;
} }
public OSDMap GetHistogramAsOSDMap()
{
OSDMap ret = new OSDMap();
ret.Add("Buckets", OSD.FromInteger(m_numBuckets));
ret.Add("BucketMilliseconds", OSD.FromInteger(m_bucketMilliseconds));
ret.Add("TotalMilliseconds", OSD.FromInteger(m_totalHistogramMilliseconds));
// Compute a number for the first bucket in the histogram.
// This will allow readers to know how this histogram relates to any previously read histogram.
int baseBucketNum = (m_timeBase / m_bucketMilliseconds) + m_lastBucket + 1;
ret.Add("BaseNumber", OSD.FromInteger(baseBucketNum));
ret.Add("Values", GetHistogramAsOSDArray());
return ret;
}
// Get a copy of the current histogram // Get a copy of the current histogram
public OSDArray GetHistogramAsOSDArray() public OSDArray GetHistogramAsOSDArray()
{ {