зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1204994 - part 2 - rename all USE_COUNTER_* histograms to USE_COUNTER2_* histograms; r=bz,vladan
We're changing the definition of each of the use counter histograms. Therefore, they need new names, so as to not throw wrenches into the server-side machinery. This renaming is the most straightforward way to do things and similar to how we have renamed other histograms before.
This commit is contained in:
Родитель
efcd399157
Коммит
85b556763a
|
@ -13079,9 +13079,9 @@ nsDocument::ReportUseCounters()
|
|||
}
|
||||
printf(": %d\n", value);
|
||||
}
|
||||
}
|
||||
|
||||
Telemetry::Accumulate(id, value);
|
||||
Telemetry::Accumulate(id, 1);
|
||||
}
|
||||
|
||||
if (IsTopLevelContentDocument()) {
|
||||
id = static_cast<Telemetry::ID>(Telemetry::HistogramFirstUseCounter +
|
||||
|
@ -13098,9 +13098,9 @@ nsDocument::ReportUseCounters()
|
|||
}
|
||||
printf(": %d\n", value);
|
||||
}
|
||||
}
|
||||
|
||||
Telemetry::Accumulate(id, value);
|
||||
Telemetry::Accumulate(id, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,8 +104,8 @@ function grabHistogramsFromContent(browser, use_counter_middlefix) {
|
|||
return telemetry.getHistogramById(name).snapshot();
|
||||
}
|
||||
|
||||
let histogram_page_name = "USE_COUNTER_" + arg.middlefix + "_PAGE";
|
||||
let histogram_document_name = "USE_COUNTER_" + arg.middlefix + "_DOCUMENT";
|
||||
let histogram_page_name = "USE_COUNTER2_" + arg.middlefix + "_PAGE";
|
||||
let histogram_document_name = "USE_COUNTER2_" + arg.middlefix + "_DOCUMENT";
|
||||
let histogram_page = snapshot_histogram(histogram_page_name);
|
||||
let histogram_document = snapshot_histogram(histogram_document_name);
|
||||
return [histogram_page.sum, histogram_document.sum];
|
||||
|
|
|
@ -62,8 +62,8 @@ def generate_histograms(filename):
|
|||
'description': desc }
|
||||
|
||||
def append_counters(name, desc):
|
||||
append_counter('USE_COUNTER_%s_DOCUMENT' % name, 'Whether a document %s' % desc)
|
||||
append_counter('USE_COUNTER_%s_PAGE' % name, 'Whether a page %s' % desc)
|
||||
append_counter('USE_COUNTER2_%s_DOCUMENT' % name, 'Whether a document %s' % desc)
|
||||
append_counter('USE_COUNTER2_%s_PAGE' % name, 'Whether a page %s' % desc)
|
||||
|
||||
if counter['type'] == 'method':
|
||||
method = '%s.%s' % (counter['interface_name'], counter['method_name'])
|
||||
|
|
|
@ -26,10 +26,10 @@ def main(output, *filenames):
|
|||
print("enum ID : uint32_t {", file=output)
|
||||
|
||||
groups = itertools.groupby(histogram_tools.from_files(filenames),
|
||||
lambda h: h.name().startswith("USE_COUNTER_"))
|
||||
lambda h: h.name().startswith("USE_COUNTER2_"))
|
||||
seen_use_counters = False
|
||||
|
||||
# Note that histogram_tools.py guarantees that all of the USE_COUNTER_*
|
||||
# Note that histogram_tools.py guarantees that all of the USE_COUNTER2_*
|
||||
# histograms are defined in a contiguous block. We therefore assume
|
||||
# that there's at most one group for which use_counter_group is true.
|
||||
for (use_counter_group, histograms) in groups:
|
||||
|
|
|
@ -293,7 +293,7 @@ def from_nsDeprecatedOperationList(filename):
|
|||
op = match.group(1)
|
||||
|
||||
def add_counter(context):
|
||||
name = 'USE_COUNTER_DEPRECATED_%s_%s' % (op, context.upper())
|
||||
name = 'USE_COUNTER2_DEPRECATED_%s_%s' % (op, context.upper())
|
||||
histograms[name] = {
|
||||
'expires_in_version': 'never',
|
||||
'kind': 'boolean',
|
||||
|
@ -339,9 +339,9 @@ the histograms defined in filenames.
|
|||
raise DefinitionException, "duplicate histogram name %s" % name
|
||||
all_histograms[name] = definition
|
||||
|
||||
# We require that all USE_COUNTER_* histograms be defined in a contiguous
|
||||
# We require that all USE_COUNTER2_* histograms be defined in a contiguous
|
||||
# block.
|
||||
use_counter_indices = filter(lambda x: x[1].startswith("USE_COUNTER_"),
|
||||
use_counter_indices = filter(lambda x: x[1].startswith("USE_COUNTER2_"),
|
||||
enumerate(all_histograms.iterkeys()));
|
||||
if use_counter_indices:
|
||||
lower_bound = use_counter_indices[0][0]
|
||||
|
|
Загрузка…
Ссылка в новой задаче