@nsshunt/stsappframework 3.0.58 → 3.0.60
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/README.md +45 -0
- package/dist/influxdb/influxDBManagerAgent.js +115 -126
- package/dist/influxdb/influxDBManagerAgent.js.map +1 -1
- package/dist/influxdb/influxDBManagerService.js +108 -3
- package/dist/influxdb/influxDBManagerService.js.map +1 -1
- package/package.json +25 -25
- package/src/influxdb/influxDBManagerAgent.ts +116 -127
- package/src/influxdb/influxDBManagerService.ts +108 -1
- package/types/influxdb/influxDBManagerAgent.d.ts +1 -0
- package/types/influxdb/influxDBManagerAgent.d.ts.map +1 -1
- package/types/influxdb/influxDBManagerService.d.ts +1 -0
- package/types/influxdb/influxDBManagerService.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -339,3 +339,48 @@ union(tables: [globalServiceSum, globalServiceMean])
|
|
|
339
339
|
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-globalservice"}))
|
|
340
340
|
|> to(org: "my-org", bucket: "TestBucket01")
|
|
341
341
|
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
--- Agents
|
|
347
|
+
|
|
348
|
+
option task = {name: "task-sts-agent-stats", every: 1s}
|
|
349
|
+
|
|
350
|
+
data =
|
|
351
|
+
from(bucket: "TestBucket01")
|
|
352
|
+
|> range(start: -5s)
|
|
353
|
+
|> last()
|
|
354
|
+
|> filter(fn: (r) => r["_measurement"] == "agent")
|
|
355
|
+
|
|
356
|
+
byagentthreadasyncunner =
|
|
357
|
+
data
|
|
358
|
+
|> group(columns: ["agentName", "threadId", "asyncRunnerId", "_field"])
|
|
359
|
+
|> sum()
|
|
360
|
+
|> toFloat()
|
|
361
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-agentthreadasyncunner"}))
|
|
362
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
363
|
+
|
|
364
|
+
byagentthread =
|
|
365
|
+
data
|
|
366
|
+
|> group(columns: ["agentName", "threadId", "_field"])
|
|
367
|
+
|> sum()
|
|
368
|
+
|> toFloat()
|
|
369
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-agentthread"}))
|
|
370
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
371
|
+
|
|
372
|
+
byagent =
|
|
373
|
+
data
|
|
374
|
+
|> group(columns: ["agentName", "_field"])
|
|
375
|
+
|> sum()
|
|
376
|
+
|> toFloat()
|
|
377
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-agent"}))
|
|
378
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
379
|
+
|
|
380
|
+
globalagent =
|
|
381
|
+
data
|
|
382
|
+
|> group(columns: ["_field"])
|
|
383
|
+
|> sum()
|
|
384
|
+
|> toFloat()
|
|
385
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-globalagent"}))
|
|
386
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
@@ -1,12 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InfluxDBManagerAgent = void 0;
|
|
4
2
|
/* eslint @typescript-eslint/no-explicit-any: 0, @typescript-eslint/no-unused-vars: 0 */ // --> OFF
|
|
5
3
|
// https://www.influxdata.com/blog/tldr-influxdb-tech-tips-multiple-aggregations-yield-flux/
|
|
6
4
|
// https://www.influxdata.com/blog/top-5-hurdles-for-intermediate-flux-users-and-resources-for-optimizing-flux/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InfluxDBManagerAgent = void 0;
|
|
7
|
+
/*
|
|
8
|
+
option task = {name: "task-sts-agent-stats", every: 1s}
|
|
9
|
+
|
|
10
|
+
data =
|
|
11
|
+
from(bucket: "TestBucket01")
|
|
12
|
+
|> range(start: -5s)
|
|
13
|
+
|> last()
|
|
14
|
+
|> filter(fn: (r) => r["_measurement"] == "agent")
|
|
15
|
+
|
|
16
|
+
r1 =
|
|
17
|
+
data
|
|
18
|
+
|> filter(fn: (r) => r["_field"] == "requestCount"
|
|
19
|
+
or r["_field"] == "errorCount"
|
|
20
|
+
or r["_field"] == "retryCount"
|
|
21
|
+
or r["_field"] == "authenticationCount"
|
|
22
|
+
or r["_field"] == "activeRequestCount"
|
|
23
|
+
or r["_field"] == "coreCount"
|
|
24
|
+
or r["_field"] == "velocity"
|
|
25
|
+
or r["_field"] == "childCount"
|
|
26
|
+
or r["_field"] == "timer")
|
|
27
|
+
|
|
28
|
+
r2 =
|
|
29
|
+
data
|
|
30
|
+
|> filter(fn: (r) => float(v: r["_value"]) > 0.0 and (r["_field"] == "duration"
|
|
31
|
+
or r["_field"] == "latency"))
|
|
32
|
+
|
|
33
|
+
byagentthreadasyncunnersum =
|
|
34
|
+
r1
|
|
35
|
+
|> group(columns: ["agentName", "threadId", "asyncRunnerId", "_field"])
|
|
36
|
+
|> sum()
|
|
37
|
+
|> toFloat()
|
|
38
|
+
|
|
39
|
+
byagentthreadasyncunnermean =
|
|
40
|
+
r2
|
|
41
|
+
|> group(columns: ["agentName", "threadId", "asyncRunnerId", "_field"])
|
|
42
|
+
|> mean()
|
|
43
|
+
|> toFloat()
|
|
44
|
+
|
|
45
|
+
union(tables: [byagentthreadasyncunnersum, byagentthreadasyncunnermean])
|
|
46
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-agentthreadasyncunner"}))
|
|
47
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
48
|
+
|
|
49
|
+
byagentthreadsum =
|
|
50
|
+
r1
|
|
51
|
+
|> group(columns: ["agentName", "threadId", "_field"])
|
|
52
|
+
|> sum()
|
|
53
|
+
|> toFloat()
|
|
54
|
+
|
|
55
|
+
byagentthreadmean =
|
|
56
|
+
r2
|
|
57
|
+
|> group(columns: ["agentName", "threadId", "_field"])
|
|
58
|
+
|> mean()
|
|
59
|
+
|> toFloat()
|
|
60
|
+
|
|
61
|
+
union(tables: [byagentthreadsum, byagentthreadmean])
|
|
62
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-agentthread"}))
|
|
63
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
64
|
+
|
|
65
|
+
byagentsum =
|
|
66
|
+
r1
|
|
67
|
+
|> group(columns: ["agentName", "_field"])
|
|
68
|
+
|> sum()
|
|
69
|
+
|> toFloat()
|
|
70
|
+
|
|
71
|
+
byagentmean =
|
|
72
|
+
r2
|
|
73
|
+
|> group(columns: ["agentName", "_field"])
|
|
74
|
+
|> mean()
|
|
75
|
+
|> toFloat()
|
|
76
|
+
|
|
77
|
+
union(tables: [byagentsum, byagentmean])
|
|
78
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-agent"}))
|
|
79
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
80
|
+
|
|
81
|
+
globalagentsum =
|
|
82
|
+
r1
|
|
83
|
+
|> group(columns: ["_field"])
|
|
84
|
+
|> sum()
|
|
85
|
+
|> toFloat()
|
|
86
|
+
|
|
87
|
+
globalagentmean =
|
|
88
|
+
r2
|
|
89
|
+
|> group(columns: ["_field"])
|
|
90
|
+
|> mean()
|
|
91
|
+
|> toFloat()
|
|
92
|
+
|
|
93
|
+
union(tables: [globalagentsum, globalagentmean])
|
|
94
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-globalagent"}))
|
|
95
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
96
|
+
|
|
97
|
+
*/
|
|
7
98
|
const influxdb_client_1 = require("@influxdata/influxdb-client");
|
|
8
99
|
const stsinstrumentation_1 = require("@nsshunt/stsinstrumentation");
|
|
9
100
|
const influxDBManagerBase_1 = require("./influxDBManagerBase");
|
|
101
|
+
const AGENT_STATS_BY_AGENT_THREAD_ASYNCRUNNER = "sts-stats-by-agentthreadasyncunner";
|
|
102
|
+
const AGENT_STATS_BY_AGENT_THREAD = "sts-stats-by-agentthread";
|
|
103
|
+
const AGENT_STATS_BY_AGENT = "sts-stats-by-agent";
|
|
104
|
+
const AGENT_STATS_GLOBALAGENT = "sts-stats-globalagent";
|
|
10
105
|
const _logPrefix = 'InfluxDBManagerService:';
|
|
11
106
|
class InfluxDBManagerAgent extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
12
107
|
constructor(options, queryApi, writeClient) {
|
|
@@ -17,58 +112,12 @@ class InfluxDBManagerAgent extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
|
17
112
|
}
|
|
18
113
|
// Queries --------------------------------------------------------------------------------------------------------
|
|
19
114
|
// Counter metrics
|
|
20
|
-
#GetSTSCountGenericAgent = async (
|
|
115
|
+
#GetSTSCountGenericAgent = async (measurement, filterClause, showOutput = false) => {
|
|
21
116
|
try {
|
|
22
117
|
const query = `from(bucket: "${this.options.bucket}")
|
|
23
118
|
|> range(start: -5s)
|
|
24
119
|
|> last()
|
|
25
|
-
|> filter(fn: (r) => r["_measurement"] == "
|
|
26
|
-
or r["_field"] == "retryCount"
|
|
27
|
-
or r["_field"] == "authenticationCount"
|
|
28
|
-
or r["_field"] == "velocity"
|
|
29
|
-
or r["_field"] == "coreCount"
|
|
30
|
-
or r["_field"] == "timer"
|
|
31
|
-
or r["_field"] == "duration"
|
|
32
|
-
or r["_field"] == "latency"
|
|
33
|
-
or r["_field"] == "activeRequestCount"
|
|
34
|
-
or r["_field"] == "childCount") ${filterClause})
|
|
35
|
-
|> ${groupClause}
|
|
36
|
-
|> sum()`;
|
|
37
|
-
if (showOutput) {
|
|
38
|
-
console.log(query);
|
|
39
|
-
}
|
|
40
|
-
return this.queryApi.collectRows(query);
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
console.error(`${_logPrefix}#GetSTSCountGeneric: Error: [${error}]`.red);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
#GetSTSCountGenericAgentOld = async (filterClause, groupClause, showOutput = false) => {
|
|
47
|
-
try {
|
|
48
|
-
const query = `dostscountex = (q, d) =>
|
|
49
|
-
from(bucket: "${this.options.bucket}")
|
|
50
|
-
|> range(start: d)
|
|
51
|
-
|> filter(fn: (r) => r["_measurement"] == "agent" ${filterClause})
|
|
52
|
-
|> filter(fn: (r) => r["_field"] == q)
|
|
53
|
-
|> last()
|
|
54
|
-
|> ${groupClause}
|
|
55
|
-
|> sum()
|
|
56
|
-
|
|
57
|
-
dostscount = (d) =>
|
|
58
|
-
union(tables: [
|
|
59
|
-
dostscountex(q: "requestCount", d: d),
|
|
60
|
-
dostscountex(q: "errorCount", d: d),
|
|
61
|
-
dostscountex(q: "retryCount", d: d),
|
|
62
|
-
dostscountex(q: "authenticationCount", d: d),
|
|
63
|
-
dostscountex(q: "velocity", d: d),
|
|
64
|
-
dostscountex(q: "coreCount", d: d),
|
|
65
|
-
dostscountex(q: "timer", d: d),
|
|
66
|
-
dostscountex(q: "duration", d: d),
|
|
67
|
-
dostscountex(q: "latency", d: d),
|
|
68
|
-
dostscountex(q: "activeRequestCount", d: d),
|
|
69
|
-
dostscountex(q: "childCount", d: d)
|
|
70
|
-
])
|
|
71
|
-
dostscount(d: -5s)`;
|
|
120
|
+
|> filter(fn: (r) => r["_measurement"] == "${measurement}" ${filterClause})`;
|
|
72
121
|
if (showOutput) {
|
|
73
122
|
console.log(query);
|
|
74
123
|
}
|
|
@@ -79,14 +128,13 @@ class InfluxDBManagerAgent extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
|
79
128
|
}
|
|
80
129
|
};
|
|
81
130
|
// Histo metrics
|
|
82
|
-
#GetSTSHistoGenericService = async (
|
|
131
|
+
#GetSTSHistoGenericService = async (measurement, filterClause) => {
|
|
83
132
|
try {
|
|
84
133
|
const query = `import "math"
|
|
85
134
|
from(bucket: "${this.options.bucket}")
|
|
86
135
|
|> range(start: -10m)
|
|
87
|
-
|> filter(fn: (r) => r["_measurement"] == "
|
|
136
|
+
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] =="latency"
|
|
88
137
|
or r["_field"] =="duration") ${filterClause})
|
|
89
|
-
|> ${groupClause}
|
|
90
138
|
|> histogram(bins: [0.0, 10.0, 20.0, 50.0, 100.0, 1000.0, 50000.0, math.mInf(sign: 1) ])
|
|
91
139
|
|> difference()`;
|
|
92
140
|
return this.queryApi.collectRows(query);
|
|
@@ -95,40 +143,13 @@ class InfluxDBManagerAgent extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
|
95
143
|
console.error(`${_logPrefix}#GetSTSHistoGeneric: Error: [${error}]`.red);
|
|
96
144
|
}
|
|
97
145
|
};
|
|
98
|
-
#GetSTSHistoGenericServiceOld = async (filterClause, groupClause) => {
|
|
99
|
-
try {
|
|
100
|
-
const query = `import "math"
|
|
101
|
-
|
|
102
|
-
dostshistoex = (q, d) =>
|
|
103
|
-
from(bucket: "${this.options.bucket}")
|
|
104
|
-
|> range(start: d)
|
|
105
|
-
|> filter(fn: (r) => r["_measurement"] == "agent")
|
|
106
|
-
|> filter(fn: (r) => r["_field"] == q ${filterClause})
|
|
107
|
-
|> ${groupClause}
|
|
108
|
-
|> histogram(bins: [0.0, 10.0, 20.0, 50.0, 100.0, 1000.0, 50000.0, math.mInf(sign: 1) ])
|
|
109
|
-
|> difference()
|
|
110
|
-
|
|
111
|
-
dostshisto = (d) =>
|
|
112
|
-
union(tables: [
|
|
113
|
-
dostshistoex(q: "latency", d: d),
|
|
114
|
-
dostshistoex(q: "duration", d: d)
|
|
115
|
-
])
|
|
116
|
-
|
|
117
|
-
dostshisto(d: -10m)`;
|
|
118
|
-
return this.queryApi.collectRows(query);
|
|
119
|
-
}
|
|
120
|
-
catch (error) {
|
|
121
|
-
console.error(`${_logPrefix}#GetSTSHistoGeneric: Error: [${error}]`.red);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
146
|
// Quantile metrics
|
|
125
|
-
#GetSTSQuantileGenericAgent = async (
|
|
147
|
+
#GetSTSQuantileGenericAgent = async (measurement, filterClause) => {
|
|
126
148
|
try {
|
|
127
149
|
const query = `data = from(bucket: "${this.options.bucket}")
|
|
128
150
|
|> range(start: -10m)
|
|
129
|
-
|> filter(fn: (r) => r["_measurement"] == "
|
|
151
|
+
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] == "latency"
|
|
130
152
|
or r["_field"] == "duration") ${filterClause})
|
|
131
|
-
|> ${groupClause}
|
|
132
153
|
|> aggregateWindow(every: 5s, fn: max, createEmpty: false)
|
|
133
154
|
|
|
134
155
|
dostsquantileex = (q) =>
|
|
@@ -150,47 +171,15 @@ class InfluxDBManagerAgent extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
|
150
171
|
console.error(`${_logPrefix}#GetSTSQuantileGeneric: Error: [${error}]`.red);
|
|
151
172
|
}
|
|
152
173
|
};
|
|
153
|
-
#GetSTSQuantileGenericAgentOld = async (filterClause, groupClause) => {
|
|
154
|
-
try {
|
|
155
|
-
const query = `dostsquantileex = (q, d, i, f) =>
|
|
156
|
-
from(bucket: "${this.options.bucket}")
|
|
157
|
-
|> range(start: d)
|
|
158
|
-
|> filter(fn: (r) => r["_measurement"] == "agent")
|
|
159
|
-
|> filter(fn: (r) => r["_field"] == f ${filterClause})
|
|
160
|
-
|> ${groupClause}
|
|
161
|
-
|> aggregateWindow(every: i, fn: max, createEmpty: false)
|
|
162
|
-
|> quantile(q: q, method: "estimate_tdigest", compression: 1000.0)
|
|
163
|
-
|> set(key: "quantile", value: string(v:q))
|
|
164
|
-
|> group(columns: ["LatencyType","quantile"])
|
|
165
|
-
|
|
166
|
-
dostsquantile = (d, i, f) =>
|
|
167
|
-
union(tables: [
|
|
168
|
-
dostsquantileex(q: 0.5, d: d, i: i, f: f),
|
|
169
|
-
dostsquantileex(q: 0.8, d: d, i: i, f: f),
|
|
170
|
-
dostsquantileex(q: 0.9, d: d, i: i, f: f),
|
|
171
|
-
dostsquantileex(q: 0.95, d: d, i: i, f: f),
|
|
172
|
-
dostsquantileex(q: 0.99, d: d, i: i, f: f)
|
|
173
|
-
])
|
|
174
|
-
|
|
175
|
-
union(tables: [
|
|
176
|
-
dostsquantile(d: -10m, i: 5s, f: "latency"),
|
|
177
|
-
dostsquantile(d: -10m, i: 5s, f: "duration")
|
|
178
|
-
])`;
|
|
179
|
-
return this.queryApi.collectRows(query);
|
|
180
|
-
}
|
|
181
|
-
catch (error) {
|
|
182
|
-
console.error(`${_logPrefix}#GetSTSQuantileGeneric: Error: [${error}]`.red);
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
174
|
// Metric queries -------------------------------------------------------------------------------------------------
|
|
186
175
|
// Root level metrics
|
|
187
176
|
async GetInfluxDBResultsRootAgent(subscriptionKey) {
|
|
188
177
|
let retVal = null;
|
|
189
178
|
try {
|
|
190
179
|
retVal = await this.ProcessInfluxDBResults([
|
|
191
|
-
this.#GetSTSCountGenericAgent(
|
|
192
|
-
this.#GetSTSQuantileGenericAgent(
|
|
193
|
-
this.#GetSTSHistoGenericService(
|
|
180
|
+
this.#GetSTSCountGenericAgent(AGENT_STATS_GLOBALAGENT, ''),
|
|
181
|
+
this.#GetSTSQuantileGenericAgent(AGENT_STATS_GLOBALAGENT, ''),
|
|
182
|
+
this.#GetSTSHistoGenericService(AGENT_STATS_GLOBALAGENT, '')
|
|
194
183
|
], []);
|
|
195
184
|
}
|
|
196
185
|
catch (error) {
|
|
@@ -206,9 +195,9 @@ class InfluxDBManagerAgent extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
|
206
195
|
let retVal = null;
|
|
207
196
|
try {
|
|
208
197
|
retVal = await this.ProcessInfluxDBResults([
|
|
209
|
-
this.#GetSTSCountGenericAgent(
|
|
210
|
-
this.#GetSTSQuantileGenericAgent(
|
|
211
|
-
this.#GetSTSHistoGenericService(
|
|
198
|
+
this.#GetSTSCountGenericAgent(AGENT_STATS_BY_AGENT, ''),
|
|
199
|
+
this.#GetSTSQuantileGenericAgent(AGENT_STATS_BY_AGENT, ''),
|
|
200
|
+
this.#GetSTSHistoGenericService(AGENT_STATS_BY_AGENT, '')
|
|
212
201
|
], ['agentName']);
|
|
213
202
|
}
|
|
214
203
|
catch (error) {
|
|
@@ -225,9 +214,9 @@ class InfluxDBManagerAgent extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
|
225
214
|
try {
|
|
226
215
|
const agentName = subscriptionKey.key;
|
|
227
216
|
retVal = await this.ProcessInfluxDBResults([
|
|
228
|
-
this.#GetSTSCountGenericAgent(`and r["agentName"] == "${agentName}"
|
|
229
|
-
this.#GetSTSQuantileGenericAgent(`and r["agentName"] == "${agentName}"
|
|
230
|
-
this.#GetSTSHistoGenericService(`and r["agentName"] == "${agentName}"
|
|
217
|
+
this.#GetSTSCountGenericAgent(AGENT_STATS_BY_AGENT_THREAD, `and r["agentName"] == "${agentName}"`),
|
|
218
|
+
this.#GetSTSQuantileGenericAgent(AGENT_STATS_BY_AGENT_THREAD, `and r["agentName"] == "${agentName}"`),
|
|
219
|
+
this.#GetSTSHistoGenericService(AGENT_STATS_BY_AGENT_THREAD, `and r["agentName"] == "${agentName}"`)
|
|
231
220
|
], ['agentName', 'threadId']);
|
|
232
221
|
}
|
|
233
222
|
catch (error) {
|
|
@@ -245,9 +234,9 @@ class InfluxDBManagerAgent extends influxDBManagerBase_1.InfluxDBManagerBase {
|
|
|
245
234
|
const agentName = subscriptionKey.key;
|
|
246
235
|
const threadId = subscriptionKey.subkey;
|
|
247
236
|
retVal = await this.ProcessInfluxDBResults([
|
|
248
|
-
this.#GetSTSCountGenericAgent(`and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"
|
|
249
|
-
this.#GetSTSQuantileGenericAgent(`and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"
|
|
250
|
-
this.#GetSTSHistoGenericService(`and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"
|
|
237
|
+
this.#GetSTSCountGenericAgent(AGENT_STATS_BY_AGENT_THREAD_ASYNCRUNNER, `and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"`),
|
|
238
|
+
this.#GetSTSQuantileGenericAgent(AGENT_STATS_BY_AGENT_THREAD_ASYNCRUNNER, `and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"`),
|
|
239
|
+
this.#GetSTSHistoGenericService(AGENT_STATS_BY_AGENT_THREAD_ASYNCRUNNER, `and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"`)
|
|
251
240
|
], ['agentName', 'threadId', 'asyncRunnerId']);
|
|
252
241
|
}
|
|
253
242
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerAgent.js","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerAgent.ts"],"names":[],"mappings":"
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0FE;AAEF,iEAAuE;AAEvE,oEAAuE;AAEvE,+DAA2D;AAK3D,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,EAAE,WAAqB;QACnF,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,IAAa,SAAS;QAClB,OAAO,OAAO,CAAA;IAClB,CAAC;IAED,mHAAmH;IAEnH,kBAAkB;IAClB,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C,GAAG,UAAU,qDAAqD,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;YAC9F,OAAO,KAAK,CAAC;SAChB;IACL,CAAC;CACJ;AAhMD,oDAgMC"}
|
|
@@ -1,9 +1,114 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InfluxDBManagerService = void 0;
|
|
4
2
|
/* eslint @typescript-eslint/no-explicit-any: 0, @typescript-eslint/no-unused-vars: 0 */ // --> OFF
|
|
5
3
|
// https://www.influxdata.com/blog/tldr-influxdb-tech-tips-multiple-aggregations-yield-flux/
|
|
6
4
|
// https://www.influxdata.com/blog/top-5-hurdles-for-intermediate-flux-users-and-resources-for-optimizing-flux/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InfluxDBManagerService = void 0;
|
|
7
|
+
/*
|
|
8
|
+
option task = {
|
|
9
|
+
name: "task-sts-service-stats",
|
|
10
|
+
every: 1s,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
data =
|
|
14
|
+
from(bucket: "TestBucket01")
|
|
15
|
+
|> range(start: -5s)
|
|
16
|
+
|> last()
|
|
17
|
+
|> filter(fn: (r) => r["_measurement"] == "service" and r["_field"] != "memory")
|
|
18
|
+
|
|
19
|
+
r1 =
|
|
20
|
+
data
|
|
21
|
+
|> filter(
|
|
22
|
+
fn: (r) =>
|
|
23
|
+
r["_field"] == "requestCount" or r["_field"] == "errorCount" or r["_field"]
|
|
24
|
+
==
|
|
25
|
+
"retryCount" or r["_field"] == "authenticationCount" or r["_field"]
|
|
26
|
+
==
|
|
27
|
+
"activeRequestCount" or r["_field"] == "connectionCount" or r["_field"]
|
|
28
|
+
==
|
|
29
|
+
"connectionPoolCount" or r["_field"] == "connectionIdleCount" or r["_field"]
|
|
30
|
+
==
|
|
31
|
+
"connectionWaitingCount" or r["_field"] == "coreCount" or r["_field"] == "cpu"
|
|
32
|
+
or
|
|
33
|
+
r["_field"] == "systemcpu" or r["_field"] == "velocity" or r["_field"]
|
|
34
|
+
==
|
|
35
|
+
"timer",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
r2 =
|
|
39
|
+
data
|
|
40
|
+
|> filter(
|
|
41
|
+
fn: (r) =>
|
|
42
|
+
float(v: r["_value"]) > 0.0 and (r["_field"] == "duration" or r["_field"]
|
|
43
|
+
==
|
|
44
|
+
"latency"),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
serviceInstanceProcessSum =
|
|
48
|
+
r1
|
|
49
|
+
|> group(columns: ["serviceId", "serviceInstanceId", "serviceInstanceProcessId", "_field"])
|
|
50
|
+
|> sum()
|
|
51
|
+
|> toFloat()
|
|
52
|
+
|
|
53
|
+
serviceInstanceProcessMean =
|
|
54
|
+
r2
|
|
55
|
+
|> group(columns: ["serviceId", "serviceInstanceId", "serviceInstanceProcessId", "_field"])
|
|
56
|
+
|> mean()
|
|
57
|
+
|> toFloat()
|
|
58
|
+
|
|
59
|
+
union(tables: [serviceInstanceProcessSum, serviceInstanceProcessMean])
|
|
60
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-serviceinstanceprocess"}))
|
|
61
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
62
|
+
|
|
63
|
+
serviceInstanceSum =
|
|
64
|
+
r1
|
|
65
|
+
|> group(columns: ["serviceId", "serviceInstanceId", "_field"])
|
|
66
|
+
|> sum()
|
|
67
|
+
|> toFloat()
|
|
68
|
+
|
|
69
|
+
serviceInstanceMean =
|
|
70
|
+
r2
|
|
71
|
+
|> group(columns: ["serviceId", "serviceInstanceId", "_field"])
|
|
72
|
+
|> mean()
|
|
73
|
+
|> toFloat()
|
|
74
|
+
|
|
75
|
+
union(tables: [serviceInstanceSum, serviceInstanceMean])
|
|
76
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-serviceinstance"}))
|
|
77
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
78
|
+
|
|
79
|
+
serviceSum =
|
|
80
|
+
r1
|
|
81
|
+
|> group(columns: ["serviceId", "_field"])
|
|
82
|
+
|> sum()
|
|
83
|
+
|> toFloat()
|
|
84
|
+
|
|
85
|
+
serviceMean =
|
|
86
|
+
r2
|
|
87
|
+
|> group(columns: ["serviceId", "_field"])
|
|
88
|
+
|> mean()
|
|
89
|
+
|> toFloat()
|
|
90
|
+
|
|
91
|
+
union(tables: [serviceSum, serviceMean])
|
|
92
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-service"}))
|
|
93
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
94
|
+
|
|
95
|
+
globalServiceSum =
|
|
96
|
+
r1
|
|
97
|
+
|> group(columns: ["_field"])
|
|
98
|
+
|> sum()
|
|
99
|
+
|> toFloat()
|
|
100
|
+
|
|
101
|
+
globalServiceMean =
|
|
102
|
+
r2
|
|
103
|
+
|> group(columns: ["_field"])
|
|
104
|
+
|> mean()
|
|
105
|
+
|> toFloat()
|
|
106
|
+
|
|
107
|
+
union(tables: [globalServiceSum, globalServiceMean])
|
|
108
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-globalservice"}))
|
|
109
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
110
|
+
|
|
111
|
+
*/
|
|
7
112
|
const influxdb_client_1 = require("@influxdata/influxdb-client");
|
|
8
113
|
const stsinstrumentation_1 = require("@nsshunt/stsinstrumentation");
|
|
9
114
|
const influxDBManagerBase_1 = require("./influxDBManagerBase");
|
|
@@ -181,7 +286,7 @@ data
|
|
|
181
286
|
#GetSTSHistoGenericService = async (measurement, filterClause, groupClause) => {
|
|
182
287
|
try {
|
|
183
288
|
const query = `import "math"
|
|
184
|
-
from(bucket: "
|
|
289
|
+
from(bucket: "${this.options.bucket}")
|
|
185
290
|
|> range(start: -10m)
|
|
186
291
|
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] =="latency" or
|
|
187
292
|
r["_field"] =="duration") ${filterClause})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerService.js","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"influxDBManagerService.js","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerService.ts"],"names":[],"mappings":";AAAA,wFAAwF,CAAE,UAAU;AACpG,4FAA4F;AAC5F,+GAA+G;;;AAE/G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwGE;AAEF,iEAAuE;AAEvE,oEAAuE;AAEvE,+DAA2D;AAK3D,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;AAEvD,MAAa,sBAAuB,SAAQ,yCAAmB;IAE3D,YAAY,OAAgC,EAAE,QAAkB,EAAE,WAAqB;QACnF,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,IAAa,SAAS;QAClB,OAAO,SAAS,CAAA;IACpB,CAAC;IAED,mHAAmH;IAEnH;;;;;;;;;;;;;;EAcF;IAEE,0BAA0B,GAAG,KAAK,EAAE,WAAmB,EAAE,YAAoB,EAAE,WAAmB,EAAE,aAAsB,KAAK,EAAgB,EAAE;QAC7I,IAAI;YACA,MAAM,KAAK,GAAG,sBAAsB,IAAI,CAAC,OAAO,CAAC,MAAM;;;yDAGV,WAAW,KAAK,YAAY;;iCAEpD,IAAI,CAAC,OAAO,CAAC,MAAM;;;kEAGc,YAAY;;oCAE1C,CAAC;YAEzB,I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C,KAAK,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC;SACf;QAAC,OAAO,KAAU,EAAE;YACjB,OAAO,CAAC,KAAK,CAAC,GAAG,UAAU,gDAAgD,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;YACzF,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;YAClE,OAAO,KAAK,CAAC;SAChB;IACL,CAAC;CACJ;AAvdD,wDAudC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsshunt/stsappframework",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.60",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -25,40 +25,40 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/nsshunt/stsappframework#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@babel/preset-env": "^7.23.
|
|
29
|
-
"@babel/preset-typescript": "^7.23.
|
|
28
|
+
"@babel/preset-env": "^7.23.3",
|
|
29
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
30
30
|
"@tsconfig/node20": "^20.1.2",
|
|
31
|
-
"@types/cookie-parser": "^1.4.
|
|
32
|
-
"@types/debug": "^4.1.
|
|
33
|
-
"@types/express": "^4.17.
|
|
34
|
-
"@types/jest": "^29.5.
|
|
35
|
-
"@types/jsonwebtoken": "^9.0.
|
|
36
|
-
"@types/lodash": "^4.14.
|
|
37
|
-
"@types/pg": "^8.10.
|
|
38
|
-
"@types/uuid": "^9.0.
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
40
|
-
"@typescript-eslint/parser": "^6.
|
|
31
|
+
"@types/cookie-parser": "^1.4.6",
|
|
32
|
+
"@types/debug": "^4.1.12",
|
|
33
|
+
"@types/express": "^4.17.21",
|
|
34
|
+
"@types/jest": "^29.5.8",
|
|
35
|
+
"@types/jsonwebtoken": "^9.0.5",
|
|
36
|
+
"@types/lodash": "^4.14.201",
|
|
37
|
+
"@types/pg": "^8.10.9",
|
|
38
|
+
"@types/uuid": "^9.0.7",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
40
|
+
"@typescript-eslint/parser": "^6.10.0",
|
|
41
41
|
"@vitest/ui": "^0.34.6",
|
|
42
|
-
"eslint": "^8.
|
|
42
|
+
"eslint": "^8.53.0",
|
|
43
43
|
"jest": "^29.7.0",
|
|
44
44
|
"supertest": "^6.3.3",
|
|
45
|
-
"testcontainers": "^10.2.
|
|
45
|
+
"testcontainers": "^10.2.2",
|
|
46
46
|
"typescript": "^5.2.2"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@influxdata/influxdb-client": "^1.33.2",
|
|
50
50
|
"@influxdata/influxdb-client-apis": "^1.33.2",
|
|
51
|
-
"@nsshunt/stsconfig": "^1.25.
|
|
52
|
-
"@nsshunt/stsdatamanagement": "^1.17.
|
|
53
|
-
"@nsshunt/stsinstrumentation": "^7.0.
|
|
54
|
-
"@nsshunt/stspublisherserver": "^2.0.
|
|
55
|
-
"@nsshunt/stssocketio-client": "^0.0.
|
|
56
|
-
"@nsshunt/stsutils": "^1.16.
|
|
51
|
+
"@nsshunt/stsconfig": "^1.25.59",
|
|
52
|
+
"@nsshunt/stsdatamanagement": "^1.17.130",
|
|
53
|
+
"@nsshunt/stsinstrumentation": "^7.0.5",
|
|
54
|
+
"@nsshunt/stspublisherserver": "^2.0.19",
|
|
55
|
+
"@nsshunt/stssocketio-client": "^0.0.84",
|
|
56
|
+
"@nsshunt/stsutils": "^1.16.15",
|
|
57
57
|
"@socket.io/cluster-adapter": "^0.2.2",
|
|
58
58
|
"@socket.io/redis-streams-adapter": "^0.1.0",
|
|
59
|
-
"@types/pidusage": "^2.0.
|
|
60
|
-
"@types/tough-cookie": "^4.0.
|
|
61
|
-
"axios": "^1.
|
|
59
|
+
"@types/pidusage": "^2.0.5",
|
|
60
|
+
"@types/tough-cookie": "^4.0.5",
|
|
61
|
+
"axios": "^1.6.1",
|
|
62
62
|
"colors": "^1.4.0",
|
|
63
63
|
"cookie-parser": "^1.4.6",
|
|
64
64
|
"cors": "^2.8.5",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"redis": "^4.6.10",
|
|
76
76
|
"socket.io": "^4.7.2",
|
|
77
77
|
"socket.io-client": "^4.7.2",
|
|
78
|
-
"systeminformation": "^5.21.
|
|
78
|
+
"systeminformation": "^5.21.17",
|
|
79
79
|
"tough-cookie": "^4.1.3",
|
|
80
80
|
"uuid": "^9.0.1",
|
|
81
81
|
"vitest": "^0.34.6"
|
|
@@ -1,6 +1,99 @@
|
|
|
1
1
|
/* eslint @typescript-eslint/no-explicit-any: 0, @typescript-eslint/no-unused-vars: 0 */ // --> OFF
|
|
2
2
|
// https://www.influxdata.com/blog/tldr-influxdb-tech-tips-multiple-aggregations-yield-flux/
|
|
3
3
|
// https://www.influxdata.com/blog/top-5-hurdles-for-intermediate-flux-users-and-resources-for-optimizing-flux/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
option task = {name: "task-sts-agent-stats", every: 1s}
|
|
7
|
+
|
|
8
|
+
data =
|
|
9
|
+
from(bucket: "TestBucket01")
|
|
10
|
+
|> range(start: -5s)
|
|
11
|
+
|> last()
|
|
12
|
+
|> filter(fn: (r) => r["_measurement"] == "agent")
|
|
13
|
+
|
|
14
|
+
r1 =
|
|
15
|
+
data
|
|
16
|
+
|> filter(fn: (r) => r["_field"] == "requestCount"
|
|
17
|
+
or r["_field"] == "errorCount"
|
|
18
|
+
or r["_field"] == "retryCount"
|
|
19
|
+
or r["_field"] == "authenticationCount"
|
|
20
|
+
or r["_field"] == "activeRequestCount"
|
|
21
|
+
or r["_field"] == "coreCount"
|
|
22
|
+
or r["_field"] == "velocity"
|
|
23
|
+
or r["_field"] == "childCount"
|
|
24
|
+
or r["_field"] == "timer")
|
|
25
|
+
|
|
26
|
+
r2 =
|
|
27
|
+
data
|
|
28
|
+
|> filter(fn: (r) => float(v: r["_value"]) > 0.0 and (r["_field"] == "duration"
|
|
29
|
+
or r["_field"] == "latency"))
|
|
30
|
+
|
|
31
|
+
byagentthreadasyncunnersum =
|
|
32
|
+
r1
|
|
33
|
+
|> group(columns: ["agentName", "threadId", "asyncRunnerId", "_field"])
|
|
34
|
+
|> sum()
|
|
35
|
+
|> toFloat()
|
|
36
|
+
|
|
37
|
+
byagentthreadasyncunnermean =
|
|
38
|
+
r2
|
|
39
|
+
|> group(columns: ["agentName", "threadId", "asyncRunnerId", "_field"])
|
|
40
|
+
|> mean()
|
|
41
|
+
|> toFloat()
|
|
42
|
+
|
|
43
|
+
union(tables: [byagentthreadasyncunnersum, byagentthreadasyncunnermean])
|
|
44
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-agentthreadasyncunner"}))
|
|
45
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
46
|
+
|
|
47
|
+
byagentthreadsum =
|
|
48
|
+
r1
|
|
49
|
+
|> group(columns: ["agentName", "threadId", "_field"])
|
|
50
|
+
|> sum()
|
|
51
|
+
|> toFloat()
|
|
52
|
+
|
|
53
|
+
byagentthreadmean =
|
|
54
|
+
r2
|
|
55
|
+
|> group(columns: ["agentName", "threadId", "_field"])
|
|
56
|
+
|> mean()
|
|
57
|
+
|> toFloat()
|
|
58
|
+
|
|
59
|
+
union(tables: [byagentthreadsum, byagentthreadmean])
|
|
60
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-agentthread"}))
|
|
61
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
62
|
+
|
|
63
|
+
byagentsum =
|
|
64
|
+
r1
|
|
65
|
+
|> group(columns: ["agentName", "_field"])
|
|
66
|
+
|> sum()
|
|
67
|
+
|> toFloat()
|
|
68
|
+
|
|
69
|
+
byagentmean =
|
|
70
|
+
r2
|
|
71
|
+
|> group(columns: ["agentName", "_field"])
|
|
72
|
+
|> mean()
|
|
73
|
+
|> toFloat()
|
|
74
|
+
|
|
75
|
+
union(tables: [byagentsum, byagentmean])
|
|
76
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-agent"}))
|
|
77
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
78
|
+
|
|
79
|
+
globalagentsum =
|
|
80
|
+
r1
|
|
81
|
+
|> group(columns: ["_field"])
|
|
82
|
+
|> sum()
|
|
83
|
+
|> toFloat()
|
|
84
|
+
|
|
85
|
+
globalagentmean =
|
|
86
|
+
r2
|
|
87
|
+
|> group(columns: ["_field"])
|
|
88
|
+
|> mean()
|
|
89
|
+
|> toFloat()
|
|
90
|
+
|
|
91
|
+
union(tables: [globalagentsum, globalagentmean])
|
|
92
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-globalagent"}))
|
|
93
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
94
|
+
|
|
95
|
+
*/
|
|
96
|
+
|
|
4
97
|
import { Point, WriteApi, QueryApi } from '@influxdata/influxdb-client'
|
|
5
98
|
|
|
6
99
|
import { Gauge, InstrumentVelocity } from '@nsshunt/stsinstrumentation'
|
|
@@ -10,6 +103,11 @@ import { InfluxDBManagerBase } from './influxDBManagerBase'
|
|
|
10
103
|
import { IInfluxDBManagerOptions, InstrumentPayload } from './../commonTypes'
|
|
11
104
|
import { ISubscriptionPayload, ISubscriptionKey } from '@nsshunt/stssocketio-client'
|
|
12
105
|
|
|
106
|
+
const AGENT_STATS_BY_AGENT_THREAD_ASYNCRUNNER = "sts-stats-by-agentthreadasyncunner";
|
|
107
|
+
const AGENT_STATS_BY_AGENT_THREAD = "sts-stats-by-agentthread";
|
|
108
|
+
const AGENT_STATS_BY_AGENT = "sts-stats-by-agent";
|
|
109
|
+
const AGENT_STATS_GLOBALAGENT = "sts-stats-globalagent";
|
|
110
|
+
|
|
13
111
|
const _logPrefix = 'InfluxDBManagerService:'
|
|
14
112
|
|
|
15
113
|
export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
@@ -25,60 +123,12 @@ export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
|
25
123
|
// Queries --------------------------------------------------------------------------------------------------------
|
|
26
124
|
|
|
27
125
|
// Counter metrics
|
|
28
|
-
#GetSTSCountGenericAgent = async (
|
|
126
|
+
#GetSTSCountGenericAgent = async (measurement: string, filterClause: string, showOutput: boolean = false) => {
|
|
29
127
|
try {
|
|
30
128
|
const query = `from(bucket: "${this.options.bucket}")
|
|
31
129
|
|> range(start: -5s)
|
|
32
130
|
|> last()
|
|
33
|
-
|> filter(fn: (r) => r["_measurement"] == "
|
|
34
|
-
or r["_field"] == "retryCount"
|
|
35
|
-
or r["_field"] == "authenticationCount"
|
|
36
|
-
or r["_field"] == "velocity"
|
|
37
|
-
or r["_field"] == "coreCount"
|
|
38
|
-
or r["_field"] == "timer"
|
|
39
|
-
or r["_field"] == "duration"
|
|
40
|
-
or r["_field"] == "latency"
|
|
41
|
-
or r["_field"] == "activeRequestCount"
|
|
42
|
-
or r["_field"] == "childCount") ${filterClause})
|
|
43
|
-
|> ${groupClause}
|
|
44
|
-
|> sum()`;
|
|
45
|
-
|
|
46
|
-
if (showOutput) {
|
|
47
|
-
console.log(query);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return this.queryApi.collectRows(query)
|
|
51
|
-
} catch (error) {
|
|
52
|
-
console.error(`${_logPrefix}#GetSTSCountGeneric: Error: [${error}]`.red);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
#GetSTSCountGenericAgentOld = async (filterClause: string, groupClause: string, showOutput: boolean = false) => {
|
|
57
|
-
try {
|
|
58
|
-
const query = `dostscountex = (q, d) =>
|
|
59
|
-
from(bucket: "${this.options.bucket}")
|
|
60
|
-
|> range(start: d)
|
|
61
|
-
|> filter(fn: (r) => r["_measurement"] == "agent" ${filterClause})
|
|
62
|
-
|> filter(fn: (r) => r["_field"] == q)
|
|
63
|
-
|> last()
|
|
64
|
-
|> ${groupClause}
|
|
65
|
-
|> sum()
|
|
66
|
-
|
|
67
|
-
dostscount = (d) =>
|
|
68
|
-
union(tables: [
|
|
69
|
-
dostscountex(q: "requestCount", d: d),
|
|
70
|
-
dostscountex(q: "errorCount", d: d),
|
|
71
|
-
dostscountex(q: "retryCount", d: d),
|
|
72
|
-
dostscountex(q: "authenticationCount", d: d),
|
|
73
|
-
dostscountex(q: "velocity", d: d),
|
|
74
|
-
dostscountex(q: "coreCount", d: d),
|
|
75
|
-
dostscountex(q: "timer", d: d),
|
|
76
|
-
dostscountex(q: "duration", d: d),
|
|
77
|
-
dostscountex(q: "latency", d: d),
|
|
78
|
-
dostscountex(q: "activeRequestCount", d: d),
|
|
79
|
-
dostscountex(q: "childCount", d: d)
|
|
80
|
-
])
|
|
81
|
-
dostscount(d: -5s)`;
|
|
131
|
+
|> filter(fn: (r) => r["_measurement"] == "${measurement}" ${filterClause})`;
|
|
82
132
|
|
|
83
133
|
if (showOutput) {
|
|
84
134
|
console.log(query);
|
|
@@ -91,14 +141,13 @@ export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
|
91
141
|
}
|
|
92
142
|
|
|
93
143
|
// Histo metrics
|
|
94
|
-
#GetSTSHistoGenericService = async (
|
|
144
|
+
#GetSTSHistoGenericService = async (measurement: string, filterClause: string): Promise<any> => {
|
|
95
145
|
try {
|
|
96
146
|
const query = `import "math"
|
|
97
147
|
from(bucket: "${this.options.bucket}")
|
|
98
148
|
|> range(start: -10m)
|
|
99
|
-
|> filter(fn: (r) => r["_measurement"] == "
|
|
149
|
+
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] =="latency"
|
|
100
150
|
or r["_field"] =="duration") ${filterClause})
|
|
101
|
-
|> ${groupClause}
|
|
102
151
|
|> histogram(bins: [0.0, 10.0, 20.0, 50.0, 100.0, 1000.0, 50000.0, math.mInf(sign: 1) ])
|
|
103
152
|
|> difference()`;
|
|
104
153
|
return this.queryApi.collectRows(query)
|
|
@@ -107,40 +156,13 @@ export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
|
107
156
|
}
|
|
108
157
|
}
|
|
109
158
|
|
|
110
|
-
#GetSTSHistoGenericServiceOld = async (filterClause: string, groupClause: string): Promise<any> => {
|
|
111
|
-
try {
|
|
112
|
-
const query = `import "math"
|
|
113
|
-
|
|
114
|
-
dostshistoex = (q, d) =>
|
|
115
|
-
from(bucket: "${this.options.bucket}")
|
|
116
|
-
|> range(start: d)
|
|
117
|
-
|> filter(fn: (r) => r["_measurement"] == "agent")
|
|
118
|
-
|> filter(fn: (r) => r["_field"] == q ${filterClause})
|
|
119
|
-
|> ${groupClause}
|
|
120
|
-
|> histogram(bins: [0.0, 10.0, 20.0, 50.0, 100.0, 1000.0, 50000.0, math.mInf(sign: 1) ])
|
|
121
|
-
|> difference()
|
|
122
|
-
|
|
123
|
-
dostshisto = (d) =>
|
|
124
|
-
union(tables: [
|
|
125
|
-
dostshistoex(q: "latency", d: d),
|
|
126
|
-
dostshistoex(q: "duration", d: d)
|
|
127
|
-
])
|
|
128
|
-
|
|
129
|
-
dostshisto(d: -10m)`;
|
|
130
|
-
return this.queryApi.collectRows(query)
|
|
131
|
-
} catch (error) {
|
|
132
|
-
console.error(`${_logPrefix}#GetSTSHistoGeneric: Error: [${error}]`.red);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
159
|
// Quantile metrics
|
|
137
|
-
#GetSTSQuantileGenericAgent = async (
|
|
160
|
+
#GetSTSQuantileGenericAgent = async (measurement: string, filterClause: string) => {
|
|
138
161
|
try {
|
|
139
162
|
const query = `data = from(bucket: "${this.options.bucket}")
|
|
140
163
|
|> range(start: -10m)
|
|
141
|
-
|> filter(fn: (r) => r["_measurement"] == "
|
|
164
|
+
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] == "latency"
|
|
142
165
|
or r["_field"] == "duration") ${filterClause})
|
|
143
|
-
|> ${groupClause}
|
|
144
166
|
|> aggregateWindow(every: 5s, fn: max, createEmpty: false)
|
|
145
167
|
|
|
146
168
|
dostsquantileex = (q) =>
|
|
@@ -163,48 +185,15 @@ export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
|
163
185
|
}
|
|
164
186
|
}
|
|
165
187
|
|
|
166
|
-
#GetSTSQuantileGenericAgentOld = async (filterClause: string, groupClause: string) => {
|
|
167
|
-
try {
|
|
168
|
-
const query = `dostsquantileex = (q, d, i, f) =>
|
|
169
|
-
from(bucket: "${this.options.bucket}")
|
|
170
|
-
|> range(start: d)
|
|
171
|
-
|> filter(fn: (r) => r["_measurement"] == "agent")
|
|
172
|
-
|> filter(fn: (r) => r["_field"] == f ${filterClause})
|
|
173
|
-
|> ${groupClause}
|
|
174
|
-
|> aggregateWindow(every: i, fn: max, createEmpty: false)
|
|
175
|
-
|> quantile(q: q, method: "estimate_tdigest", compression: 1000.0)
|
|
176
|
-
|> set(key: "quantile", value: string(v:q))
|
|
177
|
-
|> group(columns: ["LatencyType","quantile"])
|
|
178
|
-
|
|
179
|
-
dostsquantile = (d, i, f) =>
|
|
180
|
-
union(tables: [
|
|
181
|
-
dostsquantileex(q: 0.5, d: d, i: i, f: f),
|
|
182
|
-
dostsquantileex(q: 0.8, d: d, i: i, f: f),
|
|
183
|
-
dostsquantileex(q: 0.9, d: d, i: i, f: f),
|
|
184
|
-
dostsquantileex(q: 0.95, d: d, i: i, f: f),
|
|
185
|
-
dostsquantileex(q: 0.99, d: d, i: i, f: f)
|
|
186
|
-
])
|
|
187
|
-
|
|
188
|
-
union(tables: [
|
|
189
|
-
dostsquantile(d: -10m, i: 5s, f: "latency"),
|
|
190
|
-
dostsquantile(d: -10m, i: 5s, f: "duration")
|
|
191
|
-
])`;
|
|
192
|
-
|
|
193
|
-
return this.queryApi.collectRows(query)
|
|
194
|
-
} catch (error) {
|
|
195
|
-
console.error(`${_logPrefix}#GetSTSQuantileGeneric: Error: [${error}]`.red);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
188
|
// Metric queries -------------------------------------------------------------------------------------------------
|
|
200
189
|
// Root level metrics
|
|
201
190
|
async GetInfluxDBResultsRootAgent(subscriptionKey: ISubscriptionKey): Promise<ISubscriptionPayload> { // ISubscriptionPayload
|
|
202
191
|
let retVal = null;
|
|
203
192
|
try {
|
|
204
193
|
retVal = await this.ProcessInfluxDBResults([
|
|
205
|
-
this.#GetSTSCountGenericAgent(
|
|
206
|
-
this.#GetSTSQuantileGenericAgent(
|
|
207
|
-
this.#GetSTSHistoGenericService(
|
|
194
|
+
this.#GetSTSCountGenericAgent(AGENT_STATS_GLOBALAGENT, ''),
|
|
195
|
+
this.#GetSTSQuantileGenericAgent(AGENT_STATS_GLOBALAGENT, ''),
|
|
196
|
+
this.#GetSTSHistoGenericService(AGENT_STATS_GLOBALAGENT, '')],
|
|
208
197
|
[ ])
|
|
209
198
|
} catch (error) {
|
|
210
199
|
console.error(`${_logPrefix}GetInfluxDBResultsRootAgent: Error: [${error}]`.red);
|
|
@@ -220,9 +209,9 @@ export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
|
220
209
|
let retVal = null;
|
|
221
210
|
try {
|
|
222
211
|
retVal = await this.ProcessInfluxDBResults([
|
|
223
|
-
this.#GetSTSCountGenericAgent(
|
|
224
|
-
this.#GetSTSQuantileGenericAgent(
|
|
225
|
-
this.#GetSTSHistoGenericService(
|
|
212
|
+
this.#GetSTSCountGenericAgent(AGENT_STATS_BY_AGENT, ''),
|
|
213
|
+
this.#GetSTSQuantileGenericAgent(AGENT_STATS_BY_AGENT, ''),
|
|
214
|
+
this.#GetSTSHistoGenericService(AGENT_STATS_BY_AGENT, '')],
|
|
226
215
|
['agentName'])
|
|
227
216
|
} catch (error) {
|
|
228
217
|
console.error(`${_logPrefix}GetInfluxDBResultsAgent: Error: [${error}]`.red);
|
|
@@ -239,9 +228,9 @@ export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
|
239
228
|
try {
|
|
240
229
|
const agentName = subscriptionKey.key as string;
|
|
241
230
|
retVal = await this.ProcessInfluxDBResults([
|
|
242
|
-
this.#GetSTSCountGenericAgent(`and r["agentName"] == "${agentName}"
|
|
243
|
-
this.#GetSTSQuantileGenericAgent(`and r["agentName"] == "${agentName}"
|
|
244
|
-
this.#GetSTSHistoGenericService(`and r["agentName"] == "${agentName}"
|
|
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}"`)],
|
|
245
234
|
['agentName', 'threadId'])
|
|
246
235
|
} catch (error) {
|
|
247
236
|
console.error(`${_logPrefix}GetInfluxDBResultsAgentThreads: Error: [${error}]`.red);
|
|
@@ -259,9 +248,9 @@ export class InfluxDBManagerAgent extends InfluxDBManagerBase
|
|
|
259
248
|
const agentName = subscriptionKey.key as string;
|
|
260
249
|
const threadId = subscriptionKey.subkey as string;
|
|
261
250
|
retVal = await this.ProcessInfluxDBResults([
|
|
262
|
-
this.#GetSTSCountGenericAgent(`and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"
|
|
263
|
-
this.#GetSTSQuantileGenericAgent(`and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"
|
|
264
|
-
this.#GetSTSHistoGenericService(`and r["agentName"] == "${agentName}" and r["threadId"] == "${threadId}"
|
|
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}"`)],
|
|
265
254
|
['agentName', 'threadId', 'asyncRunnerId'])
|
|
266
255
|
} catch (error) {
|
|
267
256
|
console.error(`${_logPrefix}GetInfluxDBResultsAgentThread: Error: [${error}]`.red);
|
|
@@ -1,6 +1,113 @@
|
|
|
1
1
|
/* eslint @typescript-eslint/no-explicit-any: 0, @typescript-eslint/no-unused-vars: 0 */ // --> OFF
|
|
2
2
|
// https://www.influxdata.com/blog/tldr-influxdb-tech-tips-multiple-aggregations-yield-flux/
|
|
3
3
|
// https://www.influxdata.com/blog/top-5-hurdles-for-intermediate-flux-users-and-resources-for-optimizing-flux/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
option task = {
|
|
7
|
+
name: "task-sts-service-stats",
|
|
8
|
+
every: 1s,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
data =
|
|
12
|
+
from(bucket: "TestBucket01")
|
|
13
|
+
|> range(start: -5s)
|
|
14
|
+
|> last()
|
|
15
|
+
|> filter(fn: (r) => r["_measurement"] == "service" and r["_field"] != "memory")
|
|
16
|
+
|
|
17
|
+
r1 =
|
|
18
|
+
data
|
|
19
|
+
|> filter(
|
|
20
|
+
fn: (r) =>
|
|
21
|
+
r["_field"] == "requestCount" or r["_field"] == "errorCount" or r["_field"]
|
|
22
|
+
==
|
|
23
|
+
"retryCount" or r["_field"] == "authenticationCount" or r["_field"]
|
|
24
|
+
==
|
|
25
|
+
"activeRequestCount" or r["_field"] == "connectionCount" or r["_field"]
|
|
26
|
+
==
|
|
27
|
+
"connectionPoolCount" or r["_field"] == "connectionIdleCount" or r["_field"]
|
|
28
|
+
==
|
|
29
|
+
"connectionWaitingCount" or r["_field"] == "coreCount" or r["_field"] == "cpu"
|
|
30
|
+
or
|
|
31
|
+
r["_field"] == "systemcpu" or r["_field"] == "velocity" or r["_field"]
|
|
32
|
+
==
|
|
33
|
+
"timer",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
r2 =
|
|
37
|
+
data
|
|
38
|
+
|> filter(
|
|
39
|
+
fn: (r) =>
|
|
40
|
+
float(v: r["_value"]) > 0.0 and (r["_field"] == "duration" or r["_field"]
|
|
41
|
+
==
|
|
42
|
+
"latency"),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
serviceInstanceProcessSum =
|
|
46
|
+
r1
|
|
47
|
+
|> group(columns: ["serviceId", "serviceInstanceId", "serviceInstanceProcessId", "_field"])
|
|
48
|
+
|> sum()
|
|
49
|
+
|> toFloat()
|
|
50
|
+
|
|
51
|
+
serviceInstanceProcessMean =
|
|
52
|
+
r2
|
|
53
|
+
|> group(columns: ["serviceId", "serviceInstanceId", "serviceInstanceProcessId", "_field"])
|
|
54
|
+
|> mean()
|
|
55
|
+
|> toFloat()
|
|
56
|
+
|
|
57
|
+
union(tables: [serviceInstanceProcessSum, serviceInstanceProcessMean])
|
|
58
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-serviceinstanceprocess"}))
|
|
59
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
60
|
+
|
|
61
|
+
serviceInstanceSum =
|
|
62
|
+
r1
|
|
63
|
+
|> group(columns: ["serviceId", "serviceInstanceId", "_field"])
|
|
64
|
+
|> sum()
|
|
65
|
+
|> toFloat()
|
|
66
|
+
|
|
67
|
+
serviceInstanceMean =
|
|
68
|
+
r2
|
|
69
|
+
|> group(columns: ["serviceId", "serviceInstanceId", "_field"])
|
|
70
|
+
|> mean()
|
|
71
|
+
|> toFloat()
|
|
72
|
+
|
|
73
|
+
union(tables: [serviceInstanceSum, serviceInstanceMean])
|
|
74
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-serviceinstance"}))
|
|
75
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
76
|
+
|
|
77
|
+
serviceSum =
|
|
78
|
+
r1
|
|
79
|
+
|> group(columns: ["serviceId", "_field"])
|
|
80
|
+
|> sum()
|
|
81
|
+
|> toFloat()
|
|
82
|
+
|
|
83
|
+
serviceMean =
|
|
84
|
+
r2
|
|
85
|
+
|> group(columns: ["serviceId", "_field"])
|
|
86
|
+
|> mean()
|
|
87
|
+
|> toFloat()
|
|
88
|
+
|
|
89
|
+
union(tables: [serviceSum, serviceMean])
|
|
90
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-by-service"}))
|
|
91
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
92
|
+
|
|
93
|
+
globalServiceSum =
|
|
94
|
+
r1
|
|
95
|
+
|> group(columns: ["_field"])
|
|
96
|
+
|> sum()
|
|
97
|
+
|> toFloat()
|
|
98
|
+
|
|
99
|
+
globalServiceMean =
|
|
100
|
+
r2
|
|
101
|
+
|> group(columns: ["_field"])
|
|
102
|
+
|> mean()
|
|
103
|
+
|> toFloat()
|
|
104
|
+
|
|
105
|
+
union(tables: [globalServiceSum, globalServiceMean])
|
|
106
|
+
|> map(fn: (r) => ({r with _time: now(), _measurement: "sts-stats-globalservice"}))
|
|
107
|
+
|> to(org: "my-org", bucket: "TestBucket01")
|
|
108
|
+
|
|
109
|
+
*/
|
|
110
|
+
|
|
4
111
|
import { Point, WriteApi, QueryApi } from '@influxdata/influxdb-client'
|
|
5
112
|
|
|
6
113
|
import { Gauge, InstrumentVelocity } from '@nsshunt/stsinstrumentation'
|
|
@@ -200,7 +307,7 @@ data
|
|
|
200
307
|
#GetSTSHistoGenericService = async (measurement: string, filterClause: string, groupClause: string): Promise<any> => {
|
|
201
308
|
try {
|
|
202
309
|
const query = `import "math"
|
|
203
|
-
from(bucket: "
|
|
310
|
+
from(bucket: "${this.options.bucket}")
|
|
204
311
|
|> range(start: -10m)
|
|
205
312
|
|> filter(fn: (r) => r["_measurement"] == "${measurement}" and (r["_field"] =="latency" or
|
|
206
313
|
r["_field"] =="duration") ${filterClause})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerAgent.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerAgent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"influxDBManagerAgent.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerAgent.ts"],"names":[],"mappings":";AAgGA,OAAO,EAAS,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAIvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AASpF,qBAAa,oBAAqB,SAAQ,mBAAmB;;gBAE7C,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ;IAIvF,IAAa,SAAS,IAAI,MAAM,CAE/B;IAqEK,2BAA2B,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkB7F,uBAAuB,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkBzF,8BAA8B,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAmBhG,6BAA6B,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAsB/F,cAAc,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;CAsC/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"influxDBManagerService.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"influxDBManagerService.d.ts","sourceRoot":"","sources":["../../src/influxdb/influxDBManagerService.ts"],"names":[],"mappings":";AA8GA,OAAO,EAAS,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAIvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAgBpF,qBAAa,sBAAuB,SAAQ,mBAAmB;;gBAE/C,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ;IAIvF,IAAa,SAAS,IAAI,MAAM,CAE/B;IAkUK,6BAA6B,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAqB/F,yBAAyB,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAsB3F,kCAAkC,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAsBpG,iCAAiC,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAwBnG,cAAc,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;CAoD/E"}
|