Distributed sardana recorder
Project description
Sardana Streams
Sardana data streaming infrastucture. Comprises:
- redis based sardana scan recorder
- Client recorders:
- generic scan stream client (library)
- SPEC recorder daemon
- HDF5 recorder daemon
- Scan GUI
Installation
From within your favorite python environment:
$ pip install sardana-streams
Usage
The name acme used in the following examples represents a fictional corporation that features prominently in the Road Runner cartoons.
Configuration
Activate sardana redis recorder:
- Put the installation directory where the
sardana_streams/recorder
resides in RecorderPath tango property of the MacroServer. (ex:/usr/local/lib/python3.5/dist-packages/sardana_streams/recorder
) - From spock:
- activate the recorder with:
senv DataRecorder "['RedisRecorder']"
- configure the recorder with
senv RedisRecorder "{'host': 'acme.org', 'port': 7379, 'db': 1}"
(replacehost
,port
anddb
with your own)
- activate the recorder with:
The RedisRecorder
env can be a string or a dictionary identifying the Redis
database.
In case a string is given, it recognizes the same format url argument from redis.from_url().
In case a dict is given it recognizes the same keyword arguments as redis.from_url() plus:
TTL
: scan time to live in seconds (defaults to one week)key_prefix
: scan key prefix (defaults to<macro server name>:sardana:scan
)
Example
Here is a simple example of a client which simply listens to scan events and prints them on screen:
import contextlib
import redis
from sardana_streams.client import ScanStream
db = redis.from_url('redis://acme.org:7379/1')
prefix = "acme:sardana:scan"
stream = ScanStream(db, prefix)
with contextlib.closing(stream):
for event in stream:
print(event)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file sardana-streams-0.1.0.tar.gz
.
File metadata
- Download URL: sardana-streams-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3.post20210118 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7516ba4ebe2ab328450b897feeded18840db832897ca2228e5a0a56f303e0b9 |
|
MD5 | 1bf70655601076a2e1ab820766755b48 |
|
BLAKE2b-256 | 92e54b1010132e2596a6831cec90b04f352dc587036bdfea3359f3802d6464f3 |