timescaledb/test/sql/telemetry_community.sql
Matvey Arye 1e9bc6895b Add telemetry fields to track compression
The following fields are added:
-num_compressed_hypertables
-compressed_KIND_size
-uncompressed_KIND_size

Where KIND = heap, index, toast.

`num_hypertables` field does NOT count the internal hypertables
used for compressed data.

We also removed internal continuous aggs tables from the
`num_hypertables` count.
2019-10-29 19:02:58 -04:00

40 lines
2.1 KiB
SQL

-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
--telemetry tests that require a community license
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'num_continuous_aggs');
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'num_hypertables');
-- check telemetry picks up flagged content from metadata
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'db_metadata');
-- check timescaledb_telemetry.cloud
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'instance_metadata');
--create a continuous agg
CREATE TABLE device_readings (
observation_time TIMESTAMPTZ NOT NULL
);
SELECT table_name FROM create_hypertable('device_readings', 'observation_time');
CREATE VIEW device_summary
WITH (timescaledb.continuous) AS
SELECT
time_bucket('1 hour', observation_time) as bucket,
min(observation_time)
FROM
device_readings
GROUP BY bucket;
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'num_continuous_aggs');
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'num_hypertables');
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'num_compressed_hypertables');
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'compressed_heap_size');
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'compressed_index_size');
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'compressed_toast_size');
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'uncompressed_heap_size');
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'uncompressed_index_size');
SELECT json_object_field(get_telemetry_report(always_display_report := true)::json,'uncompressed_toast_size');