@nsshunt/stsappframework 3.1.51 → 3.1.53
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.
- package/dist/influxdb/influxDBManagerAgent.js +0 -144
- package/dist/influxdb/influxDBManagerAgent.js.map +1 -1
- package/dist/influxdb/influxDBManagerBase.js +34 -27
- package/dist/influxdb/influxDBManagerBase.js.map +1 -1
- package/dist/influxdb/influxDBManagerService.js +0 -170
- package/dist/influxdb/influxDBManagerService.js.map +1 -1
- package/package.json +1 -1
- package/src/influxdb/influxDBManagerAgent.ts +3 -0
- package/src/influxdb/influxDBManagerBase.ts +2 -0
- package/src/influxdb/influxDBManagerService.ts +6 -22
- package/types/influxdb/influxDBManagerAgent.d.ts +0 -6
- package/types/influxdb/influxDBManagerAgent.d.ts.map +1 -1
- package/types/influxdb/influxDBManagerBase.d.ts +0 -4
- package/types/influxdb/influxDBManagerBase.d.ts.map +1 -1
- package/types/influxdb/influxDBManagerService.d.ts +0 -6
- package/types/influxdb/influxDBManagerService.d.ts.map +1 -1
|
@@ -105,7 +105,6 @@ union(tables: [globalagentsum, globalagentmean])
|
|
|
105
105
|
const debug_1 = __importDefault(require("debug"));
|
|
106
106
|
const debug = (0, debug_1.default)(`proc:${process.pid}`);
|
|
107
107
|
const influxDBManagerBase_1 = require("./influxDBManagerBase");
|
|
108
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
109
108
|
const AGENT_STATS_BY_AGENT_THREAD_ASYNCRUNNER = "sts-stats-by-agentthreadasyncunner";
|
|
110
109
|
const AGENT_STATS_BY_AGENT_THREAD = "sts-stats-by-agentthread";
|
|
111
110
|
const AGENT_STATS_BY_AGENT = "sts-stats-by-agent";
|
|
@@ -118,149 +117,6 @@ class InfluxDBManagerAgent extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
|
118
117
|
get modelType() {
|
|
119
118
|
return 'agent';
|
|
120
119
|
}
|
|
121
|
-
#LogErrorMessage(message) {
|
|
122
|
-
this.options.logger.error(message);
|
|
123
|
-
}
|
|
124
|
-
#LogDebugMessage(message) {
|
|
125
|
-
this.options.logger.debug(message);
|
|
126
|
-
}
|
|
127
|
-
// Queries --------------------------------------------------------------------------------------------------------
|
|
128
|
-
// Counter metrics
|
|
129
|
-
#GetSTSCountGenericAgent = async (measurement, filterClause, showOutput = false) => {
|
|
130
|
-
try {
|
|
131
|
-
const query = `from(bucket: "${this.options.bucket}")
|
|
132
|
-
|> range(start: -5s)
|
|
133
|
-
|> last()
|
|
134
|
-
|> filter(fn: (r) => r["_measurement"] == "${measurement}" ${filterClause})`;
|
|
135
|
-
if (showOutput) {
|
|
136
|
-
this.#LogDebugMessage(`GetSTSCountGenericAgent(): query: [${query}]`);
|
|
137
|
-
}
|
|
138
|
-
return this.queryApi.collectRows(query);
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}#GetSTSCountGeneric: Error: [${error}]`));
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
// Histo metrics
|
|
145
|
-
#GetSTSHistoGenericService = async (measurement, filterClause) => {
|
|
146
|
-
try {
|
|
147
|
-
const query = `import "math"
|
|
148
|
-
from(bucket: "${this.options.bucket}")
|
|
149
|
-
|> range(start: -10m)
|
|
150
|
-
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] =="latency"
|
|
151
|
-
or r["_field"] =="duration") ${filterClause})
|
|
152
|
-
|> histogram(bins: [0.0, 10.0, 20.0, 50.0, 100.0, 1000.0, 50000.0, math.mInf(sign: 1) ])
|
|
153
|
-
|> difference()`;
|
|
154
|
-
return this.queryApi.collectRows(query);
|
|
155
|
-
}
|
|
156
|
-
catch (error) {
|
|
157
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}#GetSTSHistoGeneric: Error: [${error}]`));
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
// Quantile metrics
|
|
161
|
-
#GetSTSQuantileGenericAgent = async (measurement, filterClause) => {
|
|
162
|
-
try {
|
|
163
|
-
const query = `data = from(bucket: "${this.options.bucket}")
|
|
164
|
-
|> range(start: -10m)
|
|
165
|
-
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] == "latency"
|
|
166
|
-
or r["_field"] == "duration") ${filterClause})
|
|
167
|
-
|> aggregateWindow(every: 5s, fn: max, createEmpty: false)
|
|
168
|
-
|
|
169
|
-
dostsquantileex = (q) =>
|
|
170
|
-
data
|
|
171
|
-
|> quantile(q: q, method: "estimate_tdigest", compression: 1000.0)
|
|
172
|
-
|> set(key: "quantile", value: string(v:q))
|
|
173
|
-
|> group(columns: ["quantile"])
|
|
174
|
-
|
|
175
|
-
union(tables: [
|
|
176
|
-
dostsquantileex(q: 0.5),
|
|
177
|
-
dostsquantileex(q: 0.8),
|
|
178
|
-
dostsquantileex(q: 0.9),
|
|
179
|
-
dostsquantileex(q: 0.95),
|
|
180
|
-
dostsquantileex(q: 0.99)
|
|
181
|
-
])`;
|
|
182
|
-
return this.queryApi.collectRows(query);
|
|
183
|
-
}
|
|
184
|
-
catch (error) {
|
|
185
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}#GetSTSQuantileGeneric: Error: [${error}]`));
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
// Metric queries -------------------------------------------------------------------------------------------------
|
|
189
|
-
// Root level metrics
|
|
190
|
-
async GetInfluxDBResultsRootAgent(subscriptionKey) {
|
|
191
|
-
let retVal = null;
|
|
192
|
-
try {
|
|
193
|
-
retVal = await this.ProcessInfluxDBResults([
|
|
194
|
-
this.#GetSTSCountGenericAgent(AGENT_STATS_GLOBALAGENT, ''),
|
|
195
|
-
this.#GetSTSQuantileGenericAgent(AGENT_STATS_GLOBALAGENT, ''),
|
|
196
|
-
this.#GetSTSHistoGenericService(AGENT_STATS_GLOBALAGENT, '')
|
|
197
|
-
], []);
|
|
198
|
-
}
|
|
199
|
-
catch (error) {
|
|
200
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}GetInfluxDBResultsRootAgent: Error: [${error}]`));
|
|
201
|
-
}
|
|
202
|
-
return {
|
|
203
|
-
subscriptionKey,
|
|
204
|
-
data: retVal
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
// Service level metrics
|
|
208
|
-
async GetInfluxDBResultsAgent(subscriptionKey) {
|
|
209
|
-
let retVal = null;
|
|
210
|
-
try {
|
|
211
|
-
retVal = await this.ProcessInfluxDBResults([
|
|
212
|
-
this.#GetSTSCountGenericAgent(AGENT_STATS_BY_AGENT, ''),
|
|
213
|
-
this.#GetSTSQuantileGenericAgent(AGENT_STATS_BY_AGENT, ''),
|
|
214
|
-
this.#GetSTSHistoGenericService(AGENT_STATS_BY_AGENT, '')
|
|
215
|
-
], ['agentName']);
|
|
216
|
-
}
|
|
217
|
-
catch (error) {
|
|
218
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}GetInfluxDBResultsAgent: Error: [${error}]`));
|
|
219
|
-
}
|
|
220
|
-
return {
|
|
221
|
-
subscriptionKey,
|
|
222
|
-
data: retVal
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
// Service instance metrics for a particular service type
|
|
226
|
-
async GetInfluxDBResultsAgentThreads(subscriptionKey) {
|
|
227
|
-
let retVal = null;
|
|
228
|
-
try {
|
|
229
|
-
const agentName = subscriptionKey.key;
|
|
230
|
-
retVal = await this.ProcessInfluxDBResults([
|
|
231
|
-
this.#GetSTSCountGenericAgent(AGENT_STATS_BY_AGENT_THREAD, `and r["agentName"] == "${agentName}"`),
|
|
232
|
-
this.#GetSTSQuantileGenericAgent(AGENT_STATS_BY_AGENT_THREAD, `and r["agentName"] == "${agentName}"`),
|
|
233
|
-
this.#GetSTSHistoGenericService(AGENT_STATS_BY_AGENT_THREAD, `and r["agentName"] == "${agentName}"`)
|
|
234
|
-
], ['agentName', 'threadId']);
|
|
235
|
-
}
|
|
236
|
-
catch (error) {
|
|
237
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}GetInfluxDBResultsAgentThreads: Error: [${error}]`));
|
|
238
|
-
}
|
|
239
|
-
return {
|
|
240
|
-
subscriptionKey,
|
|
241
|
-
data: retVal
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
// Service instance thread metrics for a particular service instance
|
|
245
|
-
async GetInfluxDBResultsAgentThread(subscriptionKey) {
|
|
246
|
-
let retVal = null;
|
|
247
|
-
try {
|
|
248
|
-
const agentName = subscriptionKey.key;
|
|
249
|
-
const threadId = subscriptionKey.subkey;
|
|
250
|
-
retVal = await this.ProcessInfluxDBResults([
|
|
251
|
-
this.#GetSTSCountGenericAgent(AGENT_STATS_BY_AGENT_THREAD_ASYNCRUNNER, `and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"`),
|
|
252
|
-
this.#GetSTSQuantileGenericAgent(AGENT_STATS_BY_AGENT_THREAD_ASYNCRUNNER, `and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"`),
|
|
253
|
-
this.#GetSTSHistoGenericService(AGENT_STATS_BY_AGENT_THREAD_ASYNCRUNNER, `and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"`)
|
|
254
|
-
], ['agentName', 'threadId', 'asyncRunnerId']);
|
|
255
|
-
}
|
|
256
|
-
catch (error) {
|
|
257
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}GetInfluxDBResultsAgentThread: Error: [${error}]`));
|
|
258
|
-
}
|
|
259
|
-
return {
|
|
260
|
-
subscriptionKey,
|
|
261
|
-
data: retVal
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
120
|
}
|
|
265
121
|
exports.InfluxDBManagerAgent = InfluxDBManagerAgent;
|
|
266
122
|
//# sourceMappingURL=influxDBManagerAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerAgent.js","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerAgent.ts"],"names":[],"mappings":";AAAA,wFAAwF,CAAE,UAAU;AACpG,4FAA4F;AAC5F,+GAA+G;;;;;;AAE/G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FE;AAEF,kDAA+B;AAC/B,MAAM,KAAK,GAAG,IAAA,eAAW,EAAC,QAAQ,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAMjD,+DAA2D;
|
|
1
|
+
{"version":3,"file":"influxDBManagerAgent.js","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerAgent.ts"],"names":[],"mappings":";AAAA,wFAAwF,CAAE,UAAU;AACpG,4FAA4F;AAC5F,+GAA+G;;;;;;AAE/G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FE;AAEF,kDAA+B;AAC/B,MAAM,KAAK,GAAG,IAAA,eAAW,EAAC,QAAQ,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAMjD,+DAA2D;AAQ3D,MAAM,uCAAuC,GAAG,oCAAoC,CAAC;AACrF,MAAM,2BAA2B,GAAG,0BAA0B,CAAC;AAC/D,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAClD,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAExD,MAAM,UAAU,GAAG,yBAAyB,CAAA;AAE5C,MAAa,oBAAqB,SAAQ,yCAAmB;IAEzD,YAAY,OAAgC,EAAE,QAAkB;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAED,IAAa,SAAS;QAClB,OAAO,OAAO,CAAA;IAClB,CAAC;CAyJJ;AAjKD,oDAiKC"}
|
|
@@ -38,62 +38,69 @@ class InfluxDBManagerBase {
|
|
|
38
38
|
throw new Error('modelType(): Must override in sub-class');
|
|
39
39
|
}
|
|
40
40
|
// Helpers --------------------------------------------------------------------------------------------------------
|
|
41
|
-
|
|
41
|
+
/*
|
|
42
|
+
async ProcessInfluxDBResults(promArray: Promise<any>[], fields: string[]) {
|
|
42
43
|
try {
|
|
43
|
-
const promRetVal = await Promise.all(promArray).catch(error => {
|
|
44
|
-
this.#LogErrorMessage(
|
|
45
|
-
});
|
|
46
|
-
|
|
44
|
+
const promRetVal: any[] = await Promise.all(promArray).catch(error => {
|
|
45
|
+
this.#LogErrorMessage(chalk.red(`InfluxDBManagerBase:ProcessInfluxDBResults(): Error: [${error}]`));
|
|
46
|
+
}) as any[];
|
|
47
|
+
|
|
48
|
+
const combinedResults: any = { };
|
|
49
|
+
|
|
47
50
|
if (promRetVal) {
|
|
48
|
-
const stscount = promRetVal[0];
|
|
49
|
-
const stsquantile = promRetVal[1];
|
|
50
|
-
const stshisto = promRetVal[2];
|
|
51
|
+
const stscount: any[] = promRetVal[0];
|
|
52
|
+
const stsquantile: any[] = promRetVal[1];
|
|
53
|
+
const stshisto: any[] = promRetVal[2];
|
|
54
|
+
|
|
51
55
|
stscount.forEach((countRecord) => {
|
|
52
|
-
const values = fields.map(field => countRecord[field])
|
|
56
|
+
const values: any[] = fields.map(field => countRecord[field])
|
|
53
57
|
const { _field, _value } = countRecord;
|
|
54
58
|
this.CreateNestedObject(combinedResults, values)[_field] = _value;
|
|
55
59
|
});
|
|
60
|
+
|
|
56
61
|
stsquantile.forEach((stsquantileRecord) => {
|
|
57
|
-
const values = fields.map(field => stsquantileRecord[field])
|
|
58
|
-
const { _field, quantile, _value
|
|
59
|
-
const useField = _field + '_quantile'
|
|
62
|
+
const values: any[] = fields.map(field => stsquantileRecord[field])
|
|
63
|
+
const { _field, quantile, _value} = stsquantileRecord;
|
|
64
|
+
const useField = _field + '_quantile'
|
|
60
65
|
this.CreateNestedObject(combinedResults, [...values, useField])[quantile] = _value;
|
|
61
66
|
});
|
|
67
|
+
|
|
62
68
|
stshisto.forEach((stshistoRecord) => {
|
|
63
|
-
const values = fields.map(field => stshistoRecord[field])
|
|
64
|
-
const { _field, le, _value
|
|
65
|
-
const useField = _field + '_histo'
|
|
69
|
+
const values: any[] = fields.map(field => stshistoRecord[field])
|
|
70
|
+
const { _field, le, _value} = stshistoRecord;
|
|
71
|
+
const useField = _field + '_histo'
|
|
66
72
|
this.CreateNestedObject(combinedResults, [...values, useField])[le] = _value;
|
|
67
73
|
});
|
|
68
74
|
}
|
|
69
75
|
return combinedResults;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}ProcessInfluxDBResults: Error: [${error}]`));
|
|
76
|
+
} catch (error) {
|
|
77
|
+
this.#LogErrorMessage(chalk.red(`${_logPrefix}ProcessInfluxDBResults: Error: [${error}]`));
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
|
-
|
|
80
|
+
|
|
81
|
+
CreateGlobalCountModel = (stscount: any[]) => {
|
|
76
82
|
try {
|
|
77
|
-
const results = {};
|
|
78
|
-
stscount.forEach((o) => {
|
|
83
|
+
const results: any = { };
|
|
84
|
+
stscount.forEach((o: any) => {
|
|
79
85
|
results[o._field] = o._value;
|
|
80
86
|
});
|
|
81
87
|
return results;
|
|
88
|
+
} catch (error) {
|
|
89
|
+
this.#LogErrorMessage(chalk.red(`${_logPrefix}#CreateGlobalCountModel: Error: [${error}]`));
|
|
82
90
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
};
|
|
87
|
-
CreateNestedObject(combinedResults, keyList) {
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
CreateNestedObject(combinedResults: JSONObject, keyList: string[]): JSONObject {
|
|
88
94
|
let workingObject = combinedResults;
|
|
89
95
|
keyList.forEach((key) => {
|
|
90
96
|
if (!workingObject[key]) {
|
|
91
|
-
workingObject[key] = {};
|
|
97
|
+
workingObject[key] = { };
|
|
92
98
|
}
|
|
93
99
|
workingObject = workingObject[key];
|
|
94
100
|
});
|
|
95
101
|
return workingObject;
|
|
96
102
|
}
|
|
103
|
+
*/
|
|
97
104
|
// Agent context payload
|
|
98
105
|
// {"nid":"somehost@e58f5d75-6ff6-4e04-92a4-f2bcd722fec0-someuseragent|MainProcess|0","id":"somehost@e58f5d75-6ff6-4e04-92a4-f2bcd722fec0-someuseragent|MainProcess|0","hostName":"somehost","agentName":"e58f5d75-6ff6-4e04-92a4-f2bcd722fec0-someuseragent","threadId":"MainProcess","asyncRunnerId":"0"}
|
|
99
106
|
async OutputInfluxDB(writeApi, instrumentPayload, serviceType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerBase.js","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerBase.ts"],"names":[],"mappings":";;;;;;AAAA,wFAAwF,CAAE,UAAU;AACpG,4FAA4F;AAC5F,+GAA+G;AAC/G,iEAAuE;AAOvE,kDAA0B;AAE1B,4EAA4H;AAE5H,MAAM,UAAU,GAAG,kBAAkB,CAAA;AAErC,MAAa,mBAAmB;IAE5B,SAAS,CAAW;IACpB,aAAa,GAAY,KAAK,CAAC;IAC/B,QAAQ,CAA0B;IAElC,YAAY,OAAgC,EAAE,QAAkB;QAC5D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;IAED,gBAAgB,CAAC,OAAY;QACzB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IACD,IAAI,YAAY,CAAC,GAAY;QACzB,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC;IAC7B,CAAC;IAED,I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explicit-any: 0, @typescript-eslint/no-unused-vars: 0 */ // --> OFF
|
|
3
3
|
// https://www.influxdata.com/blog/tldr-influxdb-tech-tips-multiple-aggregations-yield-flux/
|
|
4
4
|
// https://www.influxdata.com/blog/top-5-hurdles-for-intermediate-flux-users-and-resources-for-optimizing-flux/
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
6
|
exports.InfluxDBManagerService = void 0;
|
|
10
7
|
const influxDBManagerBase_1 = require("./influxDBManagerBase");
|
|
11
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
12
8
|
const _logPrefix = 'InfluxDBManagerService:';
|
|
13
9
|
/*
|
|
14
10
|
const SERVICE_STATS_BY_SERVICE_INSTANCE_PROCESS = "sts-stats-sum-byserviceInstanceprocessid";
|
|
@@ -24,175 +20,9 @@ class InfluxDBManagerService extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
|
24
20
|
constructor(options, queryApi) {
|
|
25
21
|
super(options, queryApi);
|
|
26
22
|
}
|
|
27
|
-
#LogErrorMessage(message) {
|
|
28
|
-
this.options.logger.error(message);
|
|
29
|
-
}
|
|
30
|
-
#LogDebugMessage(message) {
|
|
31
|
-
this.options.logger.debug(message);
|
|
32
|
-
}
|
|
33
23
|
get modelType() {
|
|
34
24
|
return 'service';
|
|
35
25
|
}
|
|
36
|
-
// Queries --------------------------------------------------------------------------------------------------------
|
|
37
|
-
/*
|
|
38
|
-
data = from(bucket: "my-bucket")
|
|
39
|
-
|> range(start: -task.every)
|
|
40
|
-
|> filter(fn: (r) => r._measurement == "my_measurement")
|
|
41
|
-
|
|
42
|
-
data
|
|
43
|
-
|> mean()
|
|
44
|
-
|> set(key: "agg_type",value: "mean_temp")
|
|
45
|
-
|> to(bucket: "downsampled", org: "my-org", tagColumns: ["agg_type"])
|
|
46
|
-
|
|
47
|
-
data
|
|
48
|
-
|> count()
|
|
49
|
-
|> set(key: "agg_type",value: "count_temp")
|
|
50
|
-
|> to(bucket: "downsampled", org: "my-org", tagColumns: ["agg_type"])
|
|
51
|
-
*/
|
|
52
|
-
#GetSTSCountGenericService = async (measurement, filterClause, showOutput = false) => {
|
|
53
|
-
try {
|
|
54
|
-
const query = `r1 = from(bucket: "${this.options.bucket}")
|
|
55
|
-
|> range(start: -5s)
|
|
56
|
-
|> last()
|
|
57
|
-
|> filter(fn: (r) => r["_measurement"] == "${measurement}" ${filterClause})
|
|
58
|
-
|
|
59
|
-
r2 = from(bucket: "${this.options.bucket}")
|
|
60
|
-
|> range(start: -5s)
|
|
61
|
-
|> last()
|
|
62
|
-
|> filter(fn: (r) => r["_measurement"] == "service" ${filterClause} and r["_field"] == "memory")
|
|
63
|
-
|
|
64
|
-
union(tables: [r1, r2])`;
|
|
65
|
-
if (showOutput) {
|
|
66
|
-
this.#LogDebugMessage(`InfluxDBManagerService:GetSTSCountGenericService(): query: [${query}]`);
|
|
67
|
-
}
|
|
68
|
-
return this.queryApi.collectRows(query);
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}#GetSTSCountGeneric: Error: [${error}]`));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
// Histo metrics
|
|
75
|
-
#GetSTSHistoGenericService = async (measurement, filterClause) => {
|
|
76
|
-
try {
|
|
77
|
-
const query = `import "math"
|
|
78
|
-
from(bucket: "${this.options.bucket}")
|
|
79
|
-
|> range(start: -10m)
|
|
80
|
-
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] =="latency" or
|
|
81
|
-
r["_field"] =="duration") ${filterClause})
|
|
82
|
-
|> histogram(bins: [0.0, 10.0, 20.0, 50.0, 100.0, 1000.0, 50000.0, math.mInf(sign: 1) ])
|
|
83
|
-
|> difference()`;
|
|
84
|
-
return this.queryApi.collectRows(query);
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}#GetSTSHistoGeneric: Error: [${error}]`));
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
// Quantile metrics
|
|
91
|
-
#GetSTSQuantileGenericService = async (measurement, filterClause) => {
|
|
92
|
-
try {
|
|
93
|
-
const query = `data = from(bucket: "${this.options.bucket}")
|
|
94
|
-
|> range(start: -10m)
|
|
95
|
-
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] == "latency" or
|
|
96
|
-
r["_field"] == "duration" or
|
|
97
|
-
r["_field"] == "cpu" or
|
|
98
|
-
r["_field"] == "systemcpu") ${filterClause})
|
|
99
|
-
|> aggregateWindow(every: 5s, fn: max, createEmpty: false)
|
|
100
|
-
|
|
101
|
-
dostsquantileex = (q) =>
|
|
102
|
-
data
|
|
103
|
-
|> quantile(q: q, method: "estimate_tdigest", compression: 1000.0)
|
|
104
|
-
|> set(key: "quantile", value: string(v:q))
|
|
105
|
-
|> group(columns: ["quantile"])
|
|
106
|
-
|
|
107
|
-
union(tables: [
|
|
108
|
-
dostsquantileex(q: 0.5),
|
|
109
|
-
dostsquantileex(q: 0.8),
|
|
110
|
-
dostsquantileex(q: 0.9),
|
|
111
|
-
dostsquantileex(q: 0.95),
|
|
112
|
-
dostsquantileex(q: 0.99)
|
|
113
|
-
])`;
|
|
114
|
-
return this.queryApi.collectRows(query);
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}#GetSTSQuantileGeneric: Error: [${error}]`));
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
// Metric queries -------------------------------------------------------------------------------------------------
|
|
121
|
-
// Root level metrics
|
|
122
|
-
async GetInfluxDBResultsRootService(subscriptionKey) {
|
|
123
|
-
let retVal = null;
|
|
124
|
-
try {
|
|
125
|
-
retVal = await this.ProcessInfluxDBResults([
|
|
126
|
-
this.#GetSTSCountGenericService(SERVICE_STATS_GLOBAL, ''),
|
|
127
|
-
this.#GetSTSQuantileGenericService(SERVICE_STATS_GLOBAL, ''),
|
|
128
|
-
this.#GetSTSHistoGenericService(SERVICE_STATS_GLOBAL, '')
|
|
129
|
-
], []);
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}GetInfluxDBResultsRoot: Error: [${error}]`));
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
subscriptionKey,
|
|
136
|
-
data: retVal
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
// Service level metrics
|
|
140
|
-
async GetInfluxDBResultsService(subscriptionKey) {
|
|
141
|
-
let retVal = null;
|
|
142
|
-
try {
|
|
143
|
-
retVal = await this.ProcessInfluxDBResults([
|
|
144
|
-
this.#GetSTSCountGenericService(SERVICE_STATS_BY_SERVICE, ''),
|
|
145
|
-
this.#GetSTSQuantileGenericService(SERVICE_STATS_BY_SERVICE, ''),
|
|
146
|
-
this.#GetSTSHistoGenericService(SERVICE_STATS_BY_SERVICE, '')
|
|
147
|
-
], ['serviceId']);
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}GetInfluxDBResultsService: Error: [${error}]`));
|
|
151
|
-
}
|
|
152
|
-
return {
|
|
153
|
-
subscriptionKey,
|
|
154
|
-
data: retVal
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
// Service instance metrics for a particular service type
|
|
158
|
-
async GetInfluxDBResultsServiceInstances(subscriptionKey) {
|
|
159
|
-
let retVal = null;
|
|
160
|
-
try {
|
|
161
|
-
const serviceId = subscriptionKey.key;
|
|
162
|
-
retVal = await this.ProcessInfluxDBResults([
|
|
163
|
-
this.#GetSTSCountGenericService(SERVICE_STATS_BY_SERVICE_INSTANCE, `and r["serviceId"] == "${serviceId}"`),
|
|
164
|
-
this.#GetSTSQuantileGenericService(SERVICE_STATS_BY_SERVICE_INSTANCE, `and r["serviceId"] == "${serviceId}"`),
|
|
165
|
-
this.#GetSTSHistoGenericService(SERVICE_STATS_BY_SERVICE_INSTANCE, `and r["serviceId"] == "${serviceId}"`)
|
|
166
|
-
], ['serviceId', 'serviceInstanceId']);
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}GetInfluxDBResultsServiceInstances: Error: [${error}]`));
|
|
170
|
-
}
|
|
171
|
-
return {
|
|
172
|
-
subscriptionKey,
|
|
173
|
-
data: retVal
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
// Service instance thread metrics for a particular service instance
|
|
177
|
-
async GetInfluxDBResultsServiceInstance(subscriptionKey) {
|
|
178
|
-
let retVal = null;
|
|
179
|
-
try {
|
|
180
|
-
//const serviceId = subscriptionKey.key as string; // Not required for the query
|
|
181
|
-
const serviceInstanceId = subscriptionKey.subkey;
|
|
182
|
-
retVal = await this.ProcessInfluxDBResults([
|
|
183
|
-
this.#GetSTSCountGenericService(SERVICE_STATS_BY_SERVICE_INSTANCE_PROCESS, `and r["serviceInstanceId"] == "${serviceInstanceId}"`),
|
|
184
|
-
this.#GetSTSQuantileGenericService(SERVICE_STATS_BY_SERVICE_INSTANCE_PROCESS, `and r["serviceInstanceId"] == "${serviceInstanceId}"`),
|
|
185
|
-
this.#GetSTSHistoGenericService(SERVICE_STATS_BY_SERVICE_INSTANCE_PROCESS, `and r["serviceInstanceId"] == "${serviceInstanceId}"`)
|
|
186
|
-
], ['serviceId', 'serviceInstanceId', 'serviceInstanceProcessId']);
|
|
187
|
-
}
|
|
188
|
-
catch (error) {
|
|
189
|
-
this.#LogErrorMessage(chalk_1.default.red(`${_logPrefix}GetInfluxDBResultsServiceInstance: Error: [${error}]`));
|
|
190
|
-
}
|
|
191
|
-
return {
|
|
192
|
-
subscriptionKey,
|
|
193
|
-
data: retVal
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
26
|
}
|
|
197
27
|
exports.InfluxDBManagerService = InfluxDBManagerService;
|
|
198
28
|
//# sourceMappingURL=influxDBManagerService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerService.js","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerService.ts"],"names":[],"mappings":";AAAA,wFAAwF,CAAE,UAAU;AACpG,4FAA4F;AAC5F,+GAA+G
|
|
1
|
+
{"version":3,"file":"influxDBManagerService.js","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerService.ts"],"names":[],"mappings":";AAAA,wFAAwF,CAAE,UAAU;AACpG,4FAA4F;AAC5F,+GAA+G;;;AAkH/G,+DAA2D;AAQ3D,MAAM,UAAU,GAAG,yBAAyB,CAAA;AAE5C;;;;;EAKE;AAEF,MAAM,yCAAyC,GAAG,qCAAqC,CAAC;AACxF,MAAM,iCAAiC,GAAG,8BAA8B,CAAC;AACzE,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AACxD,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAKvD,MAAa,sBAAuB,SAAQ,yCAAmB;IAE3D,YAAY,OAAgC,EAAE,QAAkB;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAED,IAAa,SAAS;QAClB,OAAO,SAAS,CAAA;IACpB,CAAC;CA+JJ;AAvKD,wDAuKC"}
|
package/package.json
CHANGED
|
@@ -130,6 +130,8 @@ export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
|
130
130
|
return 'agent'
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
/*
|
|
134
|
+
|
|
133
135
|
#LogErrorMessage(message: any) {
|
|
134
136
|
this.options.logger.error(message);
|
|
135
137
|
}
|
|
@@ -278,4 +280,5 @@ export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
|
278
280
|
data: retVal
|
|
279
281
|
};
|
|
280
282
|
}
|
|
283
|
+
*/
|
|
281
284
|
}
|
|
@@ -48,6 +48,7 @@ export class InfluxDBManagerBase
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// Helpers --------------------------------------------------------------------------------------------------------
|
|
51
|
+
/*
|
|
51
52
|
async ProcessInfluxDBResults(promArray: Promise<any>[], fields: string[]) {
|
|
52
53
|
try {
|
|
53
54
|
const promRetVal: any[] = await Promise.all(promArray).catch(error => {
|
|
@@ -109,6 +110,7 @@ export class InfluxDBManagerBase
|
|
|
109
110
|
});
|
|
110
111
|
return workingObject;
|
|
111
112
|
}
|
|
113
|
+
*/
|
|
112
114
|
|
|
113
115
|
// Agent context payload
|
|
114
116
|
// {"nid":"somehost@e58f5d75-6ff6-4e04-92a4-f2bcd722fec0-someuseragent|MainProcess|0","id":"somehost@e58f5d75-6ff6-4e04-92a4-f2bcd722fec0-someuseragent|MainProcess|0","hostName":"somehost","agentName":"e58f5d75-6ff6-4e04-92a4-f2bcd722fec0-someuseragent","threadId":"MainProcess","asyncRunnerId":"0"}
|
|
@@ -145,6 +145,11 @@ export class InfluxDBManagerService extends InfluxDBManagerBase
|
|
|
145
145
|
super(options, queryApi);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
override get modelType(): string {
|
|
149
|
+
return 'service'
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/*
|
|
148
153
|
#LogErrorMessage(message: any) {
|
|
149
154
|
this.options.logger.error(message);
|
|
150
155
|
}
|
|
@@ -153,28 +158,6 @@ export class InfluxDBManagerService extends InfluxDBManagerBase
|
|
|
153
158
|
this.options.logger.debug(message);
|
|
154
159
|
}
|
|
155
160
|
|
|
156
|
-
override get modelType(): string {
|
|
157
|
-
return 'service'
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Queries --------------------------------------------------------------------------------------------------------
|
|
161
|
-
|
|
162
|
-
/*
|
|
163
|
-
data = from(bucket: "my-bucket")
|
|
164
|
-
|> range(start: -task.every)
|
|
165
|
-
|> filter(fn: (r) => r._measurement == "my_measurement")
|
|
166
|
-
|
|
167
|
-
data
|
|
168
|
-
|> mean()
|
|
169
|
-
|> set(key: "agg_type",value: "mean_temp")
|
|
170
|
-
|> to(bucket: "downsampled", org: "my-org", tagColumns: ["agg_type"])
|
|
171
|
-
|
|
172
|
-
data
|
|
173
|
-
|> count()
|
|
174
|
-
|> set(key: "agg_type",value: "count_temp")
|
|
175
|
-
|> to(bucket: "downsampled", org: "my-org", tagColumns: ["agg_type"])
|
|
176
|
-
*/
|
|
177
|
-
|
|
178
161
|
#GetSTSCountGenericService = async (measurement: string, filterClause: string, showOutput: boolean = false): Promise<any> => {
|
|
179
162
|
try {
|
|
180
163
|
const query = `r1 = from(bucket: "${this.options.bucket}")
|
|
@@ -322,4 +305,5 @@ data
|
|
|
322
305
|
data: retVal
|
|
323
306
|
};
|
|
324
307
|
}
|
|
308
|
+
*/
|
|
325
309
|
}
|
|
@@ -2,14 +2,8 @@
|
|
|
2
2
|
import { QueryApi } from '@influxdata/influxdb-client';
|
|
3
3
|
import { InfluxDBManagerBase } from './influxDBManagerBase';
|
|
4
4
|
import { IInfluxDBManagerOptions } from './../commonTypes';
|
|
5
|
-
import { ISubscriptionPayload, ISubscriptionKey } from '@nsshunt/stssocketio-client';
|
|
6
5
|
export declare class InfluxDBManagerAgent extends InfluxDBManagerBase {
|
|
7
|
-
#private;
|
|
8
6
|
constructor(options: IInfluxDBManagerOptions, queryApi: QueryApi);
|
|
9
7
|
get modelType(): string;
|
|
10
|
-
GetInfluxDBResultsRootAgent(subscriptionKey: ISubscriptionKey): Promise<ISubscriptionPayload>;
|
|
11
|
-
GetInfluxDBResultsAgent(subscriptionKey: ISubscriptionKey): Promise<ISubscriptionPayload>;
|
|
12
|
-
GetInfluxDBResultsAgentThreads(subscriptionKey: ISubscriptionKey): Promise<ISubscriptionPayload>;
|
|
13
|
-
GetInfluxDBResultsAgentThread(subscriptionKey: ISubscriptionKey): Promise<ISubscriptionPayload>;
|
|
14
8
|
}
|
|
15
9
|
//# sourceMappingURL=influxDBManagerAgent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerAgent.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerAgent.ts"],"names":[],"mappings":";AAuGA,OAAO,EAAmB,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAIvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"influxDBManagerAgent.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerAgent.ts"],"names":[],"mappings":";AAuGA,OAAO,EAAmB,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAIvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAa1D,qBAAa,oBAAqB,SAAQ,mBAAmB;gBAE7C,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,QAAQ;IAIhE,IAAa,SAAS,IAAI,MAAM,CAE/B;CAyJJ"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { WriteApi, QueryApi } from '@influxdata/influxdb-client';
|
|
2
2
|
import { IInfluxDBManagerOptions } from './../commonTypes';
|
|
3
3
|
import { IInstrumentPayload } from '@nsshunt/stspublisherserver';
|
|
4
|
-
import { JSONObject } from '@nsshunt/stsutils';
|
|
5
4
|
export declare class InfluxDBManagerBase {
|
|
6
5
|
#private;
|
|
7
6
|
constructor(options: IInfluxDBManagerOptions, queryApi: QueryApi);
|
|
@@ -10,9 +9,6 @@ export declare class InfluxDBManagerBase {
|
|
|
10
9
|
get shuttingDown(): boolean;
|
|
11
10
|
set shuttingDown(val: boolean);
|
|
12
11
|
get modelType(): string;
|
|
13
|
-
ProcessInfluxDBResults(promArray: Promise<any>[], fields: string[]): Promise<any>;
|
|
14
|
-
CreateGlobalCountModel: (stscount: any[]) => any;
|
|
15
|
-
CreateNestedObject(combinedResults: JSONObject, keyList: string[]): JSONObject;
|
|
16
12
|
OutputInfluxDB(writeApi: WriteApi, instrumentPayload: IInstrumentPayload, serviceType: string): Promise<boolean>;
|
|
17
13
|
}
|
|
18
14
|
//# sourceMappingURL=influxDBManagerBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerBase.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerBase.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"influxDBManagerBase.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerBase.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAUhE,qBAAa,mBAAmB;;gBAMhB,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,QAAQ;IAShE,IAAI,OAAO,4BAEV;IACD,IAAI,QAAQ,aAEX;IAED,IAAI,YAAY,IAGM,OAAO,CAD5B;IACD,IAAI,YAAY,CAAC,GAAG,EAAE,OAAO,EAE5B;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAqEK,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CA0DzH"}
|
|
@@ -2,14 +2,8 @@
|
|
|
2
2
|
import { QueryApi } from '@influxdata/influxdb-client';
|
|
3
3
|
import { InfluxDBManagerBase } from './influxDBManagerBase';
|
|
4
4
|
import { IInfluxDBManagerOptions } from './../commonTypes';
|
|
5
|
-
import { ISubscriptionPayload, ISubscriptionKey } from '@nsshunt/stssocketio-client';
|
|
6
5
|
export declare class InfluxDBManagerService extends InfluxDBManagerBase {
|
|
7
|
-
#private;
|
|
8
6
|
constructor(options: IInfluxDBManagerOptions, queryApi: QueryApi);
|
|
9
7
|
get modelType(): string;
|
|
10
|
-
GetInfluxDBResultsRootService(subscriptionKey: ISubscriptionKey): Promise<ISubscriptionPayload>;
|
|
11
|
-
GetInfluxDBResultsService(subscriptionKey: ISubscriptionKey): Promise<ISubscriptionPayload>;
|
|
12
|
-
GetInfluxDBResultsServiceInstances(subscriptionKey: ISubscriptionKey): Promise<ISubscriptionPayload>;
|
|
13
|
-
GetInfluxDBResultsServiceInstance(subscriptionKey: ISubscriptionKey): Promise<ISubscriptionPayload>;
|
|
14
8
|
}
|
|
15
9
|
//# sourceMappingURL=influxDBManagerService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerService.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerService.ts"],"names":[],"mappings":";AAgHA,OAAO,EAAmB,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAIvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"influxDBManagerService.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerService.ts"],"names":[],"mappings":";AAgHA,OAAO,EAAmB,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAIvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAuB1D,qBAAa,sBAAuB,SAAQ,mBAAmB;gBAE/C,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,QAAQ;IAIhE,IAAa,SAAS,IAAI,MAAM,CAE/B;CA+JJ"}
|