1
1
import ElectronStore from 'electron-store' ;
2
2
import nets from 'nets' ;
3
+ import * as os from 'os' ;
3
4
import uuidv1 from 'uuid/v1' ; // semi-persistent client ID
4
5
import uuidv4 from 'uuid/v4' ; // random ID
5
6
@@ -17,7 +18,7 @@ import uuidv4 from 'uuid/v4'; // random ID
17
18
* Default telemetry service URLs
18
19
*/
19
20
const TelemetryServerURL = Object . freeze ( {
20
- staging : 'http://scratch-telemetry-s .us-east-1.elasticbeanstalk.com/' ,
21
+ staging : 'http://scratch-telemetry-staging .us-east-1.elasticbeanstalk.com/' ,
21
22
production : 'https://telemetry.scratch.mit.edu/'
22
23
} ) ;
23
24
const DefaultServerURL = (
@@ -49,6 +50,12 @@ const DefaultQueueLimit = 100;
49
50
*/
50
51
const DeliveryAttemptLimit = 3 ;
51
52
53
+ const platform = [
54
+ `${ os . platform ( ) } ${ os . release ( ) } ` , // "win32 10.0.18362", "darwin 18.7.0", etc.
55
+ `Electron ${ process . versions . electron } ` , // "Electron 4.2.6"
56
+ `Store=${ process . mas || process . windowsStore || false } ` // "Store=true" or "Store=false"
57
+ ] . join ( ', ' ) ;
58
+
52
59
53
60
/**
54
61
* Client interface for the Scratch telemetry service.
@@ -213,6 +220,7 @@ class TelemetryClient {
213
220
clientID : this . clientID ,
214
221
id : packetId ,
215
222
name : eventName ,
223
+ platform,
216
224
timestamp : now . getTime ( ) ,
217
225
userTimezone : now . getTimezoneOffset ( )
218
226
} , additionalFields ) ;
0 commit comments