Bug 968923 - part 3c - miscellaneous telemetry changes for use counters; r=gfritzsche

This patch teaches gen-histogram-enum.py how to correctly deal with the
situation where there are no use counters.  It also adds
mozilla::Telemetry::GetHistogramName for debugging purposes.
This commit is contained in:
Nathan Froyd 2015-06-03 14:38:15 -04:00
Родитель 2e3473ca07
Коммит 2de21811cf
3 изменённых файлов: 11 добавлений и 0 удалений

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

@ -3751,6 +3751,13 @@ GetHistogramById(ID id)
return h;
}
const char*
GetHistogramName(Telemetry::ID id)
{
const TelemetryHistogram& h = gHistograms[id];
return h.id();
}
void
RecordSlowSQLStatement(const nsACString &statement,
const nsACString &dbName,

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

@ -76,6 +76,8 @@ void AccumulateTimeDelta(ID id, TimeStamp start, TimeStamp end = TimeStamp::Now(
*/
base::Histogram* GetHistogramById(ID id);
const char* GetHistogramName(ID id);
/**
* Return a raw histogram for keyed histograms.
*/

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

@ -59,6 +59,8 @@ def main(output, *filenames):
if seen_use_counters:
print(" HistogramUseCounterCount = HistogramLastUseCounter - HistogramFirstUseCounter + 1", file=output)
else:
print(" HistogramFirstUseCounter = 0,", file=output)
print(" HistogramLastUseCounter = 0,", file=output)
print(" HistogramUseCounterCount = 0", file=output)
print("};", file=output)