summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-24 00:09:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-24 00:09:24 +0000
commit2711c26beaca6c3a5a3be4b65e01557faf0185b6 (patch)
tree25d0c2ddb47e87712044884f558a9104c686805f /spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb
parent8a7aaf86831d2a556578ae558a4fcab8bb659b20 (diff)
downloadgitlab-ce-2711c26beaca6c3a5a3be4b65e01557faf0185b6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb')
-rw-r--r--spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb b/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb
index d82b7665f85..4af233291f6 100644
--- a/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb
+++ b/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb
@@ -16,22 +16,22 @@ describe Gitlab::Prometheus::Queries::DeploymentQuery do
it 'sends appropriate queries to prometheus' do
start_time = (deployment.created_at - 30.minutes).to_f
- stop_time = (deployment.created_at + 30.minutes).to_f
+ end_time = (deployment.created_at + 30.minutes).to_f
created_at = deployment.created_at.to_f
expect(client).to receive(:query_range).with('avg(container_memory_usage_bytes{container_name!="POD",environment="environment-slug"}) / 2^20',
- start: start_time, stop: stop_time)
+ start_time: start_time, end_time: end_time)
expect(client).to receive(:query).with('avg(avg_over_time(container_memory_usage_bytes{container_name!="POD",environment="environment-slug"}[30m]))',
time: created_at)
expect(client).to receive(:query).with('avg(avg_over_time(container_memory_usage_bytes{container_name!="POD",environment="environment-slug"}[30m]))',
- time: stop_time)
+ time: end_time)
expect(client).to receive(:query_range).with('avg(rate(container_cpu_usage_seconds_total{container_name!="POD",environment="environment-slug"}[2m])) * 100',
- start: start_time, stop: stop_time)
+ start_time: start_time, end_time: end_time)
expect(client).to receive(:query).with('avg(rate(container_cpu_usage_seconds_total{container_name!="POD",environment="environment-slug"}[30m])) * 100',
time: created_at)
expect(client).to receive(:query).with('avg(rate(container_cpu_usage_seconds_total{container_name!="POD",environment="environment-slug"}[30m])) * 100',
- time: stop_time)
+ time: end_time)
expect(subject.query(deployment.id)).to eq(memory_values: nil, memory_before: nil, memory_after: nil,
cpu_values: nil, cpu_before: nil, cpu_after: nil)