-
Notifications
You must be signed in to change notification settings - Fork 0
/
ai.js
78 lines (51 loc) · 2.48 KB
/
ai.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
const { Worker, isMainThread } = require('worker_threads');
const readline = require('readline-sync');
let telemetryWorker = new Worker("./TelemetryClient/telemetryClient2.js");
telemetryWorker.postMessage({eventName: 'Application started', properties: {Technology: 'Node.js5'}});
var name = readline.question("What is your name? ");
telemetryWorker.postMessage({eventName: 'Name entered', properties: {Name: name}});
var age = readline.question("What is your age? ");
telemetryWorker.postMessage({eventName: 'Age entered', properties: {Age: age}});
//client.trackEvent({name: "name entered", properties: {name: name}});
//client.flush({callback: this.askAge});
// class questions {
// constructor () {
// this.askAge = this.askAge.bind(this)
// }
// askAge() {
// var age = readline.question("What is your age? ");
// client.trackEvent({name: "age entered", properties: {age: age}});
// }
// askName() {
// var name = readline.question("What is your name? ");
// client.trackEvent({name: "name entered", properties: {name: name}});
// client.flush({callback: this.askAge});
// }
// }
// let q = new questions()
// appInsights.setup(connectionString).setAutoCollectConsole(true).start();
// let client = appInsights.defaultClient;
// client.trackEvent({name: "my custom event", properties: {myProp: "custom property value 2"}});
// client.flush({callback: q.askName()});
// const readline = require('readline-sync');
// let appInsights = require("applicationinsights");
// let connectionString = 'InstrumentationKey=c764f176-19a5-4949-825d-9f30db2f14e8;IngestionEndpoint=https://germanywestcentral-1.in.applicationinsights.azure.com';
// class questions {
// constructor () {
// this.askAge = this.askAge.bind(this)
// }
// askAge() {
// var age = readline.question("What is your age? ");
// client.trackEvent({name: "age entered", properties: {age: age}});
// }
// askName() {
// var name = readline.question("What is your name? ");
// client.trackEvent({name: "name entered", properties: {name: name}});
// client.flush({callback: this.askAge});
// }
// }
// let q = new questions()
// appInsights.setup(connectionString).setAutoCollectConsole(true).start();
// let client = appInsights.defaultClient;
// client.trackEvent({name: "my custom event", properties: {myProp: "custom property value 2"}});
// client.flush({callback: q.askName()});