Skip to content

Commit 6e9f9e5

Browse files
committed
Updated npm packages
1 parent ff22e48 commit 6e9f9e5

File tree

3 files changed

+152
-144
lines changed

3 files changed

+152
-144
lines changed

ai.js

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

15-
askName() {
16-
var name = readline.question("What is your name? ");
17-
client.trackEvent({name: "name entered", properties: {name: name}});
18-
client.flush({callback: this.askAge});
19-
}
64+
// askName() {
65+
// var name = readline.question("What is your name? ");
66+
// client.trackEvent({name: "name entered", properties: {name: name}});
67+
// client.flush({callback: this.askAge});
68+
// }
2069

21-
}
70+
// }
2271

23-
let q = new questions()
72+
// let q = new questions()
2473

25-
appInsights.setup(connectionString).setAutoCollectConsole(true).start();
26-
let client = appInsights.defaultClient;
27-
client.trackEvent({name: "my custom event", properties: {myProp: "custom property value 2"}});
74+
// appInsights.setup(connectionString).setAutoCollectConsole(true).start();
75+
// let client = appInsights.defaultClient;
76+
// client.trackEvent({name: "my custom event", properties: {myProp: "custom property value 2"}});
2877

29-
client.flush({callback: q.askName()});
78+
// client.flush({callback: q.askName()});

0 commit comments

Comments
 (0)