How this does work?¶
Note
This is about fixed length data time series. For the page about time series, see the proper page.
Data is stored in so called chunks. A chunk’s last page can be actively appended to, or a chunk is immutable.
When there is a request to fetch some data, a chunk is loaded into memory. It will not
be automatically unloaded, to do this, you must periodically call
close_chunks()
.
Usage¶
Start off by instantiating an object
Note that if you specify a gzip_level argument in
create_series()
, GZIP compression will be used.
Warning
Note that gzip-compressed series are very slow to read, since every seek is conducted from the beginning. indexed-gzip library hung too often. This will be fixed in the future.
Also, any gzip-opened series will raise a warning, since their support is experimental at best.
You can create new databases via
Then you can create and retrieve particular series:
You retrieve their data via Iterators:
Appending the data is done via append()
. Since time series are
allocated in entire pages, so your files will be padded to a page in size. This makes writes
quite fast, as in 99.9% cases it is just a memory operation.
Logging¶
tempsdb will log when opening and closing series. To prevent this from happening, just call: