Skip to content

Instantly share code, notes, and snippets.

@jsanda
Created April 19, 2013 14:44
Show Gist options
  • Save jsanda/5420800 to your computer and use it in GitHub Desktop.
Save jsanda/5420800 to your computer and use it in GitHub Desktop.
CREATE KEYSPACE rhq WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
USE rhq;
CREATE TABLE raw_metrics (
schedule_id int,
time timestamp,
value double,
PRIMARY KEY (schedule_id, time)
);
CREATE TABLE one_hour_metrics (
schedule_id int,
time timestamp,
type int,
value double,
PRIMARY KEY (schedule_id, time, type)
);
CREATE TABLE six_hour_metrics (
schedule_id int,
time timestamp,
type int,
value double,
PRIMARY KEY (schedule_id, time, type)
);
CREATE TABLE twenty_four_hour_metrics (
schedule_id int,
time timestamp,
type int,
value double,
PRIMARY KEY (schedule_id, time, type)
);
CREATE TABLE metrics_index (
bucket varchar,
time timestamp,
schedule_id int,
null_col boolean,
PRIMARY KEY (bucket, time, schedule_id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment