@tramvai/module-metrics 1.106.0 → 1.110.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/browser.js +6 -1
  2. package/package.json +12 -11
package/lib/browser.js CHANGED
@@ -5,6 +5,7 @@ import { METRICS_MODULE_TOKEN } from '@tramvai/tokens-metrics';
5
5
  export * from '@tramvai/tokens-metrics';
6
6
  import { browserTimings } from '@tinkoff/browser-timings';
7
7
  import { Histogram, Summary, Gauge, Counter } from '@tinkoff/metrics-noop';
8
+ import { PAGE_SERVICE_TOKEN } from '@tramvai/tokens-router';
8
9
  import { PAPI_SERVICE } from '@tramvai/tokens-http-client';
9
10
  import { RemoteReporter } from '@tinkoff/logger';
10
11
  import { createEvent, createReducer } from '@tramvai/state';
@@ -187,9 +188,10 @@ MetricsModule = __decorate([
187
188
  },
188
189
  {
189
190
  provide: commandLineListTokens.init,
190
- useFactory: ({ logger }) => () => {
191
+ useFactory: ({ logger, pageService }) => () => {
191
192
  window.addEventListener('load', () => {
192
193
  setTimeout(() => {
194
+ var _a, _b;
193
195
  const timings = browserTimings();
194
196
  const log = logger({
195
197
  name: 'metrics:perf',
@@ -204,6 +206,8 @@ MetricsModule = __decorate([
204
206
  log.info({
205
207
  ...timings,
206
208
  event: 'perf-timings',
209
+ deviceType: ((_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.indexOf('Mobi')) !== -1 ? 'mobile' : 'desktop',
210
+ urlMask: (_b = pageService.getCurrentRoute()) === null || _b === void 0 ? void 0 : _b.path,
207
211
  });
208
212
  }, 0);
209
213
  });
@@ -211,6 +215,7 @@ MetricsModule = __decorate([
211
215
  multi: true,
212
216
  deps: {
213
217
  logger: LOGGER_TOKEN,
218
+ pageService: PAGE_SERVICE_TOKEN,
214
219
  },
215
220
  },
216
221
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-metrics",
3
- "version": "1.106.0",
3
+ "version": "1.110.0",
4
4
  "description": "",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -19,22 +19,23 @@
19
19
  "build-for-publish": "true"
20
20
  },
21
21
  "dependencies": {
22
- "@tramvai/core": "1.106.0",
23
- "@tramvai/tokens-server": "1.106.0",
24
- "@tramvai/tokens-server-private": "1.106.0",
25
- "@tramvai/tokens-metrics": "1.106.0",
26
- "@tramvai/module-common": "1.106.0",
27
- "@tramvai/tokens-http-client": "1.106.0",
28
- "@tramvai/state": "1.106.0",
29
- "@tramvai/papi": "1.106.0",
22
+ "@tramvai/core": "1.110.0",
23
+ "@tramvai/tokens-server": "1.110.0",
24
+ "@tramvai/tokens-server-private": "1.110.0",
25
+ "@tramvai/tokens-metrics": "1.110.0",
26
+ "@tramvai/tokens-router": "1.110.0",
27
+ "@tramvai/module-common": "1.110.0",
28
+ "@tramvai/tokens-http-client": "1.110.0",
29
+ "@tramvai/state": "1.110.0",
30
+ "@tramvai/papi": "1.110.0",
30
31
  "@tinkoff/measure-fastify-requests": "0.0.3",
31
32
  "@tinkoff/monkeypatch": "1.3.4",
32
33
  "@tinkoff/url": "0.7.38",
33
34
  "@tinkoff/utils": "^2.1.2",
34
35
  "prom-client": "^12.0.0",
35
- "@tinkoff/logger": "0.10.16",
36
+ "@tinkoff/logger": "0.10.17",
36
37
  "@tinkoff/metrics-noop": "1.0.3",
37
- "@tinkoff/browser-timings": "0.9.5"
38
+ "@tinkoff/browser-timings": "0.9.6"
38
39
  },
39
40
  "peerDependencies": {
40
41
  "tslib": "^2.0.3"