mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-27 13:28:42 +00:00
00ce1ce6fd
- Bug 1175347 - Add a JSAPI test for exposing availability of locales derived from the default locale. r=itsatest, rs=till over IRL (0bba85db1) - Bug 1175347 - Fix a test that assumes too much in compacting builds. r=intermittent-orange in a CLOSED TREE (b2992b31c) - Bug 1171180 - Remove trunc from jsmath; r=jorendorff (0e8913338) - Bug 1176864 - Truncate modulo operator for int32 r=h4writer, r=nbp (5de9c5340) - Bug 1166790 - Remove old Statistics formatting code; r=sfink (6abc54dab) - Bug 1171612 - Use C++11 features to make Statistics module nicer; r=sfink (d0cfef988) - Bug 1132208 - "Remove dead code from framerate actor now in GraphsWorker.js". r=jsantell (4bfaf2773) - Bug 1146237 - FramerateActor should use docShell.now() rather than performance.now so that page refreshes do not break it. r=vp (a0d3fbd28) - Bug 1134079 - Supply audio node definitions directly from the client if the webaudio actor server does not support it (like on older versions of FxOS). r=vp (95f728d47) - Bug 1172183 - Pull out the implementation of FramerateActor so that it can be consumed by other actors. r=vp (1c3f0d82a) - Bug 1172182 - Pull out memory utility logic out of the MemoryActor so other actors can consume it. r=vp (851d1cce3) - Bug 1172182 part 2: correctly link to the memory module via timeline actor. r=vp (3714663db) - Bug 1172184 - Pull out logic from TimelineActor into a standalone module that can be consumed by other actors. (031127dc0) - partial of Bug 1159506 - Make GC events use TimeStamp. r=terrence (99fa0378f) - Bug 1035973 - Add DebuggerObject.getOwnPropertySymbols; r=fitzgen (fd10482d5) - Bug 1174712 - Tolerate singleton objects with uncacheable prototypes in Ion caches, r=jandem. (7c3ce4fdc) - add limits for numeric_limits (67b09aa7f) - Bug 811911 - Use UTF-8 output for TwoByte chars in Error objects; r=jandem (2fd3cf6cd) - Fix the test for bug 1173787 to work even when the filename contains a ':' (e.g. on Windows) so we can reopen the CLOSED TREE (b42aa3b92) - Bug 1100498 - Report function names for addon exceptions. r=billm (dfa69d830) - Bug 1170840 - Add testbed allocator for new regalloc features, and use for a change to hot/cold code bundle splitting, r=sunfish. (95c484a37) - Bug 1174542 - Remove unnecessary AutoWritabeJitCode from initTraceLogger. r=luke (a427e979c) - Bug 1173529: IonMonkey - Also iterate phis when removing guards, r=nbp (055a5dcd7) - Bug 1114079 - Fix overrecursion check in nsGlobalWindow::SetNewDocument to not report a JS exception. r=bz (7c0ba0677) - Bug 1172513 part 1. Fix shell's Evaluate to actually throw when it detects save/load bytecode mismatches. r=waldo (5f5ccc094) - Bug 1172513 part 2. When XDR-encoding a function, don't incode temporary flags. r=waldo (404fa1939) - Bug 1171430 - Do not poison the nursery's chunk kind marker; r=terrence (248667fc9) - Bug 1171430 - Don't shift the poison value by non-byte values; r=jonco (320ba4ba0) - Bug 1173908 - Fix an MSVC warning about negating an unsigned integer; r=nbp (3244fd56c) - Bug 1172545 - Recover from OOM if Ion compilation is skipped due to not being able to allocate a 'this' object, r=jandem. (918025215)
97 lines
2.9 KiB
JavaScript
97 lines
2.9 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
"use strict";
|
|
|
|
/**
|
|
* Import `createTask` to communicate with `devtools/toolkit/shared/worker`.
|
|
*/
|
|
importScripts("resource://gre/modules/workers/require.js");
|
|
const { createTask } = require("resource://gre/modules/devtools/shared/worker-helper");
|
|
|
|
/**
|
|
* @see LineGraphWidget.prototype.setDataFromTimestamps in Graphs.jsm
|
|
* @param number id
|
|
* @param array timestamps
|
|
* @param number interval
|
|
*/
|
|
createTask(self, "plotTimestampsGraph", function ({ timestamps, interval, duration }) {
|
|
let plottedData = plotTimestamps(timestamps, interval);
|
|
let plottedMinMaxSum = getMinMaxAvg(plottedData, timestamps, duration);
|
|
|
|
return { plottedData, plottedMinMaxSum };
|
|
});
|
|
|
|
/**
|
|
* Gets the min, max and average of the values in an array.
|
|
* @param array source
|
|
* @return object
|
|
*/
|
|
function getMinMaxSum(source) {
|
|
let totalTicks = source.length;
|
|
let maxValue = Number.MIN_SAFE_INTEGER;
|
|
let minValue = Number.MAX_SAFE_INTEGER;
|
|
let avgValue = 0;
|
|
let sumValues = 0;
|
|
|
|
for (let { value } of source) {
|
|
maxValue = Math.max(value, maxValue);
|
|
minValue = Math.min(value, minValue);
|
|
sumValues += value;
|
|
}
|
|
avgValue = sumValues / totalTicks;
|
|
|
|
return { minValue, maxValue, avgValue };
|
|
}
|
|
|
|
/**
|
|
* Takes a list of numbers and plots them on a line graph representing
|
|
* the rate of occurences in a specified interval.
|
|
*
|
|
* @param array timestamps
|
|
* A list of numbers representing time, ordered ascending. For example,
|
|
* this can be the raw data received from the framerate actor, which
|
|
* represents the elapsed time on each refresh driver tick.
|
|
* @param number interval
|
|
* The maximum amount of time to wait between calculations.
|
|
* @param number clamp
|
|
* The maximum allowed value.
|
|
* @return array
|
|
* A collection of { delta, value } objects representing the
|
|
* plotted value at every delta time.
|
|
*/
|
|
function plotTimestamps(timestamps, interval = 100, clamp = 60) {
|
|
let timeline = [];
|
|
let totalTicks = timestamps.length;
|
|
|
|
// If the refresh driver didn't get a chance to tick before the
|
|
// recording was stopped, assume rate was 0.
|
|
if (totalTicks == 0) {
|
|
timeline.push({ delta: 0, value: 0 });
|
|
timeline.push({ delta: interval, value: 0 });
|
|
return timeline;
|
|
}
|
|
|
|
let frameCount = 0;
|
|
let prevTime = +timestamps[0];
|
|
|
|
for (let i = 1; i < totalTicks; i++) {
|
|
let currTime = +timestamps[i];
|
|
frameCount++;
|
|
|
|
let elapsedTime = currTime - prevTime;
|
|
if (elapsedTime < interval) {
|
|
continue;
|
|
}
|
|
|
|
let rate = Math.min(1000 / (elapsedTime / frameCount), clamp);
|
|
timeline.push({ delta: prevTime, value: rate });
|
|
timeline.push({ delta: currTime, value: rate });
|
|
|
|
frameCount = 0;
|
|
prevTime = currTime;
|
|
}
|
|
|
|
return timeline;
|
|
}
|