mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2025-01-09 06:01:57 -05:00
Merge pull request #67 from cwillisf/telemetry-platform
telemetry: add 'platform' and improve 'version'
This commit is contained in:
commit
76dc35cf52
2 changed files with 11 additions and 2 deletions
|
@ -1,10 +1,11 @@
|
|||
import {app, ipcMain} from 'electron';
|
||||
import defaultsDeep from 'lodash.defaultsdeep';
|
||||
import {version} from '../../package.json';
|
||||
|
||||
import TelemetryClient from './telemetry/TelemetryClient';
|
||||
|
||||
const EVENT_TEMPLATE = {
|
||||
version: '3.0.0',
|
||||
version,
|
||||
projectName: '',
|
||||
language: '',
|
||||
metadata: {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import ElectronStore from 'electron-store';
|
||||
import nets from 'nets';
|
||||
import * as os from 'os';
|
||||
import uuidv1 from 'uuid/v1'; // semi-persistent client ID
|
||||
import uuidv4 from 'uuid/v4'; // random ID
|
||||
|
||||
|
@ -17,7 +18,7 @@ import uuidv4 from 'uuid/v4'; // random ID
|
|||
* Default telemetry service URLs
|
||||
*/
|
||||
const TelemetryServerURL = Object.freeze({
|
||||
staging: 'http://scratch-telemetry-s.us-east-1.elasticbeanstalk.com/',
|
||||
staging: 'http://scratch-telemetry-staging.us-east-1.elasticbeanstalk.com/',
|
||||
production: 'https://telemetry.scratch.mit.edu/'
|
||||
});
|
||||
const DefaultServerURL = (
|
||||
|
@ -49,6 +50,12 @@ const DefaultQueueLimit = 100;
|
|||
*/
|
||||
const DeliveryAttemptLimit = 3;
|
||||
|
||||
const platform = [
|
||||
`${os.platform()} ${os.release()}`, // "win32 10.0.18362", "darwin 18.7.0", etc.
|
||||
`Electron ${process.versions.electron}`, // "Electron 4.2.6"
|
||||
`Store=${process.mas || process.windowsStore || false}` // "Store=true" or "Store=false"
|
||||
].join(', ');
|
||||
|
||||
|
||||
/**
|
||||
* Client interface for the Scratch telemetry service.
|
||||
|
@ -213,6 +220,7 @@ class TelemetryClient {
|
|||
clientID: this.clientID,
|
||||
id: packetId,
|
||||
name: eventName,
|
||||
platform,
|
||||
timestamp: now.getTime(),
|
||||
userTimezone: now.getTimezoneOffset()
|
||||
}, additionalFields);
|
||||
|
|
Loading…
Reference in a new issue