Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Basic commands #1

wants to merge 3 commits into from

Conversation

jeffreylovitz
Copy link

No description provided.

@jeffreylovitz jeffreylovitz requested a review from gkorland January 9, 2020 16:16
# 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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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"))
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants