X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=sql%2Fmetrics.sql;h=c7e24ea8f17e4c6ff526b0f8717ec62fd63cc50a;hb=44ccb2f192f0a85f3ba43d0cde703fae7d1d8bfd;hp=c43ce87480555284f163e3e16e49c4eb477e3dbd;hpb=b2c2f2af614515f2c5fec3dfad91e84e595bdd71;p=collectd_dbstore.git diff --git a/sql/metrics.sql b/sql/metrics.sql index c43ce87..c7e24ea 100644 --- a/sql/metrics.sql +++ b/sql/metrics.sql @@ -2,35 +2,6 @@ -- This is free software; you can redistribute it and/or modify it under -- the terms of the GNU General Public License as published by the Free -- Software Foundation; only version 2 of the License is applicable. -drop table metrics cascade; -drop table hostname_dimension cascade; -drop table plugin_dimension cascade; -drop table type_dimension cascade; -drop type datasource_type cascade; - -create type datasource_type as ENUM ('GUAGE', 'COUNTER'); - -create table metrics (id serial primary key, - timestamp timestamp, - measure double precision default 0, - hostname_id integer not null, - plugin_id integer not null, - type_id integer not null - ); - -create table hostname_dimension (id serial primary key, - hostname varchar(64) not null); - -create table plugin_dimension (id serial primary key, - plugin varchar(64) not null, - plugin_instance varchar(64)); - -create table type_dimension (id serial primary key, - ds_type datasource_type, - type varchar(64) not null, - type_name varchar(64) not null, - type_instance varchar(64)); - create or replace function insert_metric(in_timestamp timestamp, in_measure double precision, in_hostname text,