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

docs fix

parent 1a4ef233
No related branches found
No related tags found
No related merge requests found
.. tempsdb documentation master file, created by
sphinx-quickstart on Sat Nov 28 15:49:03 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to tempsdb's documentation! Welcome to tempsdb's documentation!
=================================== ===================================
...@@ -15,8 +10,11 @@ Welcome to tempsdb's documentation! ...@@ -15,8 +10,11 @@ Welcome to tempsdb's documentation!
chunks chunks
memory-pressure-manager memory-pressure-manager
This is an append-only embedded time series library written in Cython.
It tries to use mmap for reads and writes, and in general is as zero-copy as possible (ie. the It tries to use mmap for reads and writes, and in general is as zero-copy as possible (ie. the
only time data is unserialized is when a particular entry is read). only time data is unserialized is when a particular entry is read). It also uses
iterators.
Stored time series with a 8-bit timestamp and a fixed length of data. Stored time series with a 8-bit timestamp and a fixed length of data.
So no variable encoding for you! So no variable encoding for you!
......
...@@ -19,3 +19,7 @@ You retrieve their data via Iterators: ...@@ -19,3 +19,7 @@ You retrieve their data via Iterators:
.. autoclass:: tempsdb.iterators.Iterator .. autoclass:: tempsdb.iterators.Iterator
:members: :members:
Appending the data is done via :meth:`~tempsdb.series.TimeSeries.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.
...@@ -12,9 +12,8 @@ cdef class Chunk: ...@@ -12,9 +12,8 @@ cdef class Chunk:
readonly unsigned long entries readonly unsigned long entries
unsigned long file_size unsigned long file_size
unsigned long pointer # position to write next entry at unsigned long pointer # position to write next entry at
unsigned long page_size readonly unsigned long page_size
object file object file, mmap
object mmap
bint closed bint closed
cpdef object iterate_indices(self, unsigned long starting_entry, unsigned long stopping_entry) cpdef object iterate_indices(self, unsigned long starting_entry, unsigned long stopping_entry)
......
import os import os
import threading
import typing as tp import typing as tp
import struct import struct
import mmap import mmap
...@@ -32,6 +31,7 @@ cdef class Chunk: ...@@ -32,6 +31,7 @@ cdef class Chunk:
:ivar block_size: size of the data entries (int) :ivar block_size: size of the data entries (int)
:ivar entries: amount of entries in this chunk (int) :ivar entries: amount of entries in this chunk (int)
:ivar writable: is this chunk writable (bool) :ivar writable: is this chunk writable (bool)
:ivar page_size: size of the page (int)
""" """
def __init__(self, parent: tp.Optional[TimeSeries], path: str, page_size: int): def __init__(self, parent: tp.Optional[TimeSeries], path: str, page_size: int):
cdef bytes b cdef bytes b
......
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