mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[api-minor] Update telemetry to use 'categorical' histograms.
Firefox telemetry supports using string labels now. Convert our integers that we used for categories to just use strings. The upstream work will happen in: https://bugzilla.mozilla.org/show_bug.cgi?id=1566882
This commit is contained in:
parent
71d9f5f860
commit
31d71808e7
3 changed files with 27 additions and 25 deletions
|
@ -1137,8 +1137,10 @@ let PDFViewerApplication = {
|
|||
|
||||
if (typeof PDFJSDev !== 'undefined' &&
|
||||
PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
|
||||
let versionId = String(info.PDFFormatVersion).slice(-1) | 0;
|
||||
let generatorId = 0;
|
||||
// Telemetry labels must be C++ variable friendly.
|
||||
const versionId = `v${info.PDFFormatVersion.replace('.', '_')}`;
|
||||
let generatorId = 'other';
|
||||
// Keep these in sync with mozilla central's Histograms.json.
|
||||
const KNOWN_GENERATORS = [
|
||||
'acrobat distiller', 'acrobat pdfwriter', 'adobe livecycle',
|
||||
'adobe pdf library', 'adobe photoshop', 'ghostscript', 'tcpdf',
|
||||
|
@ -1151,7 +1153,7 @@ let PDFViewerApplication = {
|
|||
if (!generator.includes(s)) {
|
||||
return false;
|
||||
}
|
||||
generatorId = i + 1;
|
||||
generatorId = s.replace(/[ .\-]/g, '_');
|
||||
return true;
|
||||
}.bind(null, info.Producer.toLowerCase()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue