Bug 672207. imglib-telemetry: record the full time it takes to decode images. r=jlebar,joe

Do this by accumulating decode latency in mDecodeTime which is added to imgDecodeWorker.
This commit is contained in:
Jeff Muizelaar 2011-08-04 16:25:12 -04:00
Родитель efcaa5f9a8
Коммит a17a7ea495
3 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -2711,6 +2711,9 @@ imgDecodeWorker::Run()
TimeDuration decodeLatency = TimeStamp::Now() - start;
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_LATENCY, PRInt32(decodeLatency.ToMicroseconds()));
// accumulate the total decode time
mDecodeTime += decodeLatency;
// Flush invalidations _after_ we've written everything we're going to.
// Furthermore, if this is a redecode, we don't want to do progressive
// display at all. In that case, let Decoder::PostFrameStop() do the
@ -2723,6 +2726,7 @@ imgDecodeWorker::Run()
// If the decode finished, shutdown the decoder
if (image->mDecoder && image->IsDecodeFinished()) {
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_TIME, PRInt32(mDecodeTime.ToMicroseconds()));
rv = image->ShutdownDecoder(RasterImage::eShutdownIntent_Done);
if (NS_FAILED(rv)) {
image->DoError();

Просмотреть файл

@ -64,6 +64,7 @@
#include "imgFrame.h"
#include "nsThreadUtils.h"
#include "DiscardTracker.h"
#include "mozilla/TimeStamp.h"
#ifdef DEBUG
#include "imgIContainerDebug.h"
#endif
@ -571,6 +572,7 @@ class imgDecodeWorker : public nsRunnable
private:
nsWeakPtr mContainer;
TimeDuration mDecodeTime; // the default constructor initializes to 0
};
// Asynchronous Decode Requestor

Просмотреть файл

@ -83,7 +83,8 @@ HISTOGRAM(MAC_INITFONTLIST_TOTAL, 1, 30000, 10, EXPONENTIAL, "gfxMacPlatformFont
#endif
HISTOGRAM(SHUTDOWN_OK, 0, 1, 2, BOOLEAN, "Did the browser start after a successful shutdown")
HISTOGRAM(IMAGE_DECODE_LATENCY, 50, 5000000, 100, EXPONENTIAL, "Time spent decoding an image chunk (us)")
HISTOGRAM(IMAGE_DECODE_LATENCY, 50, 5000000, 100, EXPONENTIAL, "Time spent decoding an image chunk (us)")
HISTOGRAM(IMAGE_DECODE_TIME, 50, 50000000, 100, EXPONENTIAL, "Time spent decoding an image (us)")
/**
* Networking telemetry