quasardb 3.14.2.dev4__cp38-cp38-win_amd64.whl → 3.14.2.dev6__cp38-cp38-win_amd64.whl
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.
Potentially problematic release.
This version of quasardb might be problematic. Click here for more details.
- quasardb/INSTALL.vcxproj +5 -5
- quasardb/__init__.py +21 -7
- quasardb/date/ALL_BUILD.vcxproj +9 -9
- quasardb/date/CMakeFiles/Export/df49adab93b9e0c10c64f72458b31971/dateTargets.cmake +1 -1
- quasardb/date/CMakeFiles/generate.stamp.depend +4 -4
- quasardb/date/INSTALL.vcxproj +5 -5
- quasardb/date/dateTargets.cmake +1 -1
- quasardb/extensions/writer.py +59 -61
- quasardb/firehose.py +24 -22
- quasardb/numpy/__init__.py +262 -128
- quasardb/pandas/__init__.py +145 -91
- quasardb/pool.py +13 -2
- quasardb/pybind11/ALL_BUILD.vcxproj +9 -9
- quasardb/pybind11/CMakeFiles/generate.stamp.depend +14 -14
- quasardb/pybind11/INSTALL.vcxproj +5 -5
- quasardb/qdb_api.dll +0 -0
- quasardb/quasardb.cp38-win_amd64.pyd +0 -0
- quasardb/range-v3/ALL_BUILD.vcxproj +9 -9
- quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake +1 -1
- quasardb/range-v3/CMakeFiles/generate.stamp.depend +11 -11
- quasardb/range-v3/INSTALL.vcxproj +5 -5
- quasardb/range-v3/range-v3-config.cmake +1 -1
- quasardb/range-v3/range.v3.headers.vcxproj +9 -9
- quasardb/stats.py +245 -120
- quasardb/table_cache.py +5 -1
- {quasardb-3.14.2.dev4.dist-info → quasardb-3.14.2.dev6.dist-info}/METADATA +1 -1
- quasardb-3.14.2.dev6.dist-info/RECORD +54 -0
- {quasardb-3.14.2.dev4.dist-info → quasardb-3.14.2.dev6.dist-info}/WHEEL +1 -1
- quasardb-3.14.2.dev4.dist-info/RECORD +0 -54
- {quasardb-3.14.2.dev4.dist-info → quasardb-3.14.2.dev6.dist-info}/LICENSE.md +0 -0
- {quasardb-3.14.2.dev4.dist-info → quasardb-3.14.2.dev6.dist-info}/top_level.txt +0 -0
quasardb/stats.py
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import re
|
|
2
|
+
|
|
2
3
|
import quasardb
|
|
3
4
|
import logging
|
|
5
|
+
from collections import defaultdict
|
|
4
6
|
from datetime import datetime
|
|
7
|
+
from enum import Enum
|
|
5
8
|
|
|
6
|
-
logger = logging.getLogger(
|
|
9
|
+
logger = logging.getLogger("quasardb.stats")
|
|
7
10
|
|
|
11
|
+
MAX_KEYS = 4 * 1024 * 1024 # 4 million max keys
|
|
12
|
+
stats_prefix = "$qdb.statistics."
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
user_pattern = re.compile(r
|
|
11
|
-
total_pattern = re.compile(r
|
|
14
|
+
# Compile these regexes once for speed
|
|
15
|
+
user_pattern = re.compile(r"\$qdb.statistics.(.*).uid_([0-9]+)$")
|
|
16
|
+
total_pattern = re.compile(r"\$qdb.statistics.(.*)$")
|
|
17
|
+
user_clean_pattern = re.compile(r"\.uid_\d+")
|
|
12
18
|
|
|
13
19
|
|
|
14
20
|
def is_user_stat(s):
|
|
@@ -50,91 +56,36 @@ def of_node(dconn):
|
|
|
50
56
|
"""
|
|
51
57
|
|
|
52
58
|
start = datetime.now()
|
|
53
|
-
raw = {
|
|
54
|
-
k: _get_stat(dconn,k) for k in dconn.prefix_get(stats_prefix, 1000)}
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
ks = _get_all_keys(dconn)
|
|
61
|
+
idx = _index_keys(dconn, ks)
|
|
62
|
+
raw = {k: _get_stat_value(dconn, k) for k in ks}
|
|
63
|
+
|
|
64
|
+
ret = {"by_uid": _by_uid(raw, idx), "cumulative": _cumulative(raw, idx)}
|
|
58
65
|
|
|
59
66
|
check_duration = datetime.now() - start
|
|
60
67
|
|
|
61
|
-
ret[
|
|
62
|
-
|
|
68
|
+
ret["cumulative"]["check.online"] = {
|
|
69
|
+
"value": 1,
|
|
70
|
+
"type": Type.ACCUMULATOR,
|
|
71
|
+
"unit": Unit.NONE,
|
|
72
|
+
}
|
|
73
|
+
ret["cumulative"]["check.duration_ms"] = {
|
|
74
|
+
"value": int(check_duration.total_seconds() * 1000),
|
|
75
|
+
"type": Type.ACCUMULATOR,
|
|
76
|
+
"unit": Unit.MILLISECONDS,
|
|
77
|
+
}
|
|
63
78
|
|
|
64
79
|
return ret
|
|
65
80
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
'startup_time': ('constant', None),
|
|
75
|
-
'shutdown_time': ('constant', None),
|
|
76
|
-
|
|
77
|
-
'network.current_users_count': ('gauge', 'count'),
|
|
78
|
-
'hardware_concurrency': ('gauge', 'count'),
|
|
79
|
-
|
|
80
|
-
'check.online': ('gauge', 'count'),
|
|
81
|
-
'check.duration_ms': ('constant', 'ms'),
|
|
82
|
-
|
|
83
|
-
'requests.bytes_in': ('counter', 'bytes'),
|
|
84
|
-
'requests.bytes_out': ('counter', 'bytes'),
|
|
85
|
-
'requests.errors_count': ('counter', 'count'),
|
|
86
|
-
'requests.successes_count': ('counter', 'count'),
|
|
87
|
-
'requests.total_count': ('counter', 'count'),
|
|
88
|
-
|
|
89
|
-
'async_pipelines.merge.bucket_count': ('counter', 'count'),
|
|
90
|
-
'async_pipelines.merge.duration_us': ('counter', 'us'),
|
|
91
|
-
'async_pipelines.write.successes_count': ('counter', 'count'),
|
|
92
|
-
'async_pipelines.write.failures_count': ('counter', 'count'),
|
|
93
|
-
'async_pipelines.write.time_us': ('counter', 'us'),
|
|
94
|
-
|
|
95
|
-
'async_pipelines.merge.max_bucket_count': ('gauge', 'count'),
|
|
96
|
-
'async_pipelines.merge.max_depth_count': ('gauge', 'count'),
|
|
97
|
-
'async_pipelines.merge.requests_count': ('counter', 'count'),
|
|
98
|
-
|
|
99
|
-
'evicted.count': ('counter', 'count'),
|
|
100
|
-
'pageins.count': ('counter', 'count'),
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
async_pipeline_bytes_pattern = re.compile(r'async_pipelines.pipe_[0-9]+.merge_map.bytes')
|
|
105
|
-
async_pipeline_count_pattern = re.compile(r'async_pipelines.pipe_[0-9]+.merge_map.count')
|
|
106
|
-
|
|
107
|
-
def _stat_type(stat_id):
|
|
108
|
-
if stat_id in _stat_types:
|
|
109
|
-
return _stat_types[stat_id]
|
|
110
|
-
elif stat_id.endswith('total_ns'):
|
|
111
|
-
return ('counter', 'ns')
|
|
112
|
-
elif stat_id.endswith('total_bytes'):
|
|
113
|
-
return ('counter', 'bytes')
|
|
114
|
-
elif stat_id.endswith('read_bytes'):
|
|
115
|
-
return ('counter', 'bytes')
|
|
116
|
-
elif stat_id.endswith('written_bytes'):
|
|
117
|
-
return ('counter', 'bytes')
|
|
118
|
-
elif stat_id.endswith('total_count'):
|
|
119
|
-
return ('counter', 'count')
|
|
120
|
-
elif stat_id.startswith('network.sessions.'):
|
|
121
|
-
return ('gauge', 'count')
|
|
122
|
-
elif stat_id.startswith('memory.'):
|
|
123
|
-
# memory statistics are all gauges i think, describes how much memory currently allocated where
|
|
124
|
-
return ('gauge', 'bytes')
|
|
125
|
-
elif stat_id.startswith('persistence.') or stat_id.startswith('disk'):
|
|
126
|
-
# persistence are also all gauges, describes mostly how much is currently available/used on storage
|
|
127
|
-
return ('gauge', 'bytes')
|
|
128
|
-
elif stat_id.startswith('license.'):
|
|
129
|
-
return ('gauge', None)
|
|
130
|
-
elif stat_id.startswith('engine_'):
|
|
131
|
-
return ('constant', None)
|
|
132
|
-
elif async_pipeline_bytes_pattern.match(stat_id):
|
|
133
|
-
return ('gauge', 'bytes')
|
|
134
|
-
elif async_pipeline_count_pattern.match(stat_id):
|
|
135
|
-
return ('gauge', 'count')
|
|
136
|
-
else:
|
|
137
|
-
return None
|
|
81
|
+
|
|
82
|
+
async_pipeline_bytes_pattern = re.compile(
|
|
83
|
+
r"async_pipelines.pipe_[0-9]+.merge_map.bytes"
|
|
84
|
+
)
|
|
85
|
+
async_pipeline_count_pattern = re.compile(
|
|
86
|
+
r"async_pipelines.pipe_[0-9]+.merge_map.count"
|
|
87
|
+
)
|
|
88
|
+
|
|
138
89
|
|
|
139
90
|
def stat_type(stat_id):
|
|
140
91
|
"""
|
|
@@ -146,88 +97,262 @@ def stat_type(stat_id):
|
|
|
146
97
|
|
|
147
98
|
This is useful for determining which value should be reported in a dashboard.
|
|
148
99
|
"""
|
|
149
|
-
|
|
100
|
+
import warnings
|
|
150
101
|
|
|
102
|
+
warnings.warn(
|
|
103
|
+
"The 'stat_type' method is deprecated and will be removed in a future release."
|
|
104
|
+
"The stat type and unit are now part of the return value of invocations to the 'of_node' and 'by_node' methods.",
|
|
105
|
+
DeprecationWarning,
|
|
106
|
+
stacklevel=2,
|
|
107
|
+
)
|
|
151
108
|
|
|
152
|
-
|
|
153
|
-
logger.info("calculating delta for stat_id = {}, prev = {}. cur = {}".format(stat_id, prev, cur))
|
|
109
|
+
return None
|
|
154
110
|
|
|
155
|
-
stat_type = _stat_type(stat_id)
|
|
156
|
-
if stat_type == 'counter':
|
|
157
|
-
return cur - prev
|
|
158
|
-
elif stat_type == 'gauge':
|
|
159
|
-
return cur
|
|
160
|
-
else:
|
|
161
|
-
return None
|
|
162
111
|
|
|
163
|
-
def
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
try:
|
|
167
|
-
prev_stat = cur_stats[stat_id]
|
|
168
|
-
cur_stat = cur_stats[stat_id]
|
|
112
|
+
def _get_all_keys(dconn, n=1024):
|
|
113
|
+
"""
|
|
114
|
+
Returns all keys from a single node.
|
|
169
115
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
116
|
+
Parameters:
|
|
117
|
+
dconn: quasardb.Node
|
|
118
|
+
Direct node connection to the node we wish to connect to.
|
|
173
119
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
120
|
+
n: int
|
|
121
|
+
Number of keys to retrieve.
|
|
122
|
+
"""
|
|
123
|
+
xs = None
|
|
124
|
+
increase_rate = 8
|
|
125
|
+
# keep getting keys while number of results exceeds the given "n"
|
|
126
|
+
while xs is None or len(xs) >= n:
|
|
127
|
+
if xs is not None:
|
|
128
|
+
n = n * increase_rate
|
|
129
|
+
if n >= MAX_KEYS:
|
|
130
|
+
raise Exception(f"ERROR: Cannot fetch more than {MAX_KEYS} keys.")
|
|
131
|
+
xs = dconn.prefix_get(stats_prefix, n)
|
|
177
132
|
|
|
178
|
-
return
|
|
133
|
+
return xs
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class Type(Enum):
|
|
137
|
+
ACCUMULATOR = 1
|
|
138
|
+
GAUGE = 2
|
|
139
|
+
LABEL = 3
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class Unit(Enum):
|
|
143
|
+
NONE = 0
|
|
144
|
+
COUNT = 1
|
|
145
|
+
|
|
146
|
+
# Size units
|
|
147
|
+
BYTES = 32
|
|
148
|
+
|
|
149
|
+
# Time/duration units
|
|
150
|
+
EPOCH = 64
|
|
151
|
+
NANOSECONDS = 65
|
|
152
|
+
MICROSECONDS = 66
|
|
153
|
+
MILLISECONDS = 67
|
|
154
|
+
SECONDS = 68
|
|
179
155
|
|
|
180
156
|
|
|
181
|
-
|
|
157
|
+
_type_string_to_enum = {
|
|
158
|
+
"accumulator": Type.ACCUMULATOR,
|
|
159
|
+
"gauge": Type.GAUGE,
|
|
160
|
+
"label": Type.LABEL,
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
_unit_string_to_enum = {
|
|
164
|
+
"none": Unit.NONE,
|
|
165
|
+
"count": Unit.COUNT,
|
|
166
|
+
"bytes": Unit.BYTES,
|
|
167
|
+
"epoch": Unit.EPOCH,
|
|
168
|
+
"nanoseconds": Unit.NANOSECONDS,
|
|
169
|
+
"microseconds": Unit.MICROSECONDS,
|
|
170
|
+
"milliseconds": Unit.MILLISECONDS,
|
|
171
|
+
"seconds": Unit.SECONDS,
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def _lookup_enum(dconn, k, m):
|
|
176
|
+
"""
|
|
177
|
+
Utility function to avoid code duplication: automatically looks up a key's value
|
|
178
|
+
from QuasarDB and looks it up in provided dict.
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
x = dconn.blob(k).get()
|
|
182
|
+
x = _clean_blob(x)
|
|
183
|
+
|
|
184
|
+
if x not in m:
|
|
185
|
+
raise Exception(f"Unrecognized unit/type {x} from key {k}")
|
|
186
|
+
|
|
187
|
+
return m[x]
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _lookup_type(dconn, k):
|
|
191
|
+
"""
|
|
192
|
+
Looks up and parses/validates the metric type.
|
|
193
|
+
"""
|
|
194
|
+
assert k.endswith(".type")
|
|
195
|
+
|
|
196
|
+
return _lookup_enum(dconn, k, _type_string_to_enum)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def _lookup_unit(dconn, k):
|
|
182
200
|
"""
|
|
183
|
-
|
|
201
|
+
Looks up and parses/validates the metric type.
|
|
184
202
|
"""
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
203
|
+
assert k.endswith(".unit")
|
|
204
|
+
|
|
205
|
+
return _lookup_enum(dconn, k, _unit_string_to_enum)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def _index_keys(dconn, ks):
|
|
209
|
+
"""
|
|
210
|
+
Takes all statistics keys that are retrieved, and "indexes" them in such a way
|
|
211
|
+
that we end up with a dict of all statistic keys, their type and their unit.
|
|
212
|
+
"""
|
|
213
|
+
|
|
214
|
+
###
|
|
215
|
+
# The keys generally look like this, for example:
|
|
216
|
+
#
|
|
217
|
+
# $qdb.statistics.requests.out_bytes
|
|
218
|
+
# $qdb.statistics.requests.out_bytes.type
|
|
219
|
+
# $qdb.statistics.requests.out_bytes.uid_1
|
|
220
|
+
# $qdb.statistics.requests.out_bytes.uid_1.type
|
|
221
|
+
# $qdb.statistics.requests.out_bytes.uid_1.unit
|
|
222
|
+
# $qdb.statistics.requests.out_bytes.unit
|
|
223
|
+
#
|
|
224
|
+
# For this purpose, we simply get rid of the "uid" part, as the per-uid metrics are guaranteed
|
|
225
|
+
# to be of the exact same type as all the others. So after trimming those, the keys will look
|
|
226
|
+
# like this:
|
|
227
|
+
#
|
|
228
|
+
# $qdb.statistics.requests.out_bytes
|
|
229
|
+
# $qdb.statistics.requests.out_bytes.type
|
|
230
|
+
# $qdb.statistics.requests.out_bytes
|
|
231
|
+
# $qdb.statistics.requests.out_bytes.type
|
|
232
|
+
# $qdb.statistics.requests.out_bytes.unit
|
|
233
|
+
# $qdb.statistics.requests.out_bytes.unit
|
|
234
|
+
#
|
|
235
|
+
# And after deduplication like this:
|
|
236
|
+
#
|
|
237
|
+
# $qdb.statistics.requests.out_bytes
|
|
238
|
+
# $qdb.statistics.requests.out_bytes.type
|
|
239
|
+
# $qdb.statistics.requests.out_bytes.unit
|
|
240
|
+
#
|
|
241
|
+
# In which case we'll store `requests.out_bytes` as the statistic type, and look up the type
|
|
242
|
+
# and unit for those metrics and add a placeholder value.
|
|
243
|
+
|
|
244
|
+
ret = defaultdict(lambda: {"value": None, "type": None, "unit": None})
|
|
245
|
+
|
|
246
|
+
for k in ks:
|
|
247
|
+
# Remove any 'uid_[0-9]+' part from the string
|
|
248
|
+
k_ = user_clean_pattern.sub("", k)
|
|
249
|
+
|
|
250
|
+
matches = total_pattern.match(k_)
|
|
251
|
+
|
|
252
|
+
parts = matches.groups()[0].rsplit(".", 1)
|
|
253
|
+
metric_id = parts[0]
|
|
254
|
+
|
|
255
|
+
if len(parts) > 1 and parts[1] == "type":
|
|
256
|
+
if ret[metric_id]["type"] == None:
|
|
257
|
+
# We haven't seen this particular statistic yet
|
|
258
|
+
ret[metric_id]["type"] = _lookup_type(dconn, k)
|
|
259
|
+
elif len(parts) > 1 and parts[1] == "unit":
|
|
260
|
+
if ret[metric_id]["unit"] == None:
|
|
261
|
+
# We haven't seen this particular statistic yet
|
|
262
|
+
ret[metric_id]["unit"] = _lookup_unit(dconn, k)
|
|
263
|
+
else:
|
|
264
|
+
# It's a value, we look those up later
|
|
265
|
+
pass
|
|
189
266
|
|
|
190
267
|
return ret
|
|
191
268
|
|
|
269
|
+
|
|
192
270
|
def _clean_blob(x):
|
|
193
|
-
|
|
271
|
+
"""
|
|
272
|
+
Utility function that decodes a blob as an UTF-8 string, as the direct node C API
|
|
273
|
+
does not yet support 'string' types and as such all statistics are stored as blobs.
|
|
274
|
+
"""
|
|
275
|
+
x_ = x.decode("utf-8", "replace")
|
|
194
276
|
|
|
195
277
|
# remove trailing zero-terminator
|
|
196
|
-
return
|
|
278
|
+
return "".join(c for c in x_ if ord(c) != 0)
|
|
197
279
|
|
|
198
280
|
|
|
199
|
-
def
|
|
281
|
+
def _get_stat_value(dconn, k):
|
|
200
282
|
# Ugly, but works: try to retrieve as integer, if not an int, retrieve as
|
|
201
283
|
# blob
|
|
284
|
+
#
|
|
285
|
+
# XXX(leon): we could use the index we built to get a much stronger hint
|
|
286
|
+
# on what the type is.
|
|
202
287
|
try:
|
|
203
288
|
return dconn.integer(k).get()
|
|
289
|
+
|
|
290
|
+
# Older versions of qdb api returned 'alias not found'
|
|
204
291
|
except quasardb.quasardb.AliasNotFoundError:
|
|
205
292
|
return _clean_blob(dconn.blob(k).get())
|
|
206
293
|
|
|
207
|
-
|
|
294
|
+
# Since ~ 3.14.2, it returns 'Incompatible Type'
|
|
295
|
+
except quasardb.quasardb.IncompatibleTypeError:
|
|
296
|
+
return _clean_blob(dconn.blob(k).get())
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
def _by_uid(stats, idx):
|
|
208
300
|
xs = {}
|
|
209
301
|
for k, v in stats.items():
|
|
210
302
|
matches = user_pattern.match(k)
|
|
211
303
|
if is_user_stat(k) and matches:
|
|
212
304
|
(metric, uid_str) = matches.groups()
|
|
305
|
+
|
|
306
|
+
if metric.split(".")[-1] in ["type", "unit"]:
|
|
307
|
+
# We already indexed the type and unit in our idx, this is not interesting
|
|
308
|
+
continue
|
|
309
|
+
|
|
310
|
+
if metric.startswith("serialized"):
|
|
311
|
+
# Internal stuff we don't care about nor cannot do anything with
|
|
312
|
+
continue
|
|
313
|
+
|
|
314
|
+
if not metric in idx:
|
|
315
|
+
raise Exception(f"Metric not in internal index: {metric}")
|
|
316
|
+
|
|
317
|
+
# Parse user id
|
|
213
318
|
uid = int(uid_str)
|
|
319
|
+
|
|
320
|
+
# Prepare our metric dict
|
|
321
|
+
x = idx[metric].copy()
|
|
322
|
+
x["value"] = v
|
|
323
|
+
|
|
214
324
|
if uid not in xs:
|
|
215
325
|
xs[uid] = {}
|
|
216
326
|
|
|
217
|
-
|
|
218
|
-
xs[uid][metric] = v
|
|
327
|
+
xs[uid][metric] = x
|
|
219
328
|
|
|
220
329
|
return xs
|
|
221
330
|
|
|
222
331
|
|
|
223
|
-
def _cumulative(stats):
|
|
332
|
+
def _cumulative(stats, idx):
|
|
224
333
|
xs = {}
|
|
225
334
|
|
|
226
335
|
for k, v in stats.items():
|
|
227
336
|
matches = total_pattern.match(k)
|
|
228
337
|
if is_cumulative_stat(k) and matches:
|
|
229
338
|
metric = matches.groups()[0]
|
|
230
|
-
|
|
231
|
-
|
|
339
|
+
|
|
340
|
+
if metric.split(".")[-1] in ["type", "unit"]:
|
|
341
|
+
# We already indexed the type and unit in our idx, this is not interesting
|
|
342
|
+
continue
|
|
343
|
+
|
|
344
|
+
if metric.startswith("serialized"):
|
|
345
|
+
# Internal stuff we don't care about nor cannot do anything with
|
|
346
|
+
continue
|
|
347
|
+
|
|
348
|
+
if not metric in idx:
|
|
349
|
+
raise Exception(f"Metric not in internal index: {metric}")
|
|
350
|
+
|
|
351
|
+
x = idx[metric].copy()
|
|
352
|
+
x["value"] = v
|
|
353
|
+
xs[metric] = x
|
|
232
354
|
|
|
233
355
|
return xs
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
# async_pipelines.buffer.total_bytes
|
quasardb/table_cache.py
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
logger = logging.getLogger(
|
|
3
|
+
logger = logging.getLogger("quasardb.table_cache")
|
|
4
4
|
|
|
5
5
|
_cache = {}
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
def clear():
|
|
8
9
|
logger.info("Clearing table cache")
|
|
9
10
|
_cache = {}
|
|
10
11
|
|
|
12
|
+
|
|
11
13
|
def exists(table_name: str) -> bool:
|
|
12
14
|
"""
|
|
13
15
|
Returns true if table already exists in table cache.
|
|
14
16
|
"""
|
|
15
17
|
return table_name in _cache
|
|
16
18
|
|
|
19
|
+
|
|
17
20
|
def store(table, table_name=None, force_retrieve_metadata=True):
|
|
18
21
|
"""
|
|
19
22
|
Stores a table into the cache. Ensures metadata is retrieved. This is useful if you want
|
|
@@ -35,6 +38,7 @@ def store(table, table_name=None, force_retrieve_metadata=True):
|
|
|
35
38
|
|
|
36
39
|
return table
|
|
37
40
|
|
|
41
|
+
|
|
38
42
|
def lookup(table_name: str, conn, force_retrieve_metadata=True):
|
|
39
43
|
"""
|
|
40
44
|
Retrieves table from _cache if already exists. If it does not exist,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
quasardb/INSTALL.vcxproj,sha256=y1omRkLBPJgscguxrvPi5Ei7bVCnbPVeBNgKjka8trc,11046
|
|
2
|
+
quasardb/INSTALL.vcxproj.filters,sha256=TUzMf0eRsFz8Uw2PsrCl3qv23EF01Nq6lQDZic0aIeM,564
|
|
3
|
+
quasardb/__init__.py,sha256=v8N9gkakw2bRY1Ql3P1yBJRjj0HttNkXPPv1S08Nu3I,4751
|
|
4
|
+
quasardb/cmake_install.cmake,sha256=CzbJe8MKo-n_dJdMQj1su_Xl3ZtgLirW9tEmeJJZjYg,1798
|
|
5
|
+
quasardb/firehose.py,sha256=thpTQktgzyY9nTk7vnxckSIZcUATgfkPrBheOLvK1SI,3453
|
|
6
|
+
quasardb/pool.py,sha256=AQfvBwavnNIqPMprqbUua4NuhVxg4FuRVqpa3Aigk9A,8779
|
|
7
|
+
quasardb/qdb_api.dll,sha256=a7k5BIR5aT3KOCyeQAVS7jMHgLS6sKIDd34Y7oJloWQ,25952768
|
|
8
|
+
quasardb/quasardb.cp38-win_amd64.pyd,sha256=la0hw1QdFyB5GsLLxlTEQOs6DmHlEZSzB1LBR9MLhRo,1371136
|
|
9
|
+
quasardb/stats.py,sha256=VLPzV0MwYWD5m06WYlZ2Yy_m1WD1XL8v81P2DPdfpvI,10108
|
|
10
|
+
quasardb/table_cache.py,sha256=9XdHrWb_zpC9gikyZJhFX1qy5rMUc7o7uEPKfyZHjVY,1567
|
|
11
|
+
quasardb/CMakeFiles/generate.stamp,sha256=MC9-mgyGPAS3QAZa3gHSQ8dYfXJy_Hn7AChwEoqVWOs,55
|
|
12
|
+
quasardb/CMakeFiles/generate.stamp.depend,sha256=uY8FV-ceJ2Kk-6JfOnsIesDV7jKoUNfkKHNY2Nf7_E8,117
|
|
13
|
+
quasardb/date/ALL_BUILD.vcxproj,sha256=1iBL6p7WOpdP6mTjrTtLA2fTfEUEmYTIkz344kzKGCs,14241
|
|
14
|
+
quasardb/date/ALL_BUILD.vcxproj.filters,sha256=lTQk5MABpmIlZcZqriqmw7SlGUJKSM2xH8HnaKmgC5E,304
|
|
15
|
+
quasardb/date/INSTALL.vcxproj,sha256=pHZvwmmjkMCW-0rfOEsPSaMtLhhJVBAUdBy07d2lbY4,11071
|
|
16
|
+
quasardb/date/INSTALL.vcxproj.filters,sha256=uCTy5RO1Ia8Zn2c4gBdvNuoKVqaPrT-8iV-YFZeQ4vE,564
|
|
17
|
+
quasardb/date/cmake_install.cmake,sha256=yW75iyPm4BHg79vinMFtKKrRn60sdSGSw_6hej0YxH0,3318
|
|
18
|
+
quasardb/date/date.sln,sha256=yzc-WIKaG8yVfp4cIp3UHC2hoVuDgtWU0Vms2xxYSgo,3660
|
|
19
|
+
quasardb/date/dateConfigVersion.cmake,sha256=54LqYG6K3Si4Oq1UDH_bHTMzdr6c3KWFXpO0LdeO0zM,2827
|
|
20
|
+
quasardb/date/dateTargets.cmake,sha256=lRvsUAZZiKJf4UJT06TpLnwIMoKs60Dw2D4l-J9iCoI,2842
|
|
21
|
+
quasardb/date/CMakeFiles/generate.stamp,sha256=MC9-mgyGPAS3QAZa3gHSQ8dYfXJy_Hn7AChwEoqVWOs,55
|
|
22
|
+
quasardb/date/CMakeFiles/generate.stamp.depend,sha256=q-iyp1ifyf83pBE1_9faK6GsnBvgEPN49_hRCZFa-IU,650
|
|
23
|
+
quasardb/date/CMakeFiles/Export/df49adab93b9e0c10c64f72458b31971/dateTargets.cmake,sha256=nH0TolGzHCM6ZpwAcktH6LAio29Df7-PbPZJ79AIe0s,4189
|
|
24
|
+
quasardb/extensions/__init__.py,sha256=zvMxXV_zuRSbNrkjsu-qFSEiZahdHmC0lhMqMVRzY_8,120
|
|
25
|
+
quasardb/extensions/writer.py,sha256=DWpm4qqBGtunIPyNuRLtUWouL_Tmr3_Zs3K5c0JtH04,5758
|
|
26
|
+
quasardb/numpy/__init__.py,sha256=gRyPPwMQdVtycC1021oFstlT6xVnA3lhD7AVAZr35Ig,34950
|
|
27
|
+
quasardb/pandas/__init__.py,sha256=w8LXwR4sEXWNnPaSMetltP5kPFBFqTyrUMpQXMK_eX8,16697
|
|
28
|
+
quasardb/pybind11/ALL_BUILD.vcxproj,sha256=mZO3Npg638GMc7WAF0ENrxLvEOz1oeJRt16bToO40mA,20681
|
|
29
|
+
quasardb/pybind11/ALL_BUILD.vcxproj.filters,sha256=WjgQPMVZN7jEaUOdw8Ha03hPfNxybvx_F2wOck10Kqo,308
|
|
30
|
+
quasardb/pybind11/INSTALL.vcxproj,sha256=MzTPsFF2JJscL_nQxTVno81ofCau0R992bwO_A2oM1U,11091
|
|
31
|
+
quasardb/pybind11/INSTALL.vcxproj.filters,sha256=A6FgfSHkVHj8Q5YucG7AXMHuG-K4P3KP5CAcOTx-IpA,564
|
|
32
|
+
quasardb/pybind11/cmake_install.cmake,sha256=5Ez61-TWcg-jLQrLkxHpj-WEWaky_J76HZ7TLaDnFKA,1367
|
|
33
|
+
quasardb/pybind11/pybind11.sln,sha256=jpXRREdn2zRbtWX9ZzTNV5A68nWi_aqDfvz91kb8WMw,3660
|
|
34
|
+
quasardb/pybind11/CMakeFiles/generate.stamp,sha256=MC9-mgyGPAS3QAZa3gHSQ8dYfXJy_Hn7AChwEoqVWOs,55
|
|
35
|
+
quasardb/pybind11/CMakeFiles/generate.stamp.depend,sha256=aZoeZTuxueMyoFMODfX1LGlJO2hH-xmNjaTSK9y2gK4,2265
|
|
36
|
+
quasardb/range-v3/ALL_BUILD.vcxproj,sha256=rI5qUFfW98gh26Mm51FR7uPnpTXdIyeAqXoHlHF9qTg,19221
|
|
37
|
+
quasardb/range-v3/ALL_BUILD.vcxproj.filters,sha256=c0k-3qrBreLvjffsj9pJo50YOMqfDYnxLpBqvV1nI00,308
|
|
38
|
+
quasardb/range-v3/INSTALL.vcxproj,sha256=GfWVmqNkDYKypSM2j_3N4mebCHZEih71xnafIFfmt2s,11091
|
|
39
|
+
quasardb/range-v3/INSTALL.vcxproj.filters,sha256=gRtT1h5JgHRtOuUrxO0NpmulUFCF9SuHsU_rh08alHU,564
|
|
40
|
+
quasardb/range-v3/Range-v3.sln,sha256=1KrYjvA6KvVW80E_0yIcnZBz4f2UNGQmj-0DvE88_0g,4506
|
|
41
|
+
quasardb/range-v3/cmake_install.cmake,sha256=AXgperFNmLNR7mzgrdFnRQ1ye0YDjx5Uk4QzTJxNQYM,6952
|
|
42
|
+
quasardb/range-v3/range-v3-config-version.cmake,sha256=57XQ96x5Ec1VvRfoIPND_DSMJ9ZbHUqa8iZEiS0YMvw,3332
|
|
43
|
+
quasardb/range-v3/range-v3-config.cmake,sha256=5zRnJkdQ2k3fYDM1sqSGGwXAXWfc4v39zE2D8Chvfq4,3458
|
|
44
|
+
quasardb/range-v3/range.v3.headers.vcxproj,sha256=frdrcvs9Tg9YBXIabWdOQi6VJXJybYY1uBw3Mq8na1U,58903
|
|
45
|
+
quasardb/range-v3/range.v3.headers.vcxproj.filters,sha256=-9CvkhpzAfIk6_lpiYpbDo_xUktT9HGcwjqsS462kGI,51825
|
|
46
|
+
quasardb/range-v3/CMakeFiles/generate.stamp,sha256=MC9-mgyGPAS3QAZa3gHSQ8dYfXJy_Hn7AChwEoqVWOs,55
|
|
47
|
+
quasardb/range-v3/CMakeFiles/generate.stamp.depend,sha256=ABuj3rPyodNYq2D8YDfiaDW-1OssQuMLFStUSvinCxk,1898
|
|
48
|
+
quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake,sha256=-NpNuRp4cGl9FnmOmkYljoTJq1r_m9GceVCwIYrDjFM,5393
|
|
49
|
+
quasardb/range-v3/include/range/v3/version.hpp,sha256=jy6iEzXjaavicAw1VSIfvpS7Wu9IoEY51Q5N9m4eaB8,610
|
|
50
|
+
quasardb-3.14.2.dev6.dist-info/LICENSE.md,sha256=0iT1ltzDof6cJr8mSX2PVOGhKjISfCrOYzJg7rG2pOs,1477
|
|
51
|
+
quasardb-3.14.2.dev6.dist-info/METADATA,sha256=oBLvc3OJXwMjdgOWl6sZYCuO-nyy1VyeRuwI9x22u5c,1300
|
|
52
|
+
quasardb-3.14.2.dev6.dist-info/WHEEL,sha256=2M046GvC9RLU1f1TWyM-2sB7cRKLhAC7ucAFK8l8f24,99
|
|
53
|
+
quasardb-3.14.2.dev6.dist-info/top_level.txt,sha256=wlprix4hCywuF1PkgKWYdZeJKq_kgJOqkAvukm_sZQ8,9
|
|
54
|
+
quasardb-3.14.2.dev6.dist-info/RECORD,,
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
quasardb/INSTALL.vcxproj,sha256=3MGjfDVN7LRQWfvvP1APL2AtRtnbUFl1H5RUlJ7fNAs,11046
|
|
2
|
-
quasardb/INSTALL.vcxproj.filters,sha256=TUzMf0eRsFz8Uw2PsrCl3qv23EF01Nq6lQDZic0aIeM,564
|
|
3
|
-
quasardb/__init__.py,sha256=20wagayMPRncEbfEbAu0y8sbMRKj-Lyc_0LB8dMdysM,4670
|
|
4
|
-
quasardb/cmake_install.cmake,sha256=CzbJe8MKo-n_dJdMQj1su_Xl3ZtgLirW9tEmeJJZjYg,1798
|
|
5
|
-
quasardb/firehose.py,sha256=DHYsew-aL1j5PKZonH30CrhXnwHEX1XIAhGbPrzd4PY,3593
|
|
6
|
-
quasardb/pool.py,sha256=lqVZPFejmNHU7EdyeoPkl7yy_-N3BRyuLhNTzIdtg8g,8743
|
|
7
|
-
quasardb/qdb_api.dll,sha256=LxCNvEduafZ1w2oGcjqNnU_mVxZbszq0Fn2_Vn3HgCU,18551808
|
|
8
|
-
quasardb/quasardb.cp38-win_amd64.pyd,sha256=uB7TbgkoxZMtD2fFvy3JVbx5AwwjBLhSZ9-VrOB2HWA,1363456
|
|
9
|
-
quasardb/stats.py,sha256=LDV4F5KTpEXa5sS_syFo_TYn9_W2X1D32Eb43GLutOs,7620
|
|
10
|
-
quasardb/table_cache.py,sha256=t7FFQkms7pFlYDkOhCcLnLS8bWglZjlzX3Qs6gyBG6Q,1559
|
|
11
|
-
quasardb/CMakeFiles/generate.stamp,sha256=MC9-mgyGPAS3QAZa3gHSQ8dYfXJy_Hn7AChwEoqVWOs,55
|
|
12
|
-
quasardb/CMakeFiles/generate.stamp.depend,sha256=uY8FV-ceJ2Kk-6JfOnsIesDV7jKoUNfkKHNY2Nf7_E8,117
|
|
13
|
-
quasardb/date/ALL_BUILD.vcxproj,sha256=S3tL5t9rTVLSO1YbyZqMZzzhT4nI2pEGAgIH1N3KE04,14257
|
|
14
|
-
quasardb/date/ALL_BUILD.vcxproj.filters,sha256=lTQk5MABpmIlZcZqriqmw7SlGUJKSM2xH8HnaKmgC5E,304
|
|
15
|
-
quasardb/date/INSTALL.vcxproj,sha256=qRqaayvSWL5OUuya221_vFbF4eaBf-3-HAbH3bzqSq4,11071
|
|
16
|
-
quasardb/date/INSTALL.vcxproj.filters,sha256=uCTy5RO1Ia8Zn2c4gBdvNuoKVqaPrT-8iV-YFZeQ4vE,564
|
|
17
|
-
quasardb/date/cmake_install.cmake,sha256=yW75iyPm4BHg79vinMFtKKrRn60sdSGSw_6hej0YxH0,3318
|
|
18
|
-
quasardb/date/date.sln,sha256=yzc-WIKaG8yVfp4cIp3UHC2hoVuDgtWU0Vms2xxYSgo,3660
|
|
19
|
-
quasardb/date/dateConfigVersion.cmake,sha256=54LqYG6K3Si4Oq1UDH_bHTMzdr6c3KWFXpO0LdeO0zM,2827
|
|
20
|
-
quasardb/date/dateTargets.cmake,sha256=FuGNruC_9fdY0b7YwlC80Kpx9H3Y5CnGXOVNRs6ePRU,2842
|
|
21
|
-
quasardb/date/CMakeFiles/generate.stamp,sha256=MC9-mgyGPAS3QAZa3gHSQ8dYfXJy_Hn7AChwEoqVWOs,55
|
|
22
|
-
quasardb/date/CMakeFiles/generate.stamp.depend,sha256=x7HFJ8spOUSAEc-xj5wwyVu1PTGiVafK4i4ijGMbN7k,654
|
|
23
|
-
quasardb/date/CMakeFiles/Export/df49adab93b9e0c10c64f72458b31971/dateTargets.cmake,sha256=kI-gSADoA7MuLXEBcyU3_kYGNyGw6NoQ9chjo7LpEHY,4189
|
|
24
|
-
quasardb/extensions/__init__.py,sha256=zvMxXV_zuRSbNrkjsu-qFSEiZahdHmC0lhMqMVRzY_8,120
|
|
25
|
-
quasardb/extensions/writer.py,sha256=LcGhgr_jrHEDukVukLN1eGKCU0egeZkcCOenFEhZi3A,5928
|
|
26
|
-
quasardb/numpy/__init__.py,sha256=SKBNEXyVQNmiZCtg0rlsnpEwvUYKGhvjshPnyByNCbs,30951
|
|
27
|
-
quasardb/pandas/__init__.py,sha256=LNEmjKvcDD6IdEGrQIgOaBhYH14hH7Y9bF1PFWa6gFg,15331
|
|
28
|
-
quasardb/pybind11/ALL_BUILD.vcxproj,sha256=iLuDHB_e7LuTIjHIt1evFq9EjfWwPZixEwGYoS6MZhs,20737
|
|
29
|
-
quasardb/pybind11/ALL_BUILD.vcxproj.filters,sha256=WjgQPMVZN7jEaUOdw8Ha03hPfNxybvx_F2wOck10Kqo,308
|
|
30
|
-
quasardb/pybind11/INSTALL.vcxproj,sha256=TSmTWt7WaOIgEgThgUTt9LsySHBMqKg74kywGdrzsOM,11091
|
|
31
|
-
quasardb/pybind11/INSTALL.vcxproj.filters,sha256=A6FgfSHkVHj8Q5YucG7AXMHuG-K4P3KP5CAcOTx-IpA,564
|
|
32
|
-
quasardb/pybind11/cmake_install.cmake,sha256=5Ez61-TWcg-jLQrLkxHpj-WEWaky_J76HZ7TLaDnFKA,1367
|
|
33
|
-
quasardb/pybind11/pybind11.sln,sha256=jpXRREdn2zRbtWX9ZzTNV5A68nWi_aqDfvz91kb8WMw,3660
|
|
34
|
-
quasardb/pybind11/CMakeFiles/generate.stamp,sha256=MC9-mgyGPAS3QAZa3gHSQ8dYfXJy_Hn7AChwEoqVWOs,55
|
|
35
|
-
quasardb/pybind11/CMakeFiles/generate.stamp.depend,sha256=pvI1o52UhdStD5UHbR3scmC6QqJuIHE0krXJeJOIQE4,2279
|
|
36
|
-
quasardb/range-v3/ALL_BUILD.vcxproj,sha256=VQYlvNXZNXVqJwB1RIcAsTPPLqVLsb7J_TVqMSPFC3A,19265
|
|
37
|
-
quasardb/range-v3/ALL_BUILD.vcxproj.filters,sha256=c0k-3qrBreLvjffsj9pJo50YOMqfDYnxLpBqvV1nI00,308
|
|
38
|
-
quasardb/range-v3/INSTALL.vcxproj,sha256=bJ8yfISiHCDw7zkI3QHDDEViY0DNdZn19kYQqcYgPfw,11091
|
|
39
|
-
quasardb/range-v3/INSTALL.vcxproj.filters,sha256=gRtT1h5JgHRtOuUrxO0NpmulUFCF9SuHsU_rh08alHU,564
|
|
40
|
-
quasardb/range-v3/Range-v3.sln,sha256=1KrYjvA6KvVW80E_0yIcnZBz4f2UNGQmj-0DvE88_0g,4506
|
|
41
|
-
quasardb/range-v3/cmake_install.cmake,sha256=AXgperFNmLNR7mzgrdFnRQ1ye0YDjx5Uk4QzTJxNQYM,6952
|
|
42
|
-
quasardb/range-v3/range-v3-config-version.cmake,sha256=57XQ96x5Ec1VvRfoIPND_DSMJ9ZbHUqa8iZEiS0YMvw,3332
|
|
43
|
-
quasardb/range-v3/range-v3-config.cmake,sha256=E7j1hj2ihfV3jYirDWkQgWZ9vjQTPUI9w2BR-qfV6qM,3458
|
|
44
|
-
quasardb/range-v3/range.v3.headers.vcxproj,sha256=dPGlYOAFujswRP0joZPmye76mQsKkLT2tD0UzXX44a4,58947
|
|
45
|
-
quasardb/range-v3/range.v3.headers.vcxproj.filters,sha256=-9CvkhpzAfIk6_lpiYpbDo_xUktT9HGcwjqsS462kGI,51825
|
|
46
|
-
quasardb/range-v3/CMakeFiles/generate.stamp,sha256=MC9-mgyGPAS3QAZa3gHSQ8dYfXJy_Hn7AChwEoqVWOs,55
|
|
47
|
-
quasardb/range-v3/CMakeFiles/generate.stamp.depend,sha256=fRk-WZOhQevkVD_W5AV310RnSvDL-Y83agjjrvHtofI,1909
|
|
48
|
-
quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake,sha256=2WN8TJ25ES8AniYWyiS3BFiUz4RAJww7dvvnC-kE7zM,5393
|
|
49
|
-
quasardb/range-v3/include/range/v3/version.hpp,sha256=jy6iEzXjaavicAw1VSIfvpS7Wu9IoEY51Q5N9m4eaB8,610
|
|
50
|
-
quasardb-3.14.2.dev4.dist-info/LICENSE.md,sha256=0iT1ltzDof6cJr8mSX2PVOGhKjISfCrOYzJg7rG2pOs,1477
|
|
51
|
-
quasardb-3.14.2.dev4.dist-info/METADATA,sha256=NjrdXrtH6XFWmyo5hsSpp9qIJsy9YmjiM1OxSZ5Uqco,1300
|
|
52
|
-
quasardb-3.14.2.dev4.dist-info/WHEEL,sha256=rTcqimtzpX3smAWAhGmiRSWAxTY4PqYPNE-p4kscHDQ,99
|
|
53
|
-
quasardb-3.14.2.dev4.dist-info/top_level.txt,sha256=wlprix4hCywuF1PkgKWYdZeJKq_kgJOqkAvukm_sZQ8,9
|
|
54
|
-
quasardb-3.14.2.dev4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|