Skip to content

Instantly share code, notes, and snippets.

@rbotzer
Created December 4, 2019 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbotzer/d06d8ed9764d113505a003646ef9d835 to your computer and use it in GitHub Desktop.
Save rbotzer/d06d8ed9764d113505a003646ef9d835 to your computer and use it in GitHub Desktop.
Three hours of data from one sensor
key = (namespace, set, "sensor{}-12-31".format(sensor_id))
print("\nRetrieve sensor{} data for 8-11am, December 31st".format(sensor_id))
if options.interactive:
pause()
starts = 8 * 60
ends = 11 * 60
ops = [
lh.list_get_by_value_range(
"t",
aerospike.LIST_RETURN_VALUE,
[starts, aerospike.null()],
[ends, aerospike.null()],
)
]
_, _, b = client.operate(key, ops)
pp.pprint(b["t"])
print(spacer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment