@quenty/influxdbclient 7.19.4-canary.559.339cfa7.0 → 7.20.0-canary.0a5db80.0
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/CHANGELOG.md +3 -11
- package/package.json +13 -13
- package/src/Server/Config/InfluxDBClientConfigUtils.lua +3 -3
- package/src/Server/Config/InfluxDBWriteOptionUtils.lua +9 -9
- package/src/Server/InfluxDBClient.lua +1 -1
- package/src/Server/InfluxDBClient.story.lua +5 -6
- package/src/Server/Utils/InfluxDBErrorUtils.lua +4 -2
- package/src/Server/Write/InfluxDBWriteAPI.lua +7 -3
- package/src/Server/Write/InfluxDBWriteBuffer.lua +1 -1
- package/src/Shared/Utils/InfluxDBEscapeUtils.lua +18 -17
- package/src/Shared/Utils/InfluxDBEscapeUtils.spec.lua +4 -5
- package/src/Shared/Write/InfluxDBPoint.lua +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,25 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [7.20.0-canary.0a5db80.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/influxdbclient@7.19.2...@quenty/influxdbclient@7.20.0-canary.0a5db80.0) (2025-05-10)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
10
10
|
|
|
11
|
-
* Additional type checking updates ([
|
|
11
|
+
* Additional type checking updates ([7e008c5](https://github.com/Quenty/NevermoreEngine/commit/7e008c58547bd00b5904e56541454a38c8d72ccc))
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
### Features
|
|
15
15
|
|
|
16
|
-
* Add even more types ([
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [7.19.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/influxdbclient@7.19.2...@quenty/influxdbclient@7.19.3) (2025-04-10)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @quenty/influxdbclient
|
|
16
|
+
* Add even more types ([0a5db80](https://github.com/Quenty/NevermoreEngine/commit/0a5db8004684dc3e76fd5944599a22602d48cfa9))
|
|
25
17
|
|
|
26
18
|
|
|
27
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/influxdbclient",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.20.0-canary.0a5db80.0",
|
|
4
4
|
"description": "Provides a Roblox Lua InfluxDB client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/baseobject": "10.
|
|
29
|
-
"@quenty/httppromise": "10.
|
|
30
|
-
"@quenty/jsonutils": "10.
|
|
31
|
-
"@quenty/loader": "10.
|
|
32
|
-
"@quenty/maid": "3.
|
|
28
|
+
"@quenty/baseobject": "10.9.0-canary.0a5db80.0",
|
|
29
|
+
"@quenty/httppromise": "10.11.0-canary.0a5db80.0",
|
|
30
|
+
"@quenty/jsonutils": "10.11.0-canary.0a5db80.0",
|
|
31
|
+
"@quenty/loader": "10.9.0-canary.0a5db80.0",
|
|
32
|
+
"@quenty/maid": "3.5.0-canary.0a5db80.0",
|
|
33
33
|
"@quenty/math": "2.7.3",
|
|
34
|
-
"@quenty/promise": "10.
|
|
35
|
-
"@quenty/rx": "13.
|
|
36
|
-
"@quenty/servicebag": "11.
|
|
37
|
-
"@quenty/signal": "7.
|
|
34
|
+
"@quenty/promise": "10.11.0-canary.0a5db80.0",
|
|
35
|
+
"@quenty/rx": "13.18.0-canary.0a5db80.0",
|
|
36
|
+
"@quenty/servicebag": "11.12.0-canary.0a5db80.0",
|
|
37
|
+
"@quenty/signal": "7.11.0-canary.0a5db80.0",
|
|
38
38
|
"@quenty/string": "3.3.3",
|
|
39
|
-
"@quenty/table": "3.
|
|
40
|
-
"@quenty/valueobject": "13.
|
|
39
|
+
"@quenty/table": "3.8.0-canary.0a5db80.0",
|
|
40
|
+
"@quenty/valueobject": "13.18.0-canary.0a5db80.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "0a5db8004684dc3e76fd5944599a22602d48cfa9"
|
|
46
46
|
}
|
|
@@ -32,9 +32,9 @@ function InfluxDBClientConfigUtils.createClientConfig(config: InfluxDBClientConf
|
|
|
32
32
|
assert(InfluxDBClientConfigUtils.isClientConfig(config), "Bad config")
|
|
33
33
|
|
|
34
34
|
return {
|
|
35
|
-
url = config.url
|
|
36
|
-
token = config.token
|
|
35
|
+
url = config.url;
|
|
36
|
+
token = config.token;
|
|
37
37
|
}
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
return InfluxDBClientConfigUtils
|
|
40
|
+
return InfluxDBClientConfigUtils
|
|
@@ -42,14 +42,14 @@ function InfluxDBWriteOptionUtils.isWriteOptions(options: any): boolean
|
|
|
42
42
|
and type(options.batchSize) == "number"
|
|
43
43
|
and type(options.maxBatchBytes) == "number"
|
|
44
44
|
and type(options.flushIntervalSeconds) == "number"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
-- and type(options.maxRetries) == "number"
|
|
46
|
+
-- and type(options.maxRetryTimeSeconds) == "number"
|
|
47
|
+
-- and type(options.maxBufferLines) == "number"
|
|
48
|
+
-- and type(options.retryJitterSeconds) == "number"
|
|
49
|
+
-- and type(options.minRetryDelaySeconds) == "number"
|
|
50
|
+
-- and type(options.maxRetryDelaySeconds) == "number"
|
|
51
|
+
-- and type(options.exponentialBase) == "number"
|
|
52
|
+
-- and type(options.randomRetry) == "boolean"
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
return InfluxDBWriteOptionUtils
|
|
55
|
+
return InfluxDBWriteOptionUtils
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
@class InfluxDBClient.story
|
|
3
3
|
]]
|
|
4
4
|
|
|
5
|
-
local require =
|
|
6
|
-
require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
5
|
+
local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
7
6
|
|
|
8
7
|
local InfluxDBClient = require("InfluxDBClient")
|
|
9
8
|
local InfluxDBClientConfigUtils = require("InfluxDBClientConfigUtils")
|
|
@@ -14,8 +13,8 @@ return function(_target)
|
|
|
14
13
|
local maid = Maid.new()
|
|
15
14
|
|
|
16
15
|
local config = InfluxDBClientConfigUtils.createClientConfig({
|
|
17
|
-
url = "https://ingest.robloxanalytics.com/"
|
|
18
|
-
token = "test-api-key"
|
|
16
|
+
url = "https://ingest.robloxanalytics.com/";
|
|
17
|
+
token = "test-api-key";
|
|
19
18
|
})
|
|
20
19
|
|
|
21
20
|
local influxDBClient = InfluxDBClient.new(config)
|
|
@@ -34,7 +33,7 @@ return function(_target)
|
|
|
34
33
|
point:AddTag("place_id", tostring(game.PlaceId))
|
|
35
34
|
point:AddStringField("username", "Quenty")
|
|
36
35
|
point:AddIntField("userid", 4397833)
|
|
37
|
-
point:AddFloatField("fps", 30 + math.random()
|
|
36
|
+
point:AddFloatField("fps", 30 + math.random()*30)
|
|
38
37
|
point:AddBooleanField("is_alive", true)
|
|
39
38
|
point:AddBooleanField("is_silent", false)
|
|
40
39
|
|
|
@@ -49,4 +48,4 @@ return function(_target)
|
|
|
49
48
|
return function()
|
|
50
49
|
maid:DoCleaning()
|
|
51
50
|
end
|
|
52
|
-
end
|
|
51
|
+
end
|
|
@@ -48,7 +48,9 @@ end
|
|
|
48
48
|
@return boolean
|
|
49
49
|
]=]
|
|
50
50
|
function InfluxDBErrorUtils.isInfluxDBError(data: any): boolean
|
|
51
|
-
return type(data) == "table"
|
|
51
|
+
return type(data) == "table"
|
|
52
|
+
and type(data.code) == "string"
|
|
53
|
+
and type(data.message) == "string"
|
|
52
54
|
end
|
|
53
55
|
|
|
54
|
-
return InfluxDBErrorUtils
|
|
56
|
+
return InfluxDBErrorUtils
|
|
@@ -11,7 +11,6 @@ local require = require(script.Parent.loader).load(script)
|
|
|
11
11
|
local BaseObject = require("BaseObject")
|
|
12
12
|
local HttpPromise = require("HttpPromise")
|
|
13
13
|
local InfluxDBClientConfigUtils = require("InfluxDBClientConfigUtils")
|
|
14
|
-
local InfluxDBErrorUtils = require("InfluxDBErrorUtils")
|
|
15
14
|
local InfluxDBPoint = require("InfluxDBPoint")
|
|
16
15
|
local InfluxDBPointSettings = require("InfluxDBPointSettings")
|
|
17
16
|
local InfluxDBWriteBuffer = require("InfluxDBWriteBuffer")
|
|
@@ -19,6 +18,7 @@ local InfluxDBWriteOptionUtils = require("InfluxDBWriteOptionUtils")
|
|
|
19
18
|
local Promise = require("Promise")
|
|
20
19
|
local Signal = require("Signal")
|
|
21
20
|
local ValueObject = require("ValueObject")
|
|
21
|
+
local InfluxDBErrorUtils = require("InfluxDBErrorUtils")
|
|
22
22
|
|
|
23
23
|
local InfluxDBWriteAPI = setmetatable({}, BaseObject)
|
|
24
24
|
InfluxDBWriteAPI.ClassName = "InfluxDBWriteAPI"
|
|
@@ -254,7 +254,11 @@ function InfluxDBWriteAPI._getWriteUrl(self: InfluxDBWriteAPI): string
|
|
|
254
254
|
-- escape trailing slashes
|
|
255
255
|
url = string.match(url, "(.-)[\\/]*$") or ""
|
|
256
256
|
|
|
257
|
-
return string.format("%s/api/v2/write?org=%s&bucket=%s&precision=%s",
|
|
257
|
+
return string.format("%s/api/v2/write?org=%s&bucket=%s&precision=%s",
|
|
258
|
+
url,
|
|
259
|
+
self._org,
|
|
260
|
+
self._bucket,
|
|
261
|
+
self._precision)
|
|
258
262
|
end
|
|
259
263
|
|
|
260
|
-
return InfluxDBWriteAPI
|
|
264
|
+
return InfluxDBWriteAPI
|
|
@@ -62,32 +62,33 @@ function InfluxDBEscapeUtils.createQuotedEscaper(subTable: EscapeTable): (string
|
|
|
62
62
|
local escaper = InfluxDBEscapeUtils.createEscaper(subTable)
|
|
63
63
|
|
|
64
64
|
return function(str: string)
|
|
65
|
-
return string.format(
|
|
65
|
+
return string.format("\"%s\"", escaper(str))
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
+
|
|
69
70
|
InfluxDBEscapeUtils.measurement = InfluxDBEscapeUtils.createEscaper({
|
|
70
|
-
[","] = "\\,"
|
|
71
|
-
[" "] = "\\ "
|
|
72
|
-
["\n"] = "\\n"
|
|
73
|
-
["\r"] = "\\r"
|
|
74
|
-
["\t"] = "\\t"
|
|
75
|
-
["\\"] = "\\\\"
|
|
71
|
+
[","] = "\\,";
|
|
72
|
+
[" "] = "\\ ";
|
|
73
|
+
["\n"] = "\\n";
|
|
74
|
+
["\r"] = "\\r";
|
|
75
|
+
["\t"] = "\\t";
|
|
76
|
+
["\\"] = "\\\\"; -- not sure about this, is this part of spec?
|
|
76
77
|
})
|
|
77
78
|
|
|
78
79
|
InfluxDBEscapeUtils.quoted = InfluxDBEscapeUtils.createQuotedEscaper({
|
|
79
|
-
[
|
|
80
|
-
["\\"] = "\\\\"
|
|
80
|
+
["\""] = "\\\"";
|
|
81
|
+
["\\"] = "\\\\";
|
|
81
82
|
})
|
|
82
83
|
|
|
83
84
|
InfluxDBEscapeUtils.tag = InfluxDBEscapeUtils.createEscaper({
|
|
84
|
-
[","] = "\\,"
|
|
85
|
-
[" "] = "\\ "
|
|
86
|
-
["="] = "\\="
|
|
87
|
-
["\n"] = "\\n"
|
|
88
|
-
["\r"] = "\\r"
|
|
89
|
-
["\t"] = "\\t"
|
|
90
|
-
["\\"] = "\\\\"
|
|
85
|
+
[","] = "\\,";
|
|
86
|
+
[" "] = "\\ ";
|
|
87
|
+
["="] = "\\=";
|
|
88
|
+
["\n"] = "\\n";
|
|
89
|
+
["\r"] = "\\r";
|
|
90
|
+
["\t"] = "\\t";
|
|
91
|
+
["\\"] = "\\\\"; -- not sure about this, is this part of spec?
|
|
91
92
|
})
|
|
92
93
|
|
|
93
|
-
return InfluxDBEscapeUtils
|
|
94
|
+
return InfluxDBEscapeUtils
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
@class InfluxDBEscapeUtils.spec.lua
|
|
3
3
|
]]
|
|
4
4
|
|
|
5
|
-
local require =
|
|
6
|
-
require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
5
|
+
local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
7
6
|
|
|
8
7
|
local InfluxDBEscapeUtils = require("InfluxDBEscapeUtils")
|
|
9
8
|
local Jest = require("Jest")
|
|
@@ -26,11 +25,11 @@ end)
|
|
|
26
25
|
|
|
27
26
|
describe("InfluxDBEscapeUtils.quoted", function()
|
|
28
27
|
it("should pass through fine", function()
|
|
29
|
-
expect(InfluxDBEscapeUtils.quoted("hi")).toBe(
|
|
28
|
+
expect(InfluxDBEscapeUtils.quoted("hi")).toBe("\"hi\"")
|
|
30
29
|
end)
|
|
31
30
|
|
|
32
31
|
it("should escape quotes", function()
|
|
33
|
-
expect(InfluxDBEscapeUtils.quoted(
|
|
32
|
+
expect(InfluxDBEscapeUtils.quoted("\"hi")).toBe("\"\\\"hi\"")
|
|
34
33
|
end)
|
|
35
34
|
end)
|
|
36
35
|
|
|
@@ -59,4 +58,4 @@ describe("InfluxDBEscapeUtils.tag", function()
|
|
|
59
58
|
local tag = InfluxDBEscapeUtils.tag("\nhi")
|
|
60
59
|
expect(tag).toBe("\\nhi")
|
|
61
60
|
end)
|
|
62
|
-
end)
|
|
61
|
+
end)
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
|
-
local InfluxDBEscapeUtils = require("InfluxDBEscapeUtils")
|
|
9
|
-
local InfluxDBPointSettings = require("InfluxDBPointSettings")
|
|
10
8
|
local Math = require("Math")
|
|
11
|
-
local
|
|
9
|
+
local InfluxDBEscapeUtils = require("InfluxDBEscapeUtils")
|
|
12
10
|
local Table = require("Table")
|
|
11
|
+
local Set = require("Set")
|
|
12
|
+
local InfluxDBPointSettings = require("InfluxDBPointSettings")
|
|
13
13
|
|
|
14
14
|
local InfluxDBPoint = {}
|
|
15
15
|
InfluxDBPoint.ClassName = "InfluxDBPoint"
|
|
@@ -251,10 +251,7 @@ end
|
|
|
251
251
|
@param pointSettings InfluxDBPointSettings
|
|
252
252
|
@return string?
|
|
253
253
|
]=]
|
|
254
|
-
function InfluxDBPoint.ToLineProtocol(
|
|
255
|
-
self: InfluxDBPoint,
|
|
256
|
-
pointSettings: InfluxDBPointSettings.InfluxDBPointSettings
|
|
257
|
-
): string?
|
|
254
|
+
function InfluxDBPoint.ToLineProtocol(self: InfluxDBPoint, pointSettings: InfluxDBPointSettings.InfluxDBPointSettings): string?
|
|
258
255
|
if not self._measurementName then
|
|
259
256
|
return nil
|
|
260
257
|
end
|
|
@@ -317,7 +314,7 @@ end
|
|
|
317
314
|
|
|
318
315
|
function InfluxDBPoint._convertTimeToMillis(_self: InfluxDBPoint, value: (string | DateTime | number)?): string?
|
|
319
316
|
if value == nil then
|
|
320
|
-
|
|
317
|
+
return tostring(DateTime.now().UnixTimestampMillis)
|
|
321
318
|
elseif type(value) == "string" then
|
|
322
319
|
if #value > 0 then
|
|
323
320
|
return value
|
|
@@ -333,4 +330,4 @@ function InfluxDBPoint._convertTimeToMillis(_self: InfluxDBPoint, value: (string
|
|
|
333
330
|
end
|
|
334
331
|
end
|
|
335
332
|
|
|
336
|
-
return InfluxDBPoint
|
|
333
|
+
return InfluxDBPoint
|