Bug 1595482: change "responsiveness" field to "eventDelay" in profiler r=canaltinova

We want the profiler UI to be able to know if the data can be used for
reconstructing the event delays, since it measures something different
from the old 16ms event injection.

Differential Revision: https://phabricator.services.mozilla.com/D52534

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Randell Jesup 2019-11-18 14:26:14 +00:00
Родитель 72f98da7dc
Коммит b3b313e654
8 изменённых файлов: 17 добавлений и 17 удалений

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

@ -354,7 +354,7 @@ static void WriteSample(SpliceableJSONWriter& aWriter,
enum Schema : uint32_t {
STACK = 0,
TIME = 1,
RESPONSIVENESS = 2,
EVENT_DELAY = 2,
};
AutoArraySchemaWriter writer(aWriter, aUniqueStrings);
@ -364,7 +364,7 @@ static void WriteSample(SpliceableJSONWriter& aWriter,
writer.DoubleElement(TIME, aSample.mTime);
if (aSample.mResponsiveness.isSome()) {
writer.DoubleElement(RESPONSIVENESS, *aSample.mResponsiveness);
writer.DoubleElement(EVENT_DELAY, *aSample.mResponsiveness);
}
}

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

@ -323,11 +323,11 @@ class UniqueStacks {
// {
// "stack": 0, /* index into stackTable */
// "time": 1, /* number */
// "responsiveness": 2, /* number */
// "eventDelay": 2, /* number */
// },
// "data":
// [
// [ 1, 0.0, 0.0 ] /* { stack: 1, time: 0.0, responsiveness: 0.0 } */
// [ 1, 0.0, 0.0 ] /* { stack: 1, time: 0.0, eventDelay: 0.0 } */
// ]
// },
//

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

@ -126,7 +126,7 @@ void StreamSamplesAndMarkers(const char* aName, int aThreadId,
JSONSchemaWriter schema(aWriter);
schema.WriteField("stack");
schema.WriteField("time");
schema.WriteField("responsiveness");
schema.WriteField("eventDelay");
}
aWriter.StartArrayProperty("data");

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

@ -707,7 +707,7 @@ static void WriteSample(SpliceableJSONWriter& aWriter,
enum Schema : uint32_t {
STACK = 0,
TIME = 1,
RESPONSIVENESS = 2,
EVENT_DELAY = 2,
};
AutoArraySchemaWriter writer(aWriter, aUniqueStrings);
@ -717,7 +717,7 @@ static void WriteSample(SpliceableJSONWriter& aWriter,
writer.DoubleElement(TIME, aSample.mTime);
if (aSample.mResponsiveness.isSome()) {
writer.DoubleElement(RESPONSIVENESS, *aSample.mResponsiveness);
writer.DoubleElement(EVENT_DELAY, *aSample.mResponsiveness);
}
}

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

@ -460,11 +460,11 @@ class UniqueStacks {
// {
// "stack": 0, /* index into stackTable */
// "time": 1, /* number */
// "responsiveness": 2, /* number */
// "eventDelay": 2, /* number */
// },
// "data":
// [
// [ 1, 0.0, 0.0 ] /* { stack: 1, time: 0.0, responsiveness: 0.0 } */
// [ 1, 0.0, 0.0 ] /* { stack: 1, time: 0.0, eventDelay: 0.0 } */
// ]
// },
//

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

@ -243,7 +243,7 @@ void StreamSamplesAndMarkers(const char* aName, int aThreadId,
JSONSchemaWriter schema(aWriter);
schema.WriteField("stack");
schema.WriteField("time");
schema.WriteField("responsiveness");
schema.WriteField("eventDelay");
}
aWriter.StartArrayProperty("data");

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

@ -2877,7 +2877,7 @@ void SamplerThread::Run() {
DoPeriodicSample(lock, *registeredThread, *profiledThreadData,
now, aRegs, samplePos, localProfileBuffer);
// For "responsiveness", we want the input delay - but if
// For "eventDelay", we want the input delay - but if
// there are no events in the input queue (or even if there
// are), we're interested in how long the delay *would* be for
// an input event now, which would be the time to finish the
@ -3054,8 +3054,8 @@ void SamplerThread::Run() {
registeredThread->GetRunningEventDelay(
aNow, currentEventDelay, currentEventRunning);
// Note: a different definition of responsiveness than the
// 16ms event injection.
// Note: eventDelay is a different definition of
// responsiveness than the 16ms event injection.
// Don't suppress 0's for now; that can be a future
// optimization. We probably want one zero to be stored
@ -3066,7 +3066,7 @@ void SamplerThread::Run() {
currentEventRunning.ToMilliseconds());
});
// If we got responsiveness data, store it before the CompactStack.
// If we got eventDelay data, store it before the CompactStack.
// Note: It is not stored inside the CompactStack so that it doesn't
// get incorrectly duplicated when the thread is sleeping.
if (unresponsiveDuration_ms.isSome()) {

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

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Test that we can measure non-zero event delays (responsiveness)
* Test that we can measure non-zero event delays
*/
add_task(async () => {
@ -22,8 +22,8 @@ add_task(async () => {
const profile = await Services.profiler.getProfileDataAsync();
const [thread] = profile.threads;
const { samples } = thread;
const message = "Responsiveness > 0 not found.";
let SAMPLE_STACK_SLOT = thread.samples.schema.responsiveness;
const message = "eventDelay > 0 not found.";
let SAMPLE_STACK_SLOT = thread.samples.schema.eventDelay;
for (let i = 0; i < samples.data.length; i++) {
if (samples.data[i][SAMPLE_STACK_SLOT] > 0) {