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

Added queries for memory allocations

These queries calculate the allocated memory per Rails/Grape/Sidekiq
controller/worker per minute. This data includes the 95th percentile,
the 99th percentile, the mean, and the max value.
parent 7b68bf80
No related branches found
No related tags found
No related merge requests found
CREATE CONTINUOUS QUERY grape_allocated_memory_per_action ON $DATABASE
BEGIN
SELECT percentile(allocated_memory, 95) AS allocated_memory_95th,
percentile(allocated_memory, 99) AS allocated_memory_99th,
mean(allocated_memory) AS allocated_memory_mean,
max(allocated_memory) AS allocated_memory_max
INTO downsampled.grape_allocated_memory_per_action
FROM "$DEFAULT_RETENTION_POLICY".rails_transactions
WHERE action =~ /^Grape#/
GROUP BY time(1m), action
END
CREATE CONTINUOUS QUERY rails_allocated_memory_per_action ON $DATABASE
BEGIN
SELECT percentile(allocated_memory, 95) AS allocated_memory_95th,
percentile(allocated_memory, 99) AS allocated_memory_99th,
mean(allocated_memory) AS allocated_memory_mean,
max(allocated_memory) AS allocated_memory_max
INTO downsampled.rails_allocated_memory_per_action
FROM "$DEFAULT_RETENTION_POLICY".rails_transactions
WHERE action =~ /.+/
AND action !~ /^Grape#/
GROUP BY time(1m), action
END
CREATE CONTINUOUS QUERY sidekiq_allocated_memory_per_action ON $DATABASE
BEGIN
SELECT percentile(allocated_memory, 95) AS allocated_memory_95th,
percentile(allocated_memory, 99) AS allocated_memory_99th,
mean(allocated_memory) AS allocated_memory_mean,
max(allocated_memory) AS allocated_memory_max
INTO downsampled.sidekiq_allocated_memory_per_action
FROM "$DEFAULT_RETENTION_POLICY".sidekiq_transactions
GROUP BY time(1m), action
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