mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #4168 from overleaf/jpa-service-worker-version
[misc] serviceWorker: add version to metrics for tracking changes GitOrigin-RevId: 1c05aea2f578fe171dd02330ec7f76f18f02ff65
This commit is contained in:
parent
10e7a919c0
commit
afd79f63ec
1 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,10 @@
|
|||
import { v4 as uuid } from 'uuid'
|
||||
const OError = require('@overleaf/o-error')
|
||||
|
||||
// VERSION should get incremented when making changes to caching behavior or
|
||||
// adjusting metrics collection.
|
||||
const VERSION = 1
|
||||
|
||||
const COMPILE_REQUEST_MATCHER = /^\/project\/[0-9a-f]{24}\/compile$/
|
||||
const PDF_REQUEST_MATCHER = /^\/project\/[0-9a-f]{24}\/.*\/output.pdf$/
|
||||
const PDF_JS_CHUNK_SIZE = 128 * 1024
|
||||
|
@ -21,6 +25,7 @@ function getClientContext(clientId) {
|
|||
if (!clientContext) {
|
||||
const pdfs = new Map()
|
||||
const metrics = {
|
||||
version: VERSION,
|
||||
id: uuid(),
|
||||
epoch: Date.now(),
|
||||
cachedBytes: 0,
|
||||
|
|
Loading…
Reference in a new issue