package.build.cjs.integrations.sessiontiming.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Base implementation for all Sentry JavaScript SDKs
{"version":3,"file":"sessiontiming.js","sources":["../../../src/integrations/sessiontiming.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/types';\nimport { timestampInSeconds } from '@sentry/utils';\nimport { defineIntegration } from '../integration';\n\nconst INTEGRATION_NAME = 'SessionTiming';\n\nconst _sessionTimingIntegration = (() => {\n const startTime = timestampInSeconds() * 1000;\n\n return {\n name: INTEGRATION_NAME,\n processEvent(event) {\n const now = timestampInSeconds() * 1000;\n\n return {\n ...event,\n extra: {\n ...event.extra,\n ['session:start']: startTime,\n ['session:duration']: now - startTime,\n ['session:end']: now,\n },\n };\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * This function adds duration since the sessionTimingIntegration was initialized\n * till the time event was sent.\n */\nexport const sessionTimingIntegration = defineIntegration(_sessionTimingIntegration);\n"],"names":["timestampInSeconds","defineIntegration"],"mappings":";;;;;AAIA,MAAM,gBAAA,GAAmB,eAAe,CAAA;AACxC;AACA,MAAM,yBAA0B,IAAG,MAAM;AACzC,EAAE,MAAM,SAAU,GAAEA,wBAAkB,EAAC,GAAI,IAAI,CAAA;AAC/C;AACA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,YAAY,CAAC,KAAK,EAAE;AACxB,MAAM,MAAM,GAAI,GAAEA,wBAAkB,EAAC,GAAI,IAAI,CAAA;AAC7C;AACA,MAAM,OAAO;AACb,QAAQ,GAAG,KAAK;AAChB,QAAQ,KAAK,EAAE;AACf,UAAU,GAAG,KAAK,CAAC,KAAK;AACxB,UAAU,CAAC,eAAe,GAAG,SAAS;AACtC,UAAU,CAAC,kBAAkB,GAAG,GAAA,GAAM,SAAS;AAC/C,UAAU,CAAC,aAAa,GAAG,GAAG;AAC9B,SAAS;AACT,OAAO,CAAA;AACP,KAAK;AACL,GAAG,CAAA;AACH,CAAC,CAAE,EAAA;AACH;AACA;AACA;AACA;AACA;MACa,wBAAyB,GAAEC,6BAAiB,CAAC,yBAAyB;;;;"}