Bug 1424760 (Part 7) - Don't insert an extra property into the GC telemetry r=Dexter

The properties limit was being exceeded because the telemetry code itself
added a num_slices property.  The GC already adds a slices property
(containing the number of slices) so I've fixed the issue by removing the
creation of the num_slices property, which will stop this limit from being
exceeded.

--HG--
extra : rebase_source : dd5c54fe88f4511b4dffa6e52b7b4d8709886f42
This commit is contained in:
Paul Bone 2018-02-01 22:24:26 +11:00
Родитель e2925f1ee7
Коммит 40e8b95bed
2 изменённых файлов: 5 добавлений и 8 удалений

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

@ -129,7 +129,7 @@ function limitProperties(name, obj, count, log) {
// properties.
if (name === "data" && (
key === "max_pause" ||
key === "num_slices" ||
key === "slices" ||
key === "slices_list" ||
key === "status" ||
key === "timestamp" ||
@ -156,9 +156,6 @@ function limitProperties(name, obj, count, log) {
* etc.
*/
function limitSize(data, log) {
// Store the number of slices so we know if we lost any at the end.
data.num_slices = data.slices_list.length;
data.slices_list.sort((a, b) => b.pause - a.pause);
if (data.slices_list.length > MAX_SLICES) {

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

@ -30,7 +30,7 @@ function run_test() {
GCTelemetry.observeRaw(make_gc());
// Get it back.
assert_num_entries(1, false);
Assert.equal(20, Object.keys(get_entry()).length);
Assert.equal(19, Object.keys(get_entry()).length);
// "true" will cause the entry to be clared.
assert_num_entries(1, true);
// There are currently no entries.
@ -49,18 +49,18 @@ function run_test() {
// Exactly the limit of fields.
let my_gc_24 = make_gc();
for (let i = 0; i < 4; i++) {
for (let i = 0; i < 5; i++) {
my_gc_24["new_property_" + i] = "Data";
}
GCTelemetry.observeRaw(my_gc_24);
// Assert that it was recorded but has only 7 fields.
// Assert that it was recorded has all 24 fields.
Assert.equal(24, Object.keys(get_entry()).length);
assert_num_entries(1, true);
assert_num_entries(0, false);
// Exactly too many fields.
let my_gc_25 = make_gc();
for (let i = 0; i < 5; i++) {
for (let i = 0; i < 6; i++) {
my_gc_25["new_property_" + i] = "Data";
}
GCTelemetry.observeRaw(my_gc_25);