Skip to content
Snippets Groups Projects
Commit f96ede47 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

add options to varlenseries

parent 61e8ea4e
No related branches found
No related tags found
No related merge requests found
...@@ -51,9 +51,10 @@ python setup.py bdist_wheel ...@@ -51,9 +51,10 @@ python setup.py bdist_wheel
Then copy your resulting wheel and install it via pip on the target system. Then copy your resulting wheel and install it via pip on the target system.
# Changelog # Changelog
## v0.5.2 ## v0.5.2
* _TBA_ * added multiple properties and attributes to `VarlenSeries`
## v0.5.1 ## v0.5.1
......
...@@ -41,7 +41,7 @@ ext_modules = build([Multibuild('tempsdb', find_pyx('tempsdb'), **ext_kwargs), ] ...@@ -41,7 +41,7 @@ ext_modules = build([Multibuild('tempsdb', find_pyx('tempsdb'), **ext_kwargs), ]
**cythonize_kwargs) **cythonize_kwargs)
setup(name='tempsdb', setup(name='tempsdb',
version='0.5.2a1', version='0.5.2a2',
packages=find_packages(include=['tempsdb', 'tempsdb.*']), packages=find_packages(include=['tempsdb', 'tempsdb.*']),
install_requires=['satella>=2.14.24', 'ujson'], install_requires=['satella>=2.14.24', 'ujson'],
ext_modules=ext_modules, ext_modules=ext_modules,
......
...@@ -7,12 +7,12 @@ cdef class VarlenSeries: ...@@ -7,12 +7,12 @@ cdef class VarlenSeries:
int size_field int size_field
int references int references
object size_struct object size_struct
str path readonly str path
str name readonly str name
TimeSeries root_series TimeSeries root_series
readonly list series readonly list series
list length_profile readonly list length_profile
int max_entries_per_chunk readonly int max_entries_per_chunk
int current_maximum_length int current_maximum_length
object mpm object mpm
int gzip_level int gzip_level
......
...@@ -296,6 +296,11 @@ cdef class VarlenIterator: ...@@ -296,6 +296,11 @@ cdef class VarlenIterator:
:class:`~tempsdb.varlen.VarlenEntry`. Note that setting this to True :class:`~tempsdb.varlen.VarlenEntry`. Note that setting this to True
will result in a performance drop, since it will copy, but it should will result in a performance drop, since it will copy, but it should
be faster if your typical entry is less than 20 bytes. be faster if your typical entry is less than 20 bytes.
:ivar name: series' name (str)
:ivar path: path to series' directory (str)
:ivar max_entries_per_chunk: maximum entries per chunk (int)
:ivar length_profile: length profile (tp.List[int])
""" """
def __init__(self, parent: VarlenSeries, start: int, stop: int, def __init__(self, parent: VarlenSeries, start: int, stop: int,
direct_bytes: bool = False): direct_bytes: bool = False):
...@@ -438,6 +443,16 @@ cdef class VarlenSeries: ...@@ -438,6 +443,16 @@ cdef class VarlenSeries:
series.close_chunks() series.close_chunks()
return 0 return 0
@property
cpdef unsigned long long last_entry_ts(self):
"""
:return: last entry's timestamp, or barring that a 0
"""
try:
return self.get_current_value()[0]
except ValueError:
return 0
cpdef VarlenIterator iterate_range(self, unsigned long long start, unsigned long long stop, cpdef VarlenIterator iterate_range(self, unsigned long long start, unsigned long long stop,
bint direct_bytes=False): bint direct_bytes=False):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment