@eyevinn/player-analytics-shared 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
import { NodeHttpHandler } from '@smithy/node-http-handler';
|
|
14
14
|
import { AbstractQueueAdapter } from '../../types/interfaces';
|
|
15
15
|
import winston from 'winston';
|
|
16
|
+
import { Agent } from 'http';
|
|
17
|
+
import { Agent as HttpsAgent } from 'https';
|
|
16
18
|
|
|
17
19
|
export interface SqsQueueAdapterOptions {
|
|
18
20
|
maxSockets?: number;
|
|
@@ -23,6 +25,7 @@ export class SqsQueueAdapter implements AbstractQueueAdapter {
|
|
|
23
25
|
client: SQSClient;
|
|
24
26
|
queueUrl: string;
|
|
25
27
|
queueExists: boolean = false;
|
|
28
|
+
private httpAgent: { http?: Agent; https?: HttpsAgent } = {};
|
|
26
29
|
|
|
27
30
|
constructor(logger: winston.Logger, options?: SqsQueueAdapterOptions) {
|
|
28
31
|
this.logger = logger;
|
|
@@ -41,10 +44,21 @@ export class SqsQueueAdapter implements AbstractQueueAdapter {
|
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
if (options?.maxSockets) {
|
|
47
|
+
const httpAgent = new Agent({
|
|
48
|
+
maxSockets: options.maxSockets,
|
|
49
|
+
keepAlive: true
|
|
50
|
+
});
|
|
51
|
+
const httpsAgent = new HttpsAgent({
|
|
52
|
+
maxSockets: options.maxSockets,
|
|
53
|
+
keepAlive: true
|
|
54
|
+
});
|
|
55
|
+
|
|
44
56
|
clientConfig.requestHandler = new NodeHttpHandler({
|
|
45
|
-
httpAgent
|
|
46
|
-
httpsAgent
|
|
57
|
+
httpAgent,
|
|
58
|
+
httpsAgent
|
|
47
59
|
});
|
|
60
|
+
|
|
61
|
+
this.httpAgent = { http: httpAgent, https: httpsAgent };
|
|
48
62
|
this.logger.info(`SQS max sockets set to: ${options.maxSockets}`);
|
|
49
63
|
}
|
|
50
64
|
|
|
@@ -71,6 +85,40 @@ export class SqsQueueAdapter implements AbstractQueueAdapter {
|
|
|
71
85
|
this.logger.info(`Queue created: ${response.QueueUrl} (expected ${this.queueUrl})`);
|
|
72
86
|
}
|
|
73
87
|
|
|
88
|
+
private getSocketStats(): any {
|
|
89
|
+
if (!this.httpAgent.http && !this.httpAgent.https) {
|
|
90
|
+
return { message: 'No HTTP agent configured' };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const stats: any = {};
|
|
94
|
+
|
|
95
|
+
if (this.httpAgent.http) {
|
|
96
|
+
const agent = this.httpAgent.http as any;
|
|
97
|
+
stats.http = {
|
|
98
|
+
maxSockets: agent.maxSockets,
|
|
99
|
+
keepAlive: agent.keepAlive,
|
|
100
|
+
totalSocketCount: agent.totalSocketCount || 0,
|
|
101
|
+
requests: Object.keys(agent.requests || {}).length,
|
|
102
|
+
sockets: Object.keys(agent.sockets || {}).length,
|
|
103
|
+
freeSockets: Object.keys(agent.freeSockets || {}).length
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (this.httpAgent.https) {
|
|
108
|
+
const agent = this.httpAgent.https as any;
|
|
109
|
+
stats.https = {
|
|
110
|
+
maxSockets: agent.maxSockets,
|
|
111
|
+
keepAlive: agent.keepAlive,
|
|
112
|
+
totalSocketCount: agent.totalSocketCount || 0,
|
|
113
|
+
requests: Object.keys(agent.requests || {}).length,
|
|
114
|
+
sockets: Object.keys(agent.sockets || {}).length,
|
|
115
|
+
freeSockets: Object.keys(agent.freeSockets || {}).length
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return stats;
|
|
120
|
+
}
|
|
121
|
+
|
|
74
122
|
async pushToQueue(event: Object): Promise<any> {
|
|
75
123
|
if (this.queueUrl === 'undefined') {
|
|
76
124
|
return { message: 'SQS_QUEUE_URL is undefined' };
|
|
@@ -102,13 +150,31 @@ export class SqsQueueAdapter implements AbstractQueueAdapter {
|
|
|
102
150
|
MessageBody: JSON.stringify(event),
|
|
103
151
|
};
|
|
104
152
|
const sendMessageCommand = new SendMessageCommand(params);
|
|
153
|
+
|
|
154
|
+
const startTime = Date.now();
|
|
105
155
|
try {
|
|
106
156
|
const sendMessageResult = await this.client.send(sendMessageCommand);
|
|
157
|
+
const duration = Date.now() - startTime;
|
|
158
|
+
|
|
159
|
+
if (duration > 2000) {
|
|
160
|
+
const socketStats = this.getSocketStats();
|
|
161
|
+
this.logger.warn(
|
|
162
|
+
`SQS message send took ${duration}ms (>2000ms threshold). Socket stats: ${JSON.stringify(socketStats)}`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
107
166
|
this.logger.debug(
|
|
108
167
|
`Response from SQS: ${JSON.stringify(sendMessageResult)}`
|
|
109
168
|
);
|
|
110
169
|
return sendMessageResult;
|
|
111
170
|
} catch (err) {
|
|
171
|
+
const duration = Date.now() - startTime;
|
|
172
|
+
if (duration > 2000) {
|
|
173
|
+
const socketStats = this.getSocketStats();
|
|
174
|
+
this.logger.warn(
|
|
175
|
+
`SQS message send failed after ${duration}ms (>2000ms threshold). Socket stats: ${JSON.stringify(socketStats)}`
|
|
176
|
+
);
|
|
177
|
+
}
|
|
112
178
|
this.logger.error(err);
|
|
113
179
|
return err;
|
|
114
180
|
}
|
|
@@ -9,9 +9,11 @@ export declare class SqsQueueAdapter implements AbstractQueueAdapter {
|
|
|
9
9
|
client: SQSClient;
|
|
10
10
|
queueUrl: string;
|
|
11
11
|
queueExists: boolean;
|
|
12
|
+
private httpAgent;
|
|
12
13
|
constructor(logger: winston.Logger, options?: SqsQueueAdapterOptions);
|
|
13
14
|
private checkQueueExists;
|
|
14
15
|
private createQueue;
|
|
16
|
+
private getSocketStats;
|
|
15
17
|
pushToQueue(event: Object): Promise<any>;
|
|
16
18
|
pullFromQueue(): Promise<any>;
|
|
17
19
|
removeFromQueue(queueMsg: Message): Promise<any>;
|
|
@@ -19,9 +19,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.SqsQueueAdapter = void 0;
|
|
20
20
|
const client_sqs_1 = require("@aws-sdk/client-sqs");
|
|
21
21
|
const node_http_handler_1 = require("@smithy/node-http-handler");
|
|
22
|
+
const http_1 = require("http");
|
|
23
|
+
const https_1 = require("https");
|
|
22
24
|
class SqsQueueAdapter {
|
|
23
25
|
constructor(logger, options) {
|
|
24
26
|
this.queueExists = false;
|
|
27
|
+
this.httpAgent = {};
|
|
25
28
|
this.logger = logger;
|
|
26
29
|
let region;
|
|
27
30
|
if ('QUEUE_REGION' in process.env) {
|
|
@@ -37,10 +40,19 @@ class SqsQueueAdapter {
|
|
|
37
40
|
endpoint: process.env.SQS_ENDPOINT
|
|
38
41
|
};
|
|
39
42
|
if (options === null || options === void 0 ? void 0 : options.maxSockets) {
|
|
43
|
+
const httpAgent = new http_1.Agent({
|
|
44
|
+
maxSockets: options.maxSockets,
|
|
45
|
+
keepAlive: true
|
|
46
|
+
});
|
|
47
|
+
const httpsAgent = new https_1.Agent({
|
|
48
|
+
maxSockets: options.maxSockets,
|
|
49
|
+
keepAlive: true
|
|
50
|
+
});
|
|
40
51
|
clientConfig.requestHandler = new node_http_handler_1.NodeHttpHandler({
|
|
41
|
-
httpAgent
|
|
42
|
-
httpsAgent
|
|
52
|
+
httpAgent,
|
|
53
|
+
httpsAgent
|
|
43
54
|
});
|
|
55
|
+
this.httpAgent = { http: httpAgent, https: httpsAgent };
|
|
44
56
|
this.logger.info(`SQS max sockets set to: ${options.maxSockets}`);
|
|
45
57
|
}
|
|
46
58
|
this.client = new client_sqs_1.SQSClient(clientConfig);
|
|
@@ -78,6 +90,35 @@ class SqsQueueAdapter {
|
|
|
78
90
|
this.logger.info(`Queue created: ${response.QueueUrl} (expected ${this.queueUrl})`);
|
|
79
91
|
});
|
|
80
92
|
}
|
|
93
|
+
getSocketStats() {
|
|
94
|
+
if (!this.httpAgent.http && !this.httpAgent.https) {
|
|
95
|
+
return { message: 'No HTTP agent configured' };
|
|
96
|
+
}
|
|
97
|
+
const stats = {};
|
|
98
|
+
if (this.httpAgent.http) {
|
|
99
|
+
const agent = this.httpAgent.http;
|
|
100
|
+
stats.http = {
|
|
101
|
+
maxSockets: agent.maxSockets,
|
|
102
|
+
keepAlive: agent.keepAlive,
|
|
103
|
+
totalSocketCount: agent.totalSocketCount || 0,
|
|
104
|
+
requests: Object.keys(agent.requests || {}).length,
|
|
105
|
+
sockets: Object.keys(agent.sockets || {}).length,
|
|
106
|
+
freeSockets: Object.keys(agent.freeSockets || {}).length
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
if (this.httpAgent.https) {
|
|
110
|
+
const agent = this.httpAgent.https;
|
|
111
|
+
stats.https = {
|
|
112
|
+
maxSockets: agent.maxSockets,
|
|
113
|
+
keepAlive: agent.keepAlive,
|
|
114
|
+
totalSocketCount: agent.totalSocketCount || 0,
|
|
115
|
+
requests: Object.keys(agent.requests || {}).length,
|
|
116
|
+
sockets: Object.keys(agent.sockets || {}).length,
|
|
117
|
+
freeSockets: Object.keys(agent.freeSockets || {}).length
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return stats;
|
|
121
|
+
}
|
|
81
122
|
pushToQueue(event) {
|
|
82
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
83
124
|
if (this.queueUrl === 'undefined') {
|
|
@@ -111,12 +152,23 @@ class SqsQueueAdapter {
|
|
|
111
152
|
MessageBody: JSON.stringify(event),
|
|
112
153
|
};
|
|
113
154
|
const sendMessageCommand = new client_sqs_1.SendMessageCommand(params);
|
|
155
|
+
const startTime = Date.now();
|
|
114
156
|
try {
|
|
115
157
|
const sendMessageResult = yield this.client.send(sendMessageCommand);
|
|
158
|
+
const duration = Date.now() - startTime;
|
|
159
|
+
if (duration > 2000) {
|
|
160
|
+
const socketStats = this.getSocketStats();
|
|
161
|
+
this.logger.warn(`SQS message send took ${duration}ms (>2000ms threshold). Socket stats: ${JSON.stringify(socketStats)}`);
|
|
162
|
+
}
|
|
116
163
|
this.logger.debug(`Response from SQS: ${JSON.stringify(sendMessageResult)}`);
|
|
117
164
|
return sendMessageResult;
|
|
118
165
|
}
|
|
119
166
|
catch (err) {
|
|
167
|
+
const duration = Date.now() - startTime;
|
|
168
|
+
if (duration > 2000) {
|
|
169
|
+
const socketStats = this.getSocketStats();
|
|
170
|
+
this.logger.warn(`SQS message send failed after ${duration}ms (>2000ms threshold). Socket stats: ${JSON.stringify(socketStats)}`);
|
|
171
|
+
}
|
|
120
172
|
this.logger.error(err);
|
|
121
173
|
return err;
|
|
122
174
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqsQueueAdapter.js","sourceRoot":"","sources":["../../../adapters/queue/SqsQueueAdapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,oDAW6B;AAC7B,iEAA4D;
|
|
1
|
+
{"version":3,"file":"SqsQueueAdapter.js","sourceRoot":"","sources":["../../../adapters/queue/SqsQueueAdapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,oDAW6B;AAC7B,iEAA4D;AAG5D,+BAA6B;AAC7B,iCAA4C;AAM5C,MAAa,eAAe;IAO1B,YAAY,MAAsB,EAAE,OAAgC;QAHpE,gBAAW,GAAY,KAAK,CAAC;QACrB,cAAS,GAAyC,EAAE,CAAC;QAG3D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,MAAW,CAAC;QAChB,IAAI,cAAc,IAAI,OAAO,CAAC,GAAG,EAAE;YACjC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;SACnC;aAAM;YACL,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;SACjC;QACD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAc,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,MAAM,EAAE,CAAC,CAAC;QAE1C,MAAM,YAAY,GAA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