bitfab 0.51.3 → 0.51.4
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.
- checksums.yaml +4 -4
- data/lib/bitfab/datasets.rb +23 -5
- data/lib/bitfab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b739123699ec796d304175df24d0ff07ffa098b95c31d878370a07c7b9cb34c6
|
|
4
|
+
data.tar.gz: 6895704bbaf7f045b704a2ac71a7502a5f5b205792abd80af1b9d4fa124879d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4b895369cabdcec196d957e92bc2cf13dfe972efa3342ffbb0bc705f7670050cf60a7f85c4132dd92b394c59c338acc41c7bbb5597cb1a8aa160f501a5d3895
|
|
7
|
+
data.tar.gz: 810b845093e98709f56162422a9e87e1de46180e91224a0a60c67abc2f04f39ef1a3add5ac8f31e374c656920dc95c2aec79f6731c8160e0af98884791cf5450
|
data/lib/bitfab/datasets.rb
CHANGED
|
@@ -25,10 +25,19 @@ module Bitfab
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
# List datasets, scoped to one trace function when given and
|
|
28
|
-
# organization-wide otherwise.
|
|
28
|
+
# organization-wide otherwise. Fetches all pages automatically.
|
|
29
29
|
def list(trace_function_key: nil)
|
|
30
|
-
query =
|
|
31
|
-
|
|
30
|
+
query = {"limit" => "100"}
|
|
31
|
+
query["traceFunctionKey"] = trace_function_key unless trace_function_key.nil?
|
|
32
|
+
datasets = []
|
|
33
|
+
loop do
|
|
34
|
+
result = @http_client.get("/api/sdk/datasets?#{URI.encode_www_form(query)}")
|
|
35
|
+
datasets.concat(result["datasets"])
|
|
36
|
+
cursor = result["nextCursor"]
|
|
37
|
+
return datasets if cursor.nil?
|
|
38
|
+
|
|
39
|
+
query["cursor"] = cursor
|
|
40
|
+
end
|
|
32
41
|
end
|
|
33
42
|
|
|
34
43
|
# Fetch one dataset by id. A dataset outside this organization raises
|
|
@@ -38,9 +47,18 @@ module Bitfab
|
|
|
38
47
|
end
|
|
39
48
|
|
|
40
49
|
# The ids of every trace in the dataset, the same membership a replay with
|
|
41
|
-
# dataset_id: selects.
|
|
50
|
+
# dataset_id: selects. Fetches all pages automatically.
|
|
42
51
|
def list_traces(dataset_id)
|
|
43
|
-
|
|
52
|
+
trace_ids = []
|
|
53
|
+
query = {"limit" => "100"}
|
|
54
|
+
loop do
|
|
55
|
+
page = @http_client.get("#{dataset_path(dataset_id, "/traces")}?#{URI.encode_www_form(query)}")
|
|
56
|
+
trace_ids.concat(page["traceIds"])
|
|
57
|
+
cursor = page["nextCursor"]
|
|
58
|
+
return {"datasetId" => page["datasetId"], "traceIds" => trace_ids} if cursor.nil?
|
|
59
|
+
|
|
60
|
+
query["cursor"] = cursor
|
|
61
|
+
end
|
|
44
62
|
end
|
|
45
63
|
|
|
46
64
|
# Add traces to the dataset (1 to 100 ids per call). Traces outside the
|
data/lib/bitfab/version.rb
CHANGED