Skip to content

Instantly share code, notes, and snippets.

@jsanda
Created December 9, 2013 21:31
Show Gist options
  • Save jsanda/7881321 to your computer and use it in GitHub Desktop.
Save jsanda/7881321 to your computer and use it in GitHub Desktop.
RHQ's Cassandra schema for metrics data
CREATE TABLE rhq.raw_metrics (
schedule_id int,
time timestamp,
value double,
PRIMARY KEY (schedule_id, time)
) WITH COMPACT STORAGE;
CREATE TABLE rhq.one_hour_metrics (
schedule_id int,
time timestamp,
type int,
value double,
PRIMARY KEY (schedule_id, time, type)
) WITH COMPACT STORAGE;
CREATE TABLE rhq.six_hour_metrics (
schedule_id int,
time timestamp,
type int,
value double,
PRIMARY KEY (schedule_id, time, type)
) WITH COMPACT STORAGE;
CREATE TABLE rhq.twenty_four_hour_metrics (
schedule_id int,
time timestamp,
type int,
value double,
PRIMARY KEY (schedule_id, time, type)
) WITH COMPACT STORAGE;
CREATE TABLE rhq.metrics_index (
bucket varchar,
time timestamp,
schedule_id int,
PRIMARY KEY ((bucket, time), schedule_id)
) WITH COMPACT STORAGE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment