mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 673292. Provide raw histogram data to c++ consumers. r=jmuizelaar
This will be useful for manually controlling histogram values instead of just acummulating.
This commit is contained in:
parent
d4f71dfd35
commit
f66a1bc657
@ -149,7 +149,7 @@ GetHistogramByEnumId(Telemetry::ID id, Histogram **ret)
|
||||
const TelemetryHistogram &p = gHistograms[id];
|
||||
nsresult rv = HistogramGet(p.id, p.min, p.max, p.bucketCount, p.histogramType, &h);
|
||||
if (NS_FAILED(rv))
|
||||
return NS_ERROR_FAILURE;
|
||||
return rv;
|
||||
|
||||
*ret = knownHistograms[id] = h;
|
||||
return NS_OK;
|
||||
@ -411,6 +411,14 @@ Accumulate(ID aHistogram, PRUint32 aSample)
|
||||
h->Add(aSample);
|
||||
}
|
||||
|
||||
base::Histogram*
|
||||
GetHistogramById(ID id)
|
||||
{
|
||||
Histogram *h = NULL;
|
||||
GetHistogramByEnumId(id, &h);
|
||||
return h;
|
||||
}
|
||||
|
||||
} // namespace Telemetry
|
||||
} // namespace mozilla
|
||||
|
||||
|
@ -42,6 +42,10 @@
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
|
||||
namespace base {
|
||||
class Histogram;
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace Telemetry {
|
||||
|
||||
@ -62,6 +66,11 @@ HistogramCount
|
||||
*/
|
||||
void Accumulate(ID id, PRUint32 sample);
|
||||
|
||||
/**
|
||||
* Return a raw Histogram for direct manipulation for users who can not use Accumulate().
|
||||
*/
|
||||
base::Histogram* GetHistogramById(ID id);
|
||||
|
||||
template<ID id>
|
||||
class AutoTimer {
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user