1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #11029 from brendandahl/pdfjs-telemetry-update

[api-minor] Update telemetry to use 'categorical' histograms.
This commit is contained in:
Tim van der Meij 2019-08-02 00:11:02 +02:00 committed by GitHub
commit e0b38bed3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 25 deletions

View file

@ -1141,8 +1141,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',
@ -1155,7 +1157,7 @@ let PDFViewerApplication = {
if (!generator.includes(s)) {
return false;
}
generatorId = i + 1;
generatorId = s.replace(/[ .\-]/g, '_');
return true;
}.bind(null, info.Producer.toLowerCase()));
}