Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Haberler committed Mar 31, 2021
0 parents commit efdc268
Show file tree
Hide file tree
Showing 3 changed files with 1,964 additions and 0 deletions.
43 changes: 43 additions & 0 deletions perf.py
@@ -0,0 +1,43 @@
import rejson
import time
import os

r = rejson.Client(host=os.environ['REDIS_HOST'],
password=os.environ['REDIS_PASS'],
port=os.environ['REDIS_PORT'], db=0)

while True:
pipe = r.pipeline(transaction=False)
path = "path:sonde:foo"
pipe.jsonset(path, rejson.Path.rootPath(), {
"type" : "Feature",
"geometry" : {
"type": "LineString",
"coordinates": [],
},
"properties": {
"coordinateProperties": []
}
}, nx=True)
pipe.jsonarrappend(path, rejson.Path(".geometry.coordinates"), [47, 15, 920])
per_sample_props = {
"type":"Feature",
"geometry":{
"type":"Point",
"coordinates":[26.2153,60.34085,417.0]
},
"properties":{
"temp":3.6,
"serial":"S0730589",
"humidity":64.6,
"vel_h":16.0,
"uploader_callsign":"Lahti 24h raspberry",
"time":1617220020,
"uploader":{
"callsign":"Lahti 24h raspberry"
}
}
}
pipe.jsonarrappend(path, rejson.Path(".properties.coordinateProperties"),per_sample_props)
pipe.execute()
time.sleep(0.01)

0 comments on commit efdc268

Please sign in to comment.