Look up all available timeseries

Summary

You want to look up all available timeseries in your QuasarDB cluster. QuasarDB allows for this by attaching tags to your timeseries upon creation and using the same tag to look them up at a later time.

Solution

To look up all available timeseries in your QuasarDB cluster, you are recommended to assign all of them the same tag. For example, when you attach the tag "store" to all your timeseries, you effectively create an index of all your timeseries. As an added benefit, it allows you to run queries and aggregates across all your timeseries, as described in Aggregation of multiple timeseries.

In the Python API for example, you could create your timeseries as follows:

import quasardb

# Initialize two timeseries with two columns
cols = [quasardb.TimeSeries.Int64ColumnInfo("bid"),
        quasardb.TimeSeries.Int64ColumnInfo("last")]
c = quasardb.Cluster(uri="qdb://127.0.0.1:2836")
ts1 = c.ts("stocks.apple")
ts1.create(cols)
ts2 = c.ts("stocks.google")
ts2.create(cols)

# Attach tag to both
ts1.attach_tag("store")
ts2.attach_tag("store")

We can then query these timeseries using the QuasarDB shell as follows:

qdbsh > find(tag='store' and type=ts)
1. stocks.apple
2. stocks.google
qdbsh >

 Note how we are restricting the entries we return to only those with the type timeseries, by adding the additional qualifier "type=ts".

References

 

Was this article helpful?
0 out of 0 found this helpful