Skip to content
Snippets Groups Projects
Verified Commit 211987c9 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Added queries/policies for managing events

parent 0c55d9f6
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -29,6 +29,10 @@ task :policies do
CLIENT.create_retention_policy('downsampled', db, '7d', 1)
end
 
unless policy_names.include?('year')
CLIENT.create_retention_policy('year', db, '52w', 1)
end
unless policy_names.include?('forever')
CLIENT.create_retention_policy('forever', db, 'INF', 1)
end
Loading
Loading
CREATE CONTINUOUS QUERY builds_per_project_per_hour ON $DATABASE
BEGIN
SELECT sum(count) AS "count"
INTO year.builds_per_project_per_hour
FROM "default".events
WHERE "event" = 'build_found'
GROUP BY time(1h), project
END
CREATE CONTINUOUS QUERY commits_pushed_to_master_per_hour ON $DATABASE
BEGIN
SELECT sum(count) AS "count"
INTO year.commits_pushed_to_master_per_hour
FROM "default".events
WHERE "event" = 'push_commit'
AND "branch" = 'master'
GROUP BY time(1h)
END
CREATE CONTINUOUS QUERY commits_pushed_to_non_master_per_hour ON $DATABASE
BEGIN
SELECT sum(count) AS "count"
INTO year.commits_pushed_to_non_master_per_hour
FROM "default".events
WHERE "event" = 'push_commit'
AND "branch" != 'master'
GROUP BY time(1h)
END
CREATE CONTINUOUS QUERY events_per_hour ON $DATABASE
BEGIN
SELECT sum(count) AS "count"
INTO year.events_per_hour
FROM "default".events
GROUP BY time(1h), "event"
END
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment