Shows information and statistics about jobs run by the automation framework. This includes jobs set up for user defined actions and jobs run by policies created to manage data retention, continuous aggregates, compression, and other automation policies. (See policies). The statistics include information useful for administering jobs and determining whether they ought be rescheduled, such as: when and whether the background job used to implement the policy succeeded and when it is scheduled to run next.
|TEXT||Schema name of the hypertable|
|TEXT||Table name of the hypertable|
|INTEGER||The id of the background job created to implement the policy|
|TIMESTAMP WITH TIME ZONE||Start time of the last job|
|TIMESTAMP WITH TIME ZONE||Time when the job completed successfully|
|TEXT||Whether the last run succeeded or failed|
|TEXT||Status of the job. Valid values are 'Running', 'Scheduled' and 'Paused'|
|INTERVAL||Duration of last run of the job|
|TIMESTAMP WITH TIME ZONE||Start time of the next run|
|BIGINT||The total number of runs of this job|
|BIGINT||The total number of times this job succeeded|
|BIGINT||The total number of times this job failed|
Get job success/failure information for a specific hypertable.
SELECT job_id, total_runs, total_failures, total_successesFROM timescaledb_information.job_statsWHERE hypertable_name = 'test_table';job_id | total_runs | total_failures | total_successes--------+------------+----------------+-----------------1001 | 1 | 0 | 11004 | 1 | 0 | 1(2 rows)
Get information about continuous aggregate policy related statistics
SELECT js.* FROMtimescaledb_information.job_stats js, timescaledb_information.continuous_aggregates caggWHERE cagg.view_name = 'max_mat_view_timestamp'and cagg.materialization_hypertable_name = js.hypertable_name;-[ RECORD 1 ]----------+------------------------------hypertable_schema | _timescaledb_internalhypertable_name | _materialized_hypertable_2job_id | 1001last_run_started_at | 2020-10-02 09:38:06.871953-04last_successful_finish | 2020-10-02 09:38:06.932675-04last_run_status | Successjob_status | Scheduledlast_run_duration | 00:00:00.060722next_start | 2020-10-02 10:38:06.932675-04total_runs | 1total_successes | 1total_failures | 0
Found an issue on this page?Report an issue!