-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic commands #1
base: master
Are you sure you want to change the base?
Conversation
# TS.CREATE key [RETENTION retentionTime] [UNCOMPRESSED] [LABELS field value..] | ||
function create(conn::RedisConnection, key::String, command::String) | ||
response = execute_command(conn, ["TS.CREATE", key, command]) | ||
println(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffreylovitz I think it's better to remove the println and return status
# TS.ALTER key [RETENTION retentionTime] [LABELS field value..] | ||
function alter(conn::RedisConnection, key::String, params::String) | ||
response = execute_command(conn, ["TS.ALTER", key, params]) | ||
println(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffreylovitz I think it's better to remove the println and return status
label_str = "" | ||
for i in keys(labels) label_str = string(label_str, "$i $(labels[i]) ") end | ||
response = execute_command(conn, ["TS.ADD", key, string(timestamp), string(value), retention, label_str]) | ||
println(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffreylovitz I think it's better to remove the println and return timestamp
# TS.ADD key timestamp value [RETENTION retentionTime] [UNCOMPRESSED] [LABELS field value..] | ||
# Note that UNCOMPRESSED is unused in timeseries-py; we are following suit here. | ||
response = execute_command(conn, ["TS.ADD", key, string(timestamp), string(value), retention]) | ||
println(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffreylovitz I think it's better to remove the println and return the timestamp
function madd(conn::RedisConnection, ktv_tuple::Tuple{String, Int64, Float64}) | ||
# TS.MADD key timestamp value [key timestamp value ...] | ||
response = execute_command(conn, ["TS.MADD", ktv_unfold(ktv_tuple)]) | ||
println(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffreylovitz I think it's better to remove the println and return the timestamps
Redis.del(conn, key) | ||
RedisTimeSeries.create(conn, key, "RETENTION 60000 LABELS sensor_id 2 area_id 32") | ||
RedisTimeSeries.alter(conn, key, "LABELS sensor_id 2 area_id 32 sub_area_id 15") | ||
RedisTimeSeries.add(conn, key, 1548149180000, 26.0, Dict{String,String}("sensor_id" => "2", "area_id" => "32")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffreylovitz can you please convert it to a real test with assert so we can use is as a base for our future tests?
No description provided.