Skip to content

Commit bb3a218

Browse files
author
Marcin Mazurek
committed
[DDW-1163] Improve CPU formatting for analytics
1 parent 4fb516a commit bb3a218

File tree

5 files changed

+315
-129
lines changed

5 files changed

+315
-129
lines changed

source/renderer/app/analytics/MatomoClient.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import MatomoTracker from 'matomo-tracker';
22
import { AnalyticsClient } from './types';
33
import { Environment } from '../../../common/types/environment.types';
4-
import formatCpuInfo from '../utils/formatCpuInfo';
54
import {
65
ANALYTICS_API_ENDPOINT,
76
CPU_DIMENSION_KEY,
@@ -12,6 +11,7 @@ import {
1211
VERSION_DIMENSION_KEY,
1312
} from '../config/analyticsConfig';
1413
import { formattedBytesToSize } from '../utils/formatters';
14+
import { getShortCpuDescription } from '../utils/getShortCpuDescription';
1515

1616
/**
1717
* Matomo API reference:
@@ -32,9 +32,10 @@ export class MatomoClient implements AnalyticsClient {
3232
_id: this.userId,
3333
action_name: pageTitle,
3434
url: this.getAnalyticsURL(),
35-
[CPU_DIMENSION_KEY]: formatCpuInfo(this.environment.cpu),
35+
[CPU_DIMENSION_KEY]: getShortCpuDescription(
36+
this.environment.cpu[0]?.model || ''
37+
),
3638
[RAM_DIMENSION_KEY]: formattedBytesToSize(this.environment.ram),
37-
[OS_DIMENSION_KEY]: this.environment.os,
3839
[VERSION_DIMENSION_KEY]: this.environment.version,
3940
});
4041
};

source/renderer/app/utils/formatCpuInfo.spec.ts

Lines changed: 0 additions & 80 deletions
This file was deleted.

source/renderer/app/utils/formatCpuInfo.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)