diff options
Diffstat (limited to 'spec')
67 files changed, 2049 insertions, 6468 deletions
diff --git a/spec/controllers/projects/jobs_controller_spec.rb b/spec/controllers/projects/jobs_controller_spec.rb index bd30d4ee88b..9ef00fff3b2 100644 --- a/spec/controllers/projects/jobs_controller_spec.rb +++ b/spec/controllers/projects/jobs_controller_spec.rb @@ -101,7 +101,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do end end - describe 'GET show' do + describe 'GET show', :request_store do let!(:job) { create(:ci_build, :failed, pipeline: pipeline) } let!(:second_job) { create(:ci_build, :failed, pipeline: pipeline) } let!(:third_job) { create(:ci_build, :failed) } @@ -143,13 +143,24 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do project.add_developer(user) sign_in(user) - allow_any_instance_of(Ci::Build).to receive(:merge_request).and_return(merge_request) + allow_any_instance_of(Ci::Build) + .to receive(:merge_request) + .and_return(merge_request) + end + + it 'does not serialize builds in exposed stages' do + get_show_json - get_show(id: job.id, format: :json) + json_response.dig('pipeline', 'details', 'stages').tap do |stages| + expect(stages.map(&:keys).flatten) + .to eq %w[name title status path dropdown_path] + end end context 'when job failed' do it 'exposes needed information' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('job/job_details') expect(json_response['raw_path']).to match(%r{jobs/\d+/raw\z}) @@ -159,6 +170,10 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do end context 'when job is running' do + before do + get_show_json + end + context 'job is cancelable' do let(:job) { create(:ci_build, :running, pipeline: pipeline) } @@ -181,6 +196,10 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do end context 'when job has artifacts' do + before do + get_show_json + end + context 'with not expiry date' do let(:job) { create(:ci_build, :success, :artifacts, pipeline: pipeline) } @@ -212,6 +231,8 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do let(:job) { create(:ci_build, :success, :artifacts, pipeline: pipeline) } it 'exposes empty state illustrations' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('job/job_details') expect(json_response['status']['illustration']).to have_key('image') @@ -224,6 +245,8 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do let(:job) { create(:ci_build, :success, pipeline: pipeline) } it 'does not exposes the deployment information' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(json_response['deployment_status']).to be_nil end @@ -234,11 +257,20 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do let(:environment) { create(:environment, project: project, name: 'staging', state: :available) } let(:job) { create(:ci_build, :running, environment: environment.name, pipeline: pipeline) } + before do + create(:deployment, :success, environment: environment, project: project) + end + it 'exposes the deployment information' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(json_response).to match_schema('job/job_details') - expect(json_response['deployment_status']["status"]).to eq 'creating' - expect(json_response['deployment_status']["environment"]).not_to be_nil + expect(json_response.dig('deployment_status', 'status')).to eq 'creating' + expect(json_response.dig('deployment_status', 'environment')).not_to be_nil + expect(json_response.dig('deployment_status', 'environment', 'last_deployment')).not_to be_nil + expect(json_response.dig('deployment_status', 'environment', 'last_deployment')) + .not_to include('commit') end end @@ -250,11 +282,11 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do before do project.add_maintainer(user) sign_in(user) - - get_show(id: job.id, format: :json) end it 'user can edit runner' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('job/job_details') expect(json_response['runner']).to have_key('edit_path') @@ -270,11 +302,11 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do before do project.add_maintainer(user) sign_in(user) - - get_show(id: job.id, format: :json) end it 'user can not edit runner' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('job/job_details') expect(json_response['runner']).not_to have_key('edit_path') @@ -289,11 +321,11 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do before do project.add_maintainer(user) sign_in(user) - - get_show(id: job.id, format: :json) end it 'user can not edit runner' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('job/job_details') expect(json_response['runner']).not_to have_key('edit_path') @@ -306,6 +338,8 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do let(:job) { create(:ci_build, :pending, pipeline: pipeline, runner: runner) } it 'exposes needed information' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('job/job_details') expect(json_response['runners']['online']).to be false @@ -319,6 +353,8 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do let(:job) { create(:ci_build, :pending, pipeline: pipeline, runner: runner) } it 'exposes needed information' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('job/job_details') expect(json_response['runners']['online']).to be false @@ -328,6 +364,10 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do end context 'settings_path' do + before do + get_show_json + end + context 'when user is developer' do it 'settings_path is not available' do expect(response).to have_gitlab_http_status(:ok) @@ -354,6 +394,8 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do context 'when no trace is available' do it 'has_trace is false' do + get_show_json + expect(response).to match_response_schema('job/job_details') expect(json_response['has_trace']).to be false end @@ -363,17 +405,21 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do let(:job) { create(:ci_build, :running, :trace_live, pipeline: pipeline) } it "has_trace is true" do + get_show_json + expect(response).to match_response_schema('job/job_details') expect(json_response['has_trace']).to be true end end it 'exposes the stage the job belongs to' do + get_show_json + expect(json_response['stage']).to eq('test') end end - context 'when requesting JSON job is triggered' do + context 'when requesting triggered job JSON' do let!(:merge_request) { create(:merge_request, source_project: project) } let(:trigger) { create(:ci_trigger, project: project) } let(:trigger_request) { create(:ci_trigger_request, pipeline: pipeline, trigger: trigger) } @@ -383,15 +429,15 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do project.add_developer(user) sign_in(user) - allow_any_instance_of(Ci::Build).to receive(:merge_request).and_return(merge_request) + allow_any_instance_of(Ci::Build) + .to receive(:merge_request) + .and_return(merge_request) end context 'with no variables' do - before do - get_show(id: job.id, format: :json) - end - it 'exposes trigger information' do + get_show_json + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('job/job_details') expect(json_response['trigger']['short_token']).to eq 'toke' @@ -408,7 +454,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do before do project.add_maintainer(user) - get_show(id: job.id, format: :json) + get_show_json end it 'returns a job_detail' do @@ -432,7 +478,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do context 'user is not a mantainer' do before do - get_show(id: job.id, format: :json) + get_show_json end it 'returns a job_detail' do @@ -456,6 +502,11 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do end end + def get_show_json + expect { get_show(id: job.id, format: :json) } + .not_to change { Gitlab::GitalyClient.get_request_count } + end + def get_show(**extra_params) params = { namespace_id: project.namespace.to_param, diff --git a/spec/features/admin/admin_sees_project_statistics_spec.rb b/spec/features/admin/admin_sees_project_statistics_spec.rb index 95d1fc5b57a..b5323a1c76d 100644 --- a/spec/features/admin/admin_sees_project_statistics_spec.rb +++ b/spec/features/admin/admin_sees_project_statistics_spec.rb @@ -15,7 +15,7 @@ describe "Admin > Admin sees project statistics" do let(:project) { create(:project, :repository) } it "shows project statistics" do - expect(page).to have_content("Storage: 0 Bytes (0 Bytes repositories, 0 Bytes build artifacts, 0 Bytes LFS)") + expect(page).to have_content("Storage: 0 Bytes (0 Bytes repositories, 0 Bytes wikis, 0 Bytes build artifacts, 0 Bytes LFS)") end end diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index 87c0dc40e5c..b1798c11361 100644 --- a/spec/features/boards/sidebar_spec.rb +++ b/spec/features/boards/sidebar_spec.rb @@ -352,6 +352,8 @@ describe 'Issue Boards', :js do page.within('.labels') do click_link 'Edit' + wait_for_requests + click_link 'Create project label' fill_in 'new_label_name', with: 'test label' first('.suggest-colors-dropdown a').click @@ -368,6 +370,8 @@ describe 'Issue Boards', :js do page.within('.labels') do click_link 'Edit' + wait_for_requests + click_link 'Create project label' fill_in 'new_label_name', with: 'test label' first('.suggest-colors-dropdown a').click diff --git a/spec/features/projects/files/project_owner_creates_license_file_spec.rb b/spec/features/projects/files/project_owner_creates_license_file_spec.rb index 6762460971f..44715261b8b 100644 --- a/spec/features/projects/files/project_owner_creates_license_file_spec.rb +++ b/spec/features/projects/files/project_owner_creates_license_file_spec.rb @@ -5,6 +5,7 @@ describe 'Projects > Files > Project owner creates a license file', :js do let(:project_maintainer) { project.owner } before do + stub_feature_flags(vue_file_list: false) project.repository.delete_file(project_maintainer, 'LICENSE', message: 'Remove LICENSE', branch_name: 'master') sign_in(project_maintainer) diff --git a/spec/features/projects/files/user_creates_files_spec.rb b/spec/features/projects/files/user_creates_files_spec.rb index dd2964c2186..69f8bd4d319 100644 --- a/spec/features/projects/files/user_creates_files_spec.rb +++ b/spec/features/projects/files/user_creates_files_spec.rb @@ -12,6 +12,7 @@ describe 'Projects > Files > User creates files' do let(:user) { create(:user) } before do + stub_feature_flags(vue_file_list: false) stub_feature_flags(web_ide_default: false) project.add_maintainer(user) diff --git a/spec/features/projects/labels/user_promotes_label_spec.rb b/spec/features/projects/labels/user_promotes_label_spec.rb new file mode 100644 index 00000000000..fdecafd4c50 --- /dev/null +++ b/spec/features/projects/labels/user_promotes_label_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'User promotes label' do + set(:group) { create(:group) } + set(:user) { create(:user) } + set(:project) { create(:project, namespace: group) } + set(:label) { create(:label, project: project) } + + context 'when user can admin group labels' do + before do + group.add_developer(user) + sign_in(user) + visit(project_labels_path(project)) + end + + it "shows label promote button" do + expect(page).to have_selector('.js-promote-project-label-button') + end + end + + context 'when user cannot admin group labels' do + before do + project.add_developer(user) + sign_in(user) + visit(project_labels_path(project)) + end + + it "does not show label promote button" do + expect(page).not_to have_selector('.js-promote-project-label-button') + end + end +end diff --git a/spec/features/projects/labels/user_removes_labels_spec.rb b/spec/features/projects/labels/user_removes_labels_spec.rb index b0ce03a1c31..c231e54decd 100644 --- a/spec/features/projects/labels/user_removes_labels_spec.rb +++ b/spec/features/projects/labels/user_removes_labels_spec.rb @@ -21,8 +21,11 @@ describe "User removes labels" do page.first(".label-list-item") do first('.js-label-options-dropdown').click first(".remove-row").click - first(:link, "Delete label").click end + + expect(page).to have_content("#{label.title} will be permanently deleted from #{project.name}. This cannot be undone.") + + first(:link, "Delete label").click end expect(page).to have_content("Label was removed").and have_no_content(label.title) diff --git a/spec/features/projects/show/user_sees_collaboration_links_spec.rb b/spec/features/projects/show/user_sees_collaboration_links_spec.rb index 24777788248..46586b891e7 100644 --- a/spec/features/projects/show/user_sees_collaboration_links_spec.rb +++ b/spec/features/projects/show/user_sees_collaboration_links_spec.rb @@ -5,6 +5,7 @@ describe 'Projects > Show > Collaboration links' do let(:user) { create(:user) } before do + stub_feature_flags(vue_file_list: false) project.add_developer(user) sign_in(user) end diff --git a/spec/fixtures/api/schemas/environment.json b/spec/fixtures/api/schemas/environment.json index 9a10ab18c30..5b1e3c049fa 100644 --- a/spec/fixtures/api/schemas/environment.json +++ b/spec/fixtures/api/schemas/environment.json @@ -31,7 +31,11 @@ "last_deployment": { "oneOf": [ { "type": "null" }, - { "$ref": "deployment.json" } + { "$ref": "deployment.json" }, + { + "name": { "type": "string" }, + "build_path": { "type": "string" } + } ] } }, diff --git a/spec/frontend/ide/stores/mutations/branch_spec.js b/spec/frontend/ide/stores/mutations/branch_spec.js index 29eb859ddaf..0900b25d5d3 100644 --- a/spec/frontend/ide/stores/mutations/branch_spec.js +++ b/spec/frontend/ide/stores/mutations/branch_spec.js @@ -37,4 +37,39 @@ describe('Multi-file store branch mutations', () => { expect(localState.projects.Example.branches.master.commit.title).toBe('Example commit'); }); }); + + describe('SET_BRANCH_WORKING_REFERENCE', () => { + beforeEach(() => { + localState.projects = { + Foo: { + branches: { + bar: {}, + }, + }, + }; + }); + + it('sets workingReference for existing branch', () => { + mutations.SET_BRANCH_WORKING_REFERENCE(localState, { + projectId: 'Foo', + branchId: 'bar', + reference: 'foo-bar-ref', + }); + + expect(localState.projects.Foo.branches.bar.workingReference).toBe('foo-bar-ref'); + }); + + it('does not fail on non-existent just yet branch', () => { + expect(localState.projects.Foo.branches.unknown).toBeUndefined(); + + mutations.SET_BRANCH_WORKING_REFERENCE(localState, { + projectId: 'Foo', + branchId: 'unknown', + reference: 'fun-fun-ref', + }); + + expect(localState.projects.Foo.branches.unknown).not.toBeUndefined(); + expect(localState.projects.Foo.branches.unknown.workingReference).toBe('fun-fun-ref'); + }); + }); }); diff --git a/spec/frontend/ide/stores/mutations/project_spec.js b/spec/frontend/ide/stores/mutations/project_spec.js new file mode 100644 index 00000000000..b3ce39c33d2 --- /dev/null +++ b/spec/frontend/ide/stores/mutations/project_spec.js @@ -0,0 +1,23 @@ +import mutations from '~/ide/stores/mutations/project'; +import state from '~/ide/stores/state'; + +describe('Multi-file store branch mutations', () => { + let localState; + + beforeEach(() => { + localState = state(); + localState.projects = { abcproject: { empty_repo: true } }; + }); + + describe('TOGGLE_EMPTY_STATE', () => { + it('sets empty_repo for project to passed value', () => { + mutations.TOGGLE_EMPTY_STATE(localState, { projectPath: 'abcproject', value: false }); + + expect(localState.projects.abcproject.empty_repo).toBe(false); + + mutations.TOGGLE_EMPTY_STATE(localState, { projectPath: 'abcproject', value: true }); + + expect(localState.projects.abcproject.empty_repo).toBe(true); + }); + }); +}); diff --git a/spec/frontend/jobs/store/mutations_spec.js b/spec/frontend/jobs/store/mutations_spec.js index d7908efcf13..343301b8716 100644 --- a/spec/frontend/jobs/store/mutations_spec.js +++ b/spec/frontend/jobs/store/mutations_spec.js @@ -150,44 +150,8 @@ describe('Jobs Store Mutations', () => { }); }); - describe('REQUEST_STAGES', () => { - it('sets isLoadingStages to true', () => { - mutations[types.REQUEST_STAGES](stateCopy); - - expect(stateCopy.isLoadingStages).toEqual(true); - }); - }); - - describe('RECEIVE_STAGES_SUCCESS', () => { - beforeEach(() => { - mutations[types.RECEIVE_STAGES_SUCCESS](stateCopy, [{ name: 'build' }]); - }); - - it('sets isLoadingStages to false', () => { - expect(stateCopy.isLoadingStages).toEqual(false); - }); - - it('sets stages', () => { - expect(stateCopy.stages).toEqual([{ name: 'build' }]); - }); - }); - - describe('RECEIVE_STAGES_ERROR', () => { - beforeEach(() => { - mutations[types.RECEIVE_STAGES_ERROR](stateCopy); - }); - - it('sets isLoadingStages to false', () => { - expect(stateCopy.isLoadingStages).toEqual(false); - }); - - it('resets stages', () => { - expect(stateCopy.stages).toEqual([]); - }); - }); - describe('REQUEST_JOBS_FOR_STAGE', () => { - it('sets isLoadingStages to true', () => { + it('sets isLoadingJobs to true', () => { mutations[types.REQUEST_JOBS_FOR_STAGE](stateCopy, { name: 'deploy' }); expect(stateCopy.isLoadingJobs).toEqual(true); diff --git a/spec/javascripts/lib/utils/datetime_utility_spec.js b/spec/frontend/lib/utils/datetime_utility_spec.js index 5327ec9d2a0..9f49e68cfe8 100644 --- a/spec/javascripts/lib/utils/datetime_utility_spec.js +++ b/spec/frontend/lib/utils/datetime_utility_spec.js @@ -65,6 +65,26 @@ describe('Date time utils', () => { }); }); + describe('formatDate', () => { + it('should format date properly', () => { + const formattedDate = datetimeUtility.formatDate(new Date('07/23/2016')); + + expect(formattedDate).toBe('Jul 23, 2016 12:00am GMT+0000'); + }); + + it('should format ISO date properly', () => { + const formattedDate = datetimeUtility.formatDate('2016-07-23T00:00:00.559Z'); + + expect(formattedDate).toBe('Jul 23, 2016 12:00am GMT+0000'); + }); + + it('should throw an error if date is invalid', () => { + expect(() => { + datetimeUtility.formatDate('2016-07-23 00:00:00 UTC'); + }).toThrow(new Error('Invalid date')); + }); + }); + describe('get day difference', () => { it('should return 7', () => { const firstDay = new Date('07/01/2016'); @@ -380,7 +400,7 @@ describe('prettyTime methods', () => { describe('calculateRemainingMilliseconds', () => { beforeEach(() => { - spyOn(Date, 'now').and.callFake(() => new Date('2063-04-04T00:42:00Z').getTime()); + jest.spyOn(Date, 'now').mockImplementation(() => new Date('2063-04-04T00:42:00Z').getTime()); }); it('calculates the remaining time for a given end date', () => { diff --git a/spec/frontend/mr_popover/__snapshots__/mr_popover_spec.js.snap b/spec/frontend/mr_popover/__snapshots__/mr_popover_spec.js.snap index 5f9f13d591d..a2a7d0ee91e 100644 --- a/spec/frontend/mr_popover/__snapshots__/mr_popover_spec.js.snap +++ b/spec/frontend/mr_popover/__snapshots__/mr_popover_spec.js.snap @@ -3,6 +3,7 @@ exports[`MR Popover loaded state matches the snapshot 1`] = ` <glpopover-stub boundary="viewport" + cssclasses="" placement="top" show="" target="" @@ -61,6 +62,7 @@ exports[`MR Popover loaded state matches the snapshot 1`] = ` exports[`MR Popover shows skeleton-loader while apollo is loading 1`] = ` <glpopover-stub boundary="viewport" + cssclasses="" placement="top" show="" target="" diff --git a/spec/frontend/repository/components/breadcrumbs_spec.js b/spec/frontend/repository/components/breadcrumbs_spec.js new file mode 100644 index 00000000000..068fa317a87 --- /dev/null +++ b/spec/frontend/repository/components/breadcrumbs_spec.js @@ -0,0 +1,44 @@ +import { shallowMount, RouterLinkStub } from '@vue/test-utils'; +import Breadcrumbs from '~/repository/components/breadcrumbs.vue'; + +let vm; + +function factory(currentPath) { + vm = shallowMount(Breadcrumbs, { + propsData: { + currentPath, + }, + stubs: { + RouterLink: RouterLinkStub, + }, + }); +} + +describe('Repository breadcrumbs component', () => { + afterEach(() => { + vm.destroy(); + }); + + it.each` + path | linkCount + ${'/'} | ${1} + ${'app'} | ${2} + ${'app/assets'} | ${3} + ${'app/assets/javascripts'} | ${4} + `('renders $linkCount links for path $path', ({ path, linkCount }) => { + factory(path); + + expect(vm.findAll(RouterLinkStub).length).toEqual(linkCount); + }); + + it('renders last link as active', () => { + factory('app/assets'); + + expect( + vm + .findAll(RouterLinkStub) + .at(2) + .attributes('aria-current'), + ).toEqual('page'); + }); +}); diff --git a/spec/frontend/repository/utils/title_spec.js b/spec/frontend/repository/utils/title_spec.js new file mode 100644 index 00000000000..c4879716fd7 --- /dev/null +++ b/spec/frontend/repository/utils/title_spec.js @@ -0,0 +1,15 @@ +import { setTitle } from '~/repository/utils/title'; + +describe('setTitle', () => { + it.each` + path | title + ${'/'} | ${'Files'} + ${'app'} | ${'app'} + ${'app/assets'} | ${'app/assets'} + ${'app/assets/javascripts'} | ${'app/assets/javascripts'} + `('sets document title as $title for $path', ({ path, title }) => { + setTitle(path, 'master', 'GitLab'); + + expect(document.title).toEqual(`${title} · master · GitLab`); + }); +}); diff --git a/spec/graphql/gitlab_schema_spec.rb b/spec/graphql/gitlab_schema_spec.rb index c138c87c4ac..e9149f4250f 100644 --- a/spec/graphql/gitlab_schema_spec.rb +++ b/spec/graphql/gitlab_schema_spec.rb @@ -56,10 +56,10 @@ describe GitlabSchema do described_class.execute('query', context: {}) end - it 'returns ANONYMOUS_MAX_DEPTH' do + it 'returns DEFAULT_MAX_DEPTH' do expect(GraphQL::Schema) .to receive(:execute) - .with('query', hash_including(max_depth: GitlabSchema::ANONYMOUS_MAX_DEPTH)) + .with('query', hash_including(max_depth: GitlabSchema::DEFAULT_MAX_DEPTH)) described_class.execute('query', context: {}) end diff --git a/spec/helpers/environments_helper_spec.rb b/spec/helpers/environments_helper_spec.rb new file mode 100644 index 00000000000..0c8a8d2f032 --- /dev/null +++ b/spec/helpers/environments_helper_spec.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe EnvironmentsHelper do + set(:environment) { create(:environment) } + set(:project) { environment.project } + set(:user) { create(:user) } + + describe '#metrics_data' do + before do + # This is so that this spec also passes in EE. + allow(helper).to receive(:current_user).and_return(user) + allow(helper).to receive(:can?).and_return(true) + end + + let(:metrics_data) { helper.metrics_data(project, environment) } + + it 'returns data' do + expect(metrics_data).to include( + 'settings-path' => edit_project_service_path(project, 'prometheus'), + 'clusters-path' => project_clusters_path(project), + 'current-environment-name': environment.name, + 'documentation-path' => help_page_path('administration/monitoring/prometheus/index.md'), + 'empty-getting-started-svg-path' => match_asset_path('/assets/illustrations/monitoring/getting_started.svg'), + 'empty-loading-svg-path' => match_asset_path('/assets/illustrations/monitoring/loading.svg'), + 'empty-no-data-svg-path' => match_asset_path('/assets/illustrations/monitoring/no_data.svg'), + 'empty-unable-to-connect-svg-path' => match_asset_path('/assets/illustrations/monitoring/unable_to_connect.svg'), + 'metrics-endpoint' => additional_metrics_project_environment_path(project, environment, format: :json), + 'deployment-endpoint' => project_environment_deployments_path(project, environment, format: :json), + 'environments-endpoint': project_environments_path(project, format: :json), + 'project-path' => project_path(project), + 'tags-path' => project_tags_path(project), + 'has-metrics' => "#{environment.has_metrics?}", + 'external-dashboard-url' => nil + ) + end + + context 'with metrics_setting' do + before do + create(:project_metrics_setting, project: project, external_dashboard_url: 'http://gitlab.com') + end + + it 'adds external_dashboard_url' do + expect(metrics_data['external-dashboard-url']).to eq('http://gitlab.com') + end + end + end +end diff --git a/spec/helpers/labels_helper_spec.rb b/spec/helpers/labels_helper_spec.rb index 58eaf991d6e..314305d7a8e 100644 --- a/spec/helpers/labels_helper_spec.rb +++ b/spec/helpers/labels_helper_spec.rb @@ -6,7 +6,7 @@ describe LabelsHelper do let(:context_project) { project } context "when asking for a #{issuables_type} link" do - subject { show_label_issuables_link?(label, issuables_type, project: context_project) } + subject { show_label_issuables_link?(label.present(issuable_subject: nil), issuables_type, project: context_project) } context "when #{issuables_type} are enabled for the project" do let(:project) { create(:project, "#{issuables_type}_access_level": ProjectFeature::ENABLED) } @@ -279,4 +279,21 @@ describe LabelsHelper do expect(label.color).to eq('bar') end end + + describe '#label_status_tooltip' do + let(:status) { 'unsubscribed'.inquiry } + subject { label_status_tooltip(label.present(issuable_subject: nil), status) } + + context 'with a project label' do + let(:label) { create(:label, title: 'bug') } + + it { is_expected.to eq('Subscribe at project level') } + end + + context 'with a group label' do + let(:label) { create(:group_label, title: 'bug') } + + it { is_expected.to eq('Subscribe at group level') } + end + end end diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index 83271aa24a3..3716879c458 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -819,4 +819,26 @@ describe ProjectsHelper do expect(helper.can_import_members?).to eq true end end + + describe '#metrics_external_dashboard_url' do + let(:project) { create(:project) } + + before do + helper.instance_variable_set(:@project, project) + end + + context 'metrics_setting exists' do + it 'returns external_dashboard_url' do + metrics_setting = create(:project_metrics_setting, project: project) + + expect(helper.metrics_external_dashboard_url).to eq(metrics_setting.external_dashboard_url) + end + end + + context 'metrics_setting does not exist' do + it 'returns nil' do + expect(helper.metrics_external_dashboard_url).to eq(nil) + end + end + end end diff --git a/spec/helpers/storage_helper_spec.rb b/spec/helpers/storage_helper_spec.rb index 50c74a7c2f9..62c00964524 100644 --- a/spec/helpers/storage_helper_spec.rb +++ b/spec/helpers/storage_helper_spec.rb @@ -26,11 +26,12 @@ describe StorageHelper do namespace: namespace, statistics: build(:project_statistics, repository_size: 10.kilobytes, + wiki_size: 10.bytes, lfs_objects_size: 20.gigabytes, build_artifacts_size: 30.megabytes)) end - let(:message) { '10 KB repositories, 30 MB build artifacts, 20 GB LFS' } + let(:message) { '10 KB repositories, 10 Bytes wikis, 30 MB build artifacts, 20 GB LFS' } it 'works on ProjectStatistics' do expect(helper.storage_counters_details(project.statistics)).to eq(message) diff --git a/spec/initializers/secret_token_spec.rb b/spec/initializers/secret_token_spec.rb index 77bc28a6b07..726ce07a2d1 100644 --- a/spec/initializers/secret_token_spec.rb +++ b/spec/initializers/secret_token_spec.rb @@ -45,21 +45,11 @@ describe 'create_tokens' do expect(keys).to all(match(RSA_KEY)) end - it "generates private key for Let's Encrypt" do - create_tokens - - keys = secrets.values_at(:lets_encrypt_private_key) - - expect(keys.uniq).to eq(keys) - expect(keys).to all(match(RSA_KEY)) - end - it 'warns about the secrets to add to secrets.yml' do expect(self).to receive(:warn_missing_secret).with('secret_key_base') expect(self).to receive(:warn_missing_secret).with('otp_key_base') expect(self).to receive(:warn_missing_secret).with('db_key_base') expect(self).to receive(:warn_missing_secret).with('openid_connect_signing_key') - expect(self).to receive(:warn_missing_secret).with('lets_encrypt_private_key') create_tokens end @@ -88,7 +78,6 @@ describe 'create_tokens' do before do secrets.db_key_base = 'db_key_base' secrets.openid_connect_signing_key = 'openid_connect_signing_key' - secrets.lets_encrypt_private_key = 'lets_encrypt_private_key' allow(File).to receive(:exist?).with('.secret').and_return(true) allow(File).to receive(:read).with('.secret').and_return('file_key') diff --git a/spec/javascripts/ide/components/ide_spec.js b/spec/javascripts/ide/components/ide_spec.js index dc5790f6562..de4becec1cd 100644 --- a/spec/javascripts/ide/components/ide_spec.js +++ b/spec/javascripts/ide/components/ide_spec.js @@ -5,21 +5,53 @@ import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helpe import { file, resetStore } from '../helpers'; import { projectData } from '../mock_data'; -describe('ide component', () => { +function bootstrap(projData) { + const Component = Vue.extend(ide); + + store.state.currentProjectId = 'abcproject'; + store.state.currentBranchId = 'master'; + store.state.projects.abcproject = Object.assign({}, projData); + Vue.set(store.state.trees, 'abcproject/master', { + tree: [], + loading: false, + }); + + return createComponentWithStore(Component, store, { + emptyStateSvgPath: 'svg', + noChangesStateSvgPath: 'svg', + committedStateSvgPath: 'svg', + }); +} + +describe('ide component, empty repo', () => { let vm; beforeEach(() => { - const Component = Vue.extend(ide); + const emptyProjData = Object.assign({}, projectData, { empty_repo: true, branches: {} }); + vm = bootstrap(emptyProjData); + vm.$mount(); + }); - store.state.currentProjectId = 'abcproject'; - store.state.currentBranchId = 'master'; - store.state.projects.abcproject = Object.assign({}, projectData); + afterEach(() => { + vm.$destroy(); + + resetStore(vm.$store); + }); - vm = createComponentWithStore(Component, store, { - emptyStateSvgPath: 'svg', - noChangesStateSvgPath: 'svg', - committedStateSvgPath: 'svg', - }).$mount(); + it('renders "New file" button in empty repo', done => { + vm.$nextTick(() => { + expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).not.toBeNull(); + done(); + }); + }); +}); + +describe('ide component, non-empty repo', () => { + let vm; + + beforeEach(() => { + vm = bootstrap(projectData); + vm.$mount(); }); afterEach(() => { @@ -28,17 +60,15 @@ describe('ide component', () => { resetStore(vm.$store); }); - it('does not render right when no files open', () => { - expect(vm.$el.querySelector('.panel-right')).toBeNull(); - }); + it('shows error message when set', done => { + expect(vm.$el.querySelector('.flash-container')).toBe(null); - it('renders right panel when files are open', done => { - vm.$store.state.trees['abcproject/mybranch'] = { - tree: [file()], + vm.$store.state.errorMessage = { + text: 'error', }; - Vue.nextTick(() => { - expect(vm.$el.querySelector('.panel-right')).toBeNull(); + vm.$nextTick(() => { + expect(vm.$el.querySelector('.flash-container')).not.toBe(null); done(); }); @@ -71,17 +101,25 @@ describe('ide component', () => { }); }); - it('shows error message when set', done => { - expect(vm.$el.querySelector('.flash-container')).toBe(null); - - vm.$store.state.errorMessage = { - text: 'error', - }; + describe('non-existent branch', () => { + it('does not render "New file" button for non-existent branch when repo is not empty', done => { + vm.$nextTick(() => { + expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).toBeNull(); + done(); + }); + }); + }); - vm.$nextTick(() => { - expect(vm.$el.querySelector('.flash-container')).not.toBe(null); + describe('branch with files', () => { + beforeEach(() => { + store.state.trees['abcproject/master'].tree = [file()]; + }); - done(); + it('does not render "New file" button', done => { + vm.$nextTick(() => { + expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).toBeNull(); + done(); + }); }); }); }); diff --git a/spec/javascripts/ide/components/ide_tree_list_spec.js b/spec/javascripts/ide/components/ide_tree_list_spec.js index 4ecbdb8a55e..f63007c7dd2 100644 --- a/spec/javascripts/ide/components/ide_tree_list_spec.js +++ b/spec/javascripts/ide/components/ide_tree_list_spec.js @@ -7,25 +7,23 @@ import { projectData } from '../mock_data'; describe('IDE tree list', () => { const Component = Vue.extend(IdeTreeList); + const normalBranchTree = [file('fileName')]; + const emptyBranchTree = []; let vm; - beforeEach(() => { + const bootstrapWithTree = (tree = normalBranchTree) => { store.state.currentProjectId = 'abcproject'; store.state.currentBranchId = 'master'; store.state.projects.abcproject = Object.assign({}, projectData); Vue.set(store.state.trees, 'abcproject/master', { - tree: [file('fileName')], + tree, loading: false, }); vm = createComponentWithStore(Component, store, { viewerType: 'edit', }); - - spyOn(vm, 'updateViewer').and.callThrough(); - - vm.$mount(); - }); + }; afterEach(() => { vm.$destroy(); @@ -33,22 +31,47 @@ describe('IDE tree list', () => { resetStore(vm.$store); }); - it('updates viewer on mount', () => { - expect(vm.updateViewer).toHaveBeenCalledWith('edit'); - }); + describe('normal branch', () => { + beforeEach(() => { + bootstrapWithTree(); + + spyOn(vm, 'updateViewer').and.callThrough(); + + vm.$mount(); + }); + + it('updates viewer on mount', () => { + expect(vm.updateViewer).toHaveBeenCalledWith('edit'); + }); + + it('renders loading indicator', done => { + store.state.trees['abcproject/master'].loading = true; - it('renders loading indicator', done => { - store.state.trees['abcproject/master'].loading = true; + vm.$nextTick(() => { + expect(vm.$el.querySelector('.multi-file-loading-container')).not.toBeNull(); + expect(vm.$el.querySelectorAll('.multi-file-loading-container').length).toBe(3); - vm.$nextTick(() => { - expect(vm.$el.querySelector('.multi-file-loading-container')).not.toBeNull(); - expect(vm.$el.querySelectorAll('.multi-file-loading-container').length).toBe(3); + done(); + }); + }); - done(); + it('renders list of files', () => { + expect(vm.$el.textContent).toContain('fileName'); }); }); - it('renders list of files', () => { - expect(vm.$el.textContent).toContain('fileName'); + describe('empty-branch state', () => { + beforeEach(() => { + bootstrapWithTree(emptyBranchTree); + + spyOn(vm, 'updateViewer').and.callThrough(); + + vm.$mount(); + }); + + it('does not load files if the branch is empty', () => { + expect(vm.$el.textContent).not.toContain('fileName'); + expect(vm.$el.textContent).toContain('No files'); + }); }); }); diff --git a/spec/javascripts/ide/stores/actions/project_spec.js b/spec/javascripts/ide/stores/actions/project_spec.js index cd519eaed7c..8ecb6129c63 100644 --- a/spec/javascripts/ide/stores/actions/project_spec.js +++ b/spec/javascripts/ide/stores/actions/project_spec.js @@ -4,7 +4,7 @@ import { refreshLastCommitData, showBranchNotFoundError, createNewBranchFromDefault, - getBranchData, + showEmptyState, openBranch, } from '~/ide/stores/actions'; import store from '~/ide/stores'; @@ -196,39 +196,44 @@ describe('IDE store project actions', () => { }); }); - describe('getBranchData', () => { - describe('error', () => { - it('dispatches branch not found action when response is 404', done => { - const dispatch = jasmine.createSpy('dispatchSpy'); - - mock.onGet(/(.*)/).replyOnce(404); - - getBranchData( + describe('showEmptyState', () => { + it('commits proper mutations when supplied error is 404', done => { + testAction( + showEmptyState, + { + err: { + response: { + status: 404, + }, + }, + projectId: 'abc/def', + branchId: 'master', + }, + store.state, + [ { - commit() {}, - dispatch, - state: store.state, + type: 'CREATE_TREE', + payload: { + treePath: 'abc/def/master', + }, }, { - projectId: 'abc/def', - branchId: 'master-testing', + type: 'TOGGLE_LOADING', + payload: { + entry: store.state.trees['abc/def/master'], + forceValue: false, + }, }, - ) - .then(done.fail) - .catch(() => { - expect(dispatch.calls.argsFor(0)).toEqual([ - 'showBranchNotFoundError', - 'master-testing', - ]); - done(); - }); - }); + ], + [], + done, + ); }); }); describe('openBranch', () => { const branch = { - projectId: 'feature/lorem-ipsum', + projectId: 'abc/def', branchId: '123-lorem', }; @@ -238,63 +243,113 @@ describe('IDE store project actions', () => { 'foo/bar-pending': { pending: true }, 'foo/bar': { pending: false }, }; - - spyOn(store, 'dispatch').and.returnValue(Promise.resolve()); }); - it('dispatches branch actions', done => { - openBranch(store, branch) - .then(() => { - expect(store.dispatch.calls.allArgs()).toEqual([ - ['setCurrentBranchId', branch.branchId], - ['getBranchData', branch], - ['getFiles', branch], - ['getMergeRequestsForBranch', branch], - ]); - }) - .then(done) - .catch(done.fail); - }); + describe('empty repo', () => { + beforeEach(() => { + spyOn(store, 'dispatch').and.returnValue(Promise.resolve()); - it('handles tree entry action, if basePath is given', done => { - openBranch(store, { ...branch, basePath: 'foo/bar/' }) - .then(() => { - expect(store.dispatch).toHaveBeenCalledWith( - 'handleTreeEntryAction', - store.state.entries['foo/bar'], - ); - }) - .then(done) - .catch(done.fail); + store.state.currentProjectId = 'abc/def'; + store.state.projects['abc/def'] = { + empty_repo: true, + }; + }); + + afterEach(() => { + resetStore(store); + }); + + it('dispatches showEmptyState action right away', done => { + openBranch(store, branch) + .then(() => { + expect(store.dispatch.calls.allArgs()).toEqual([ + ['setCurrentBranchId', branch.branchId], + ['showEmptyState', branch], + ]); + done(); + }) + .catch(done.fail); + }); }); - it('does not handle tree entry action, if entry is pending', done => { - openBranch(store, { ...branch, basePath: 'foo/bar-pending' }) - .then(() => { - expect(store.dispatch).not.toHaveBeenCalledWith( - 'handleTreeEntryAction', - jasmine.anything(), - ); - }) - .then(done) - .catch(done.fail); + describe('existing branch', () => { + beforeEach(() => { + spyOn(store, 'dispatch').and.returnValue(Promise.resolve()); + }); + + it('dispatches branch actions', done => { + openBranch(store, branch) + .then(() => { + expect(store.dispatch.calls.allArgs()).toEqual([ + ['setCurrentBranchId', branch.branchId], + ['getBranchData', branch], + ['getMergeRequestsForBranch', branch], + ['getFiles', branch], + ]); + }) + .then(done) + .catch(done.fail); + }); + + it('handles tree entry action, if basePath is given', done => { + openBranch(store, { ...branch, basePath: 'foo/bar/' }) + .then(() => { + expect(store.dispatch).toHaveBeenCalledWith( + 'handleTreeEntryAction', + store.state.entries['foo/bar'], + ); + }) + .then(done) + .catch(done.fail); + }); + + it('does not handle tree entry action, if entry is pending', done => { + openBranch(store, { ...branch, basePath: 'foo/bar-pending' }) + .then(() => { + expect(store.dispatch).not.toHaveBeenCalledWith( + 'handleTreeEntryAction', + jasmine.anything(), + ); + }) + .then(done) + .catch(done.fail); + }); + + it('creates a new file supplied via URL if the file does not exist yet', done => { + openBranch(store, { ...branch, basePath: 'not-existent.md' }) + .then(() => { + expect(store.dispatch).not.toHaveBeenCalledWith( + 'handleTreeEntryAction', + jasmine.anything(), + ); + + expect(store.dispatch).toHaveBeenCalledWith('createTempEntry', { + name: 'not-existent.md', + type: 'blob', + }); + }) + .then(done) + .catch(done.fail); + }); }); - it('creates a new file supplied via URL if the file does not exist yet', done => { - openBranch(store, { ...branch, basePath: 'not-existent.md' }) - .then(() => { - expect(store.dispatch).not.toHaveBeenCalledWith( - 'handleTreeEntryAction', - jasmine.anything(), - ); + describe('non-existent branch', () => { + beforeEach(() => { + spyOn(store, 'dispatch').and.returnValue(Promise.reject()); + }); - expect(store.dispatch).toHaveBeenCalledWith('createTempEntry', { - name: 'not-existent.md', - type: 'blob', - }); - }) - .then(done) - .catch(done.fail); + it('dispatches correct branch actions', done => { + openBranch(store, branch) + .then(() => { + expect(store.dispatch.calls.allArgs()).toEqual([ + ['setCurrentBranchId', branch.branchId], + ['getBranchData', branch], + ['showBranchNotFoundError', branch.branchId], + ]); + }) + .then(done) + .catch(done.fail); + }); }); }); }); diff --git a/spec/javascripts/ide/stores/actions/tree_spec.js b/spec/javascripts/ide/stores/actions/tree_spec.js index 5ed9b9003a7..674ecdc6764 100644 --- a/spec/javascripts/ide/stores/actions/tree_spec.js +++ b/spec/javascripts/ide/stores/actions/tree_spec.js @@ -93,38 +93,6 @@ describe('Multi-file store tree actions', () => { }); describe('error', () => { - it('dispatches branch not found actions when response is 404', done => { - const dispatch = jasmine.createSpy('dispatchSpy'); - - store.state.projects = { - 'abc/def': { - web_url: `${gl.TEST_HOST}/files`, - }, - }; - - mock.onGet(/(.*)/).replyOnce(404); - - getFiles( - { - commit() {}, - dispatch, - state: store.state, - }, - { - projectId: 'abc/def', - branchId: 'master-testing', - }, - ) - .then(done.fail) - .catch(() => { - expect(dispatch.calls.argsFor(0)).toEqual([ - 'showBranchNotFoundError', - 'master-testing', - ]); - done(); - }); - }); - it('dispatches error action', done => { const dispatch = jasmine.createSpy('dispatchSpy'); diff --git a/spec/javascripts/ide/stores/actions_spec.js b/spec/javascripts/ide/stores/actions_spec.js index 0b5587d02ae..04e236fb042 100644 --- a/spec/javascripts/ide/stores/actions_spec.js +++ b/spec/javascripts/ide/stores/actions_spec.js @@ -9,12 +9,15 @@ import actions, { setErrorMessage, deleteEntry, renameEntry, + getBranchData, } from '~/ide/stores/actions'; +import axios from '~/lib/utils/axios_utils'; import store from '~/ide/stores'; import * as types from '~/ide/stores/mutation_types'; import router from '~/ide/ide_router'; import { resetStore, file } from '../helpers'; import testAction from '../../helpers/vuex_action_helper'; +import MockAdapter from 'axios-mock-adapter'; describe('Multi-file store actions', () => { beforeEach(() => { @@ -560,4 +563,65 @@ describe('Multi-file store actions', () => { ); }); }); + + describe('getBranchData', () => { + let mock; + + beforeEach(() => { + mock = new MockAdapter(axios); + }); + + afterEach(() => { + mock.restore(); + }); + + describe('error', () => { + let dispatch; + const callParams = [ + { + commit() {}, + state: store.state, + }, + { + projectId: 'abc/def', + branchId: 'master-testing', + }, + ]; + + beforeEach(() => { + dispatch = jasmine.createSpy('dispatchSpy'); + document.body.innerHTML += '<div class="flash-container"></div>'; + }); + + afterEach(() => { + document.querySelector('.flash-container').remove(); + }); + + it('passes the error further unchanged without dispatching any action when response is 404', done => { + mock.onGet(/(.*)/).replyOnce(404); + + getBranchData(...callParams) + .then(done.fail) + .catch(e => { + expect(dispatch.calls.count()).toEqual(0); + expect(e.response.status).toEqual(404); + expect(document.querySelector('.flash-alert')).toBeNull(); + done(); + }); + }); + + it('does not pass the error further and flashes an alert if error is not 404', done => { + mock.onGet(/(.*)/).replyOnce(418); + + getBranchData(...callParams) + .then(done.fail) + .catch(e => { + expect(dispatch.calls.count()).toEqual(0); + expect(e.response).toBeUndefined(); + expect(document.querySelector('.flash-alert')).not.toBeNull(); + done(); + }); + }); + }); + }); }); diff --git a/spec/javascripts/ide/stores/modules/commit/actions_spec.js b/spec/javascripts/ide/stores/modules/commit/actions_spec.js index cdeb9b4b896..4413a12fac4 100644 --- a/spec/javascripts/ide/stores/modules/commit/actions_spec.js +++ b/spec/javascripts/ide/stores/modules/commit/actions_spec.js @@ -272,6 +272,7 @@ describe('IDE commit module actions', () => { short_id: '123', message: 'test message', committed_date: 'date', + parent_ids: '321', stats: { additions: '1', deletions: '2', @@ -463,5 +464,63 @@ describe('IDE commit module actions', () => { .catch(done.fail); }); }); + + describe('first commit of a branch', () => { + const COMMIT_RESPONSE = { + id: '123456', + short_id: '123', + message: 'test message', + committed_date: 'date', + parent_ids: [], + stats: { + additions: '1', + deletions: '2', + }, + }; + + it('commits TOGGLE_EMPTY_STATE mutation on empty repo', done => { + spyOn(service, 'commit').and.returnValue( + Promise.resolve({ + data: COMMIT_RESPONSE, + }), + ); + + spyOn(store, 'commit').and.callThrough(); + + store + .dispatch('commit/commitChanges') + .then(() => { + expect(store.commit.calls.allArgs()).toEqual( + jasmine.arrayContaining([ + ['TOGGLE_EMPTY_STATE', jasmine.any(Object), jasmine.any(Object)], + ]), + ); + done(); + }) + .catch(done.fail); + }); + + it('does not commmit TOGGLE_EMPTY_STATE mutation on existing project', done => { + COMMIT_RESPONSE.parent_ids.push('1234'); + spyOn(service, 'commit').and.returnValue( + Promise.resolve({ + data: COMMIT_RESPONSE, + }), + ); + spyOn(store, 'commit').and.callThrough(); + + store + .dispatch('commit/commitChanges') + .then(() => { + expect(store.commit.calls.allArgs()).not.toEqual( + jasmine.arrayContaining([ + ['TOGGLE_EMPTY_STATE', jasmine.any(Object), jasmine.any(Object)], + ]), + ); + done(); + }) + .catch(done.fail); + }); + }); }); }); diff --git a/spec/javascripts/jobs/components/sidebar_spec.js b/spec/javascripts/jobs/components/sidebar_spec.js index 26d9effcac5..740bc3d0491 100644 --- a/spec/javascripts/jobs/components/sidebar_spec.js +++ b/spec/javascripts/jobs/components/sidebar_spec.js @@ -1,7 +1,7 @@ import Vue from 'vue'; import sidebarDetailsBlock from '~/jobs/components/sidebar.vue'; import createStore from '~/jobs/store'; -import job, { stages, jobsInStage } from '../mock_data'; +import job, { jobsInStage } from '../mock_data'; import { mountComponentWithStore } from '../../helpers/vue_mount_component_helper'; import { trimText } from '../../helpers/text_helper'; @@ -131,18 +131,8 @@ describe('Sidebar details block', () => { store.dispatch('receiveJobSuccess', job); }); - describe('while fetching stages', () => { - it('it does not render dropdown', () => { - store.dispatch('requestStages'); - vm = mountComponentWithStore(SidebarComponent, { store }); - - expect(vm.$el.querySelector('.js-selected-stage')).toBeNull(); - }); - }); - describe('with stages', () => { beforeEach(() => { - store.dispatch('receiveStagesSuccess', stages); vm = mountComponentWithStore(SidebarComponent, { store }); }); @@ -156,7 +146,6 @@ describe('Sidebar details block', () => { describe('without jobs for stages', () => { beforeEach(() => { store.dispatch('receiveJobSuccess', job); - store.dispatch('receiveStagesSuccess', stages); vm = mountComponentWithStore(SidebarComponent, { store }); }); @@ -168,7 +157,6 @@ describe('Sidebar details block', () => { describe('with jobs for stages', () => { beforeEach(() => { store.dispatch('receiveJobSuccess', job); - store.dispatch('receiveStagesSuccess', stages); store.dispatch('receiveJobsForStageSuccess', jobsInStage.latest_statuses); vm = mountComponentWithStore(SidebarComponent, { store }); }); diff --git a/spec/javascripts/jobs/mock_data.js b/spec/javascripts/jobs/mock_data.js index 1a7f338c5fa..3d40e94d219 100644 --- a/spec/javascripts/jobs/mock_data.js +++ b/spec/javascripts/jobs/mock_data.js @@ -3,140 +3,6 @@ import { TEST_HOST } from 'spec/test_constants'; const threeWeeksAgo = new Date(); threeWeeksAgo.setDate(threeWeeksAgo.getDate() - 21); -export default { - id: 4757, - name: 'test', - build_path: '/root/ci-mock/-/jobs/4757', - retry_path: '/root/ci-mock/-/jobs/4757/retry', - cancel_path: '/root/ci-mock/-/jobs/4757/cancel', - new_issue_path: '/root/ci-mock/issues/new', - playable: false, - created_at: threeWeeksAgo.toISOString(), - updated_at: threeWeeksAgo.toISOString(), - finished_at: threeWeeksAgo.toISOString(), - queued: 9.54, - status: { - icon: 'status_success', - text: 'passed', - label: 'passed', - group: 'success', - has_details: true, - details_path: `${TEST_HOST}/root/ci-mock/-/jobs/4757`, - favicon: - '/assets/ci_favicons/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.png', - action: { - icon: 'retry', - title: 'Retry', - path: '/root/ci-mock/-/jobs/4757/retry', - method: 'post', - }, - }, - coverage: 20, - erased_at: threeWeeksAgo.toISOString(), - erased: false, - duration: 6.785563, - tags: ['tag'], - user: { - name: 'Root', - username: 'root', - id: 1, - state: 'active', - avatar_url: - 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', - web_url: 'http://localhost:3000/root', - }, - erase_path: '/root/ci-mock/-/jobs/4757/erase', - artifacts: [null], - runner: { - id: 1, - description: 'local ci runner', - edit_path: '/root/ci-mock/runners/1/edit', - }, - pipeline: { - id: 140, - user: { - name: 'Root', - username: 'root', - id: 1, - state: 'active', - avatar_url: - 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', - web_url: 'http://localhost:3000/root', - }, - active: false, - coverage: null, - source: 'unknown', - created_at: '2017-05-24T09:59:58.634Z', - updated_at: '2017-06-01T17:32:00.062Z', - path: '/root/ci-mock/pipelines/140', - flags: { - latest: true, - stuck: false, - yaml_errors: false, - retryable: false, - cancelable: false, - }, - details: { - status: { - icon: 'status_success', - text: 'passed', - label: 'passed', - group: 'success', - has_details: true, - details_path: '/root/ci-mock/pipelines/140', - favicon: - '/assets/ci_favicons/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.png', - }, - duration: 6, - finished_at: '2017-06-01T17:32:00.042Z', - }, - ref: { - name: 'abc', - path: '/root/ci-mock/commits/abc', - tag: false, - branch: true, - }, - commit: { - id: 'c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', - short_id: 'c5864777', - title: 'Add new file', - created_at: '2017-05-24T10:59:52.000+01:00', - parent_ids: ['798e5f902592192afaba73f4668ae30e56eae492'], - message: 'Add new file', - author_name: 'Root', - author_email: 'admin@example.com', - authored_date: '2017-05-24T10:59:52.000+01:00', - committer_name: 'Root', - committer_email: 'admin@example.com', - committed_date: '2017-05-24T10:59:52.000+01:00', - author: { - name: 'Root', - username: 'root', - id: 1, - state: 'active', - avatar_url: - 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', - web_url: 'http://localhost:3000/root', - }, - author_gravatar_url: - 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', - commit_url: - 'http://localhost:3000/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', - commit_path: '/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', - }, - }, - metadata: { - timeout_human_readable: '1m 40s', - timeout_source: 'runner', - }, - merge_request: { - iid: 2, - path: '/root/ci-mock/merge_requests/2', - }, - raw_path: '/root/ci-mock/builds/4757/raw', - has_trace: true, -}; - export const stages = [ { name: 'build', @@ -1043,6 +909,167 @@ export const stages = [ }, ]; +export default { + id: 4757, + name: 'test', + build_path: '/root/ci-mock/-/jobs/4757', + retry_path: '/root/ci-mock/-/jobs/4757/retry', + cancel_path: '/root/ci-mock/-/jobs/4757/cancel', + new_issue_path: '/root/ci-mock/issues/new', + playable: false, + created_at: threeWeeksAgo.toISOString(), + updated_at: threeWeeksAgo.toISOString(), + finished_at: threeWeeksAgo.toISOString(), + queued: 9.54, + status: { + icon: 'status_success', + text: 'passed', + label: 'passed', + group: 'success', + has_details: true, + details_path: `${TEST_HOST}/root/ci-mock/-/jobs/4757`, + favicon: + '/assets/ci_favicons/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.png', + action: { + icon: 'retry', + title: 'Retry', + path: '/root/ci-mock/-/jobs/4757/retry', + method: 'post', + }, + }, + coverage: 20, + erased_at: threeWeeksAgo.toISOString(), + erased: false, + duration: 6.785563, + tags: ['tag'], + user: { + name: 'Root', + username: 'root', + id: 1, + state: 'active', + avatar_url: + 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', + web_url: 'http://localhost:3000/root', + }, + erase_path: '/root/ci-mock/-/jobs/4757/erase', + artifacts: [null], + runner: { + id: 1, + description: 'local ci runner', + edit_path: '/root/ci-mock/runners/1/edit', + }, + pipeline: { + id: 140, + user: { + name: 'Root', + username: 'root', + id: 1, + state: 'active', + avatar_url: + 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', + web_url: 'http://localhost:3000/root', + }, + active: false, + coverage: null, + source: 'unknown', + created_at: '2017-05-24T09:59:58.634Z', + updated_at: '2017-06-01T17:32:00.062Z', + path: '/root/ci-mock/pipelines/140', + flags: { + latest: true, + stuck: false, + yaml_errors: false, + retryable: false, + cancelable: false, + }, + details: { + status: { + icon: 'status_success', + text: 'passed', + label: 'passed', + group: 'success', + has_details: true, + details_path: '/root/ci-mock/pipelines/140', + favicon: + '/assets/ci_favicons/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.png', + }, + duration: 6, + finished_at: '2017-06-01T17:32:00.042Z', + stages: [ + { + dropdown_path: '/jashkenas/underscore/pipelines/16/stage.json?stage=build', + name: 'build', + path: '/jashkenas/underscore/pipelines/16#build', + status: { + icon: 'status_success', + text: 'passed', + label: 'passed', + group: 'success', + tooltip: 'passed', + }, + title: 'build: passed', + }, + { + dropdown_path: '/jashkenas/underscore/pipelines/16/stage.json?stage=test', + name: 'test', + path: '/jashkenas/underscore/pipelines/16#test', + status: { + icon: 'status_warning', + text: 'passed', + label: 'passed with warnings', + group: 'success-with-warnings', + }, + title: 'test: passed with warnings', + }, + ], + }, + ref: { + name: 'abc', + path: '/root/ci-mock/commits/abc', + tag: false, + branch: true, + }, + commit: { + id: 'c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', + short_id: 'c5864777', + title: 'Add new file', + created_at: '2017-05-24T10:59:52.000+01:00', + parent_ids: ['798e5f902592192afaba73f4668ae30e56eae492'], + message: 'Add new file', + author_name: 'Root', + author_email: 'admin@example.com', + authored_date: '2017-05-24T10:59:52.000+01:00', + committer_name: 'Root', + committer_email: 'admin@example.com', + committed_date: '2017-05-24T10:59:52.000+01:00', + author: { + name: 'Root', + username: 'root', + id: 1, + state: 'active', + avatar_url: + 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', + web_url: 'http://localhost:3000/root', + }, + author_gravatar_url: + 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', + commit_url: + 'http://localhost:3000/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', + commit_path: '/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', + }, + }, + metadata: { + timeout_human_readable: '1m 40s', + timeout_source: 'runner', + }, + merge_request: { + iid: 2, + path: '/root/ci-mock/merge_requests/2', + }, + raw_path: '/root/ci-mock/builds/4757/raw', + has_trace: true, +}; + export const jobsInStage = { name: 'build', title: 'build: running', diff --git a/spec/javascripts/jobs/store/actions_spec.js b/spec/javascripts/jobs/store/actions_spec.js index 77b44995b12..7b96df85b82 100644 --- a/spec/javascripts/jobs/store/actions_spec.js +++ b/spec/javascripts/jobs/store/actions_spec.js @@ -16,10 +16,6 @@ import { stopPollingTrace, receiveTraceSuccess, receiveTraceError, - requestStages, - fetchStages, - receiveStagesSuccess, - receiveStagesError, requestJobsForStage, fetchJobsForStage, receiveJobsForStageSuccess, @@ -307,107 +303,6 @@ describe('Job State actions', () => { }); }); - describe('requestStages', () => { - it('should commit REQUEST_STAGES mutation ', done => { - testAction(requestStages, null, mockedState, [{ type: types.REQUEST_STAGES }], [], done); - }); - }); - - describe('fetchStages', () => { - let mock; - - beforeEach(() => { - mockedState.job.pipeline = { - path: `${TEST_HOST}/endpoint`, - }; - mockedState.selectedStage = 'deploy'; - mock = new MockAdapter(axios); - }); - - afterEach(() => { - mock.restore(); - }); - - describe('success', () => { - it('dispatches requestStages and receiveStagesSuccess, fetchJobsForStage ', done => { - mock - .onGet(`${TEST_HOST}/endpoint.json`) - .replyOnce(200, { details: { stages: [{ name: 'build' }, { name: 'deploy' }] } }); - - testAction( - fetchStages, - null, - mockedState, - [], - [ - { - type: 'requestStages', - }, - { - payload: [{ name: 'build' }, { name: 'deploy' }], - type: 'receiveStagesSuccess', - }, - { - payload: { name: 'deploy' }, - type: 'fetchJobsForStage', - }, - ], - done, - ); - }); - }); - - describe('error', () => { - beforeEach(() => { - mock.onGet(`${TEST_HOST}/endpoint.json`).reply(500); - }); - - it('dispatches requestStages and receiveStagesError ', done => { - testAction( - fetchStages, - null, - mockedState, - [], - [ - { - type: 'requestStages', - }, - { - type: 'receiveStagesError', - }, - ], - done, - ); - }); - }); - }); - - describe('receiveStagesSuccess', () => { - it('should commit RECEIVE_STAGES_SUCCESS mutation ', done => { - testAction( - receiveStagesSuccess, - {}, - mockedState, - [{ type: types.RECEIVE_STAGES_SUCCESS, payload: {} }], - [], - done, - ); - }); - }); - - describe('receiveStagesError', () => { - it('should commit RECEIVE_STAGES_ERROR mutation ', done => { - testAction( - receiveStagesError, - null, - mockedState, - [{ type: types.RECEIVE_STAGES_ERROR }], - [], - done, - ); - }); - }); - describe('requestJobsForStage', () => { it('should commit REQUEST_JOBS_FOR_STAGE mutation ', done => { testAction( diff --git a/spec/javascripts/monitoring/charts/area_spec.js b/spec/javascripts/monitoring/charts/area_spec.js index 41a6c04efb9..56609665b88 100644 --- a/spec/javascripts/monitoring/charts/area_spec.js +++ b/spec/javascripts/monitoring/charts/area_spec.js @@ -2,7 +2,8 @@ import { shallowMount } from '@vue/test-utils'; import { GlAreaChart, GlChartSeriesLabel } from '@gitlab/ui/dist/charts'; import { shallowWrapperContainsSlotText } from 'spec/helpers/vue_test_utils_helper'; import Area from '~/monitoring/components/charts/area.vue'; -import MonitoringStore from '~/monitoring/stores/monitoring_store'; +import { createStore } from '~/monitoring/stores'; +import * as types from '~/monitoring/stores/mutation_types'; import MonitoringMock, { deploymentData } from '../mock_data'; describe('Area component', () => { @@ -13,17 +14,18 @@ describe('Area component', () => { let spriteSpy; beforeEach(() => { - const store = new MonitoringStore(); - store.storeMetrics(MonitoringMock.data); - store.storeDeploymentData(deploymentData); + const store = createStore(); - [mockGraphData] = store.groups[0].metrics; + store.commit(`monitoringDashboard/${types.RECEIVE_METRICS_DATA_SUCCESS}`, MonitoringMock.data); + store.commit(`monitoringDashboard/${types.RECEIVE_DEPLOYMENTS_DATA_SUCCESS}`, deploymentData); + + [mockGraphData] = store.state.monitoringDashboard.groups[0].metrics; areaChart = shallowMount(Area, { propsData: { graphData: mockGraphData, containerWidth: 0, - deploymentData: store.deploymentData, + deploymentData: store.state.monitoringDashboard.deploymentData, }, slots: { default: mockWidgets, diff --git a/spec/javascripts/monitoring/dashboard_spec.js b/spec/javascripts/monitoring/dashboard_spec.js index e9bd6050d68..58bcd916739 100644 --- a/spec/javascripts/monitoring/dashboard_spec.js +++ b/spec/javascripts/monitoring/dashboard_spec.js @@ -2,8 +2,15 @@ import Vue from 'vue'; import MockAdapter from 'axios-mock-adapter'; import Dashboard from '~/monitoring/components/dashboard.vue'; import { timeWindows, timeWindowsKeyNames } from '~/monitoring/constants'; +import * as types from '~/monitoring/stores/mutation_types'; +import { createStore } from '~/monitoring/stores'; import axios from '~/lib/utils/axios_utils'; -import { metricsGroupsAPIResponse, mockApiEndpoint, environmentData } from './mock_data'; +import { + metricsGroupsAPIResponse, + mockApiEndpoint, + environmentData, + singleGroupResponse, +} from './mock_data'; const propsData = { hasMetrics: false, @@ -30,6 +37,7 @@ export default propsData; describe('Dashboard', () => { let DashboardComponent; let mock; + let store; beforeEach(() => { setFixtures(` @@ -45,6 +53,7 @@ describe('Dashboard', () => { }, }; + store = createStore(); mock = new MockAdapter(axios); DashboardComponent = Vue.extend(Dashboard); }); @@ -58,10 +67,11 @@ describe('Dashboard', () => { const component = new DashboardComponent({ el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, showTimeWindowDropdown: false }, + store, }); expect(component.$el.querySelector('.prometheus-graphs')).toBe(null); - expect(component.state).toEqual('gettingStarted'); + expect(component.emptyState).toEqual('gettingStarted'); }); }); @@ -74,10 +84,11 @@ describe('Dashboard', () => { const component = new DashboardComponent({ el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: false }, + store, }); Vue.nextTick(() => { - expect(component.state).toEqual('loading'); + expect(component.emptyState).toEqual('loading'); done(); }); }); @@ -91,6 +102,7 @@ describe('Dashboard', () => { showLegend: false, showTimeWindowDropdown: false, }, + store, }); setTimeout(() => { @@ -110,6 +122,7 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); setTimeout(() => { @@ -129,16 +142,24 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); - component.store.storeEnvironmentsData(environmentData); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS}`, + environmentData, + ); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_METRICS_DATA_SUCCESS}`, + singleGroupResponse, + ); setTimeout(() => { const dropdownMenuEnvironments = component.$el.querySelectorAll( '.js-environments-dropdown .dropdown-item', ); - expect(dropdownMenuEnvironments.length).toEqual(component.store.environmentsData.length); + expect(dropdownMenuEnvironments.length).toEqual(component.environments.length); done(); }); }); @@ -152,18 +173,29 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); - component.store.storeEnvironmentsData([]); + component.$store.commit( + `monitoringDashboard/${types.SET_ENVIRONMENTS_ENDPOINT}`, + '/environments', + ); + component.$store.commit(`monitoringDashboard/${types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS}`, []); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_METRICS_DATA_SUCCESS}`, + singleGroupResponse, + ); - setTimeout(() => { - const dropdownMenuEnvironments = component.$el.querySelectorAll( - '.js-environments-dropdown .dropdown-item', - ); + Vue.nextTick() + .then(() => { + const dropdownMenuEnvironments = component.$el.querySelectorAll( + '.js-environments-dropdown .dropdown-item', + ); - expect(dropdownMenuEnvironments.length).toEqual(0); - done(); - }); + expect(dropdownMenuEnvironments.length).toEqual(0); + done(); + }) + .catch(done.fail); }); it('renders the environments dropdown with a single active element', done => { @@ -175,19 +207,32 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); - component.store.storeEnvironmentsData(environmentData); + component.$store.commit( + `monitoringDashboard/${types.SET_ENVIRONMENTS_ENDPOINT}`, + '/environments', + ); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS}`, + environmentData, + ); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_METRICS_DATA_SUCCESS}`, + singleGroupResponse, + ); - setTimeout(() => { - const dropdownItems = component.$el.querySelectorAll( - '.js-environments-dropdown .dropdown-item[active="true"]', - ); + Vue.nextTick() + .then(() => { + const dropdownItems = component.$el.querySelectorAll( + '.js-environments-dropdown .dropdown-item[active="true"]', + ); - expect(dropdownItems.length).toEqual(1); - expect(dropdownItems[0].textContent.trim()).toEqual(component.currentEnvironmentName); - done(); - }); + expect(dropdownItems.length).toEqual(1); + done(); + }) + .catch(done.fail); }); it('hides the dropdown', done => { @@ -200,6 +245,7 @@ describe('Dashboard', () => { environmentsEndpoint: '', showTimeWindowDropdown: false, }, + store, }); Vue.nextTick(() => { @@ -219,6 +265,7 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); setTimeout(() => { @@ -239,6 +286,7 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: true, }, + store, }); const numberOfTimeWindows = Object.keys(timeWindows).length; @@ -261,6 +309,7 @@ describe('Dashboard', () => { const component = new DashboardComponent({ el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: true }, + store, }); setTimeout(() => { @@ -281,6 +330,7 @@ describe('Dashboard', () => { const component = new DashboardComponent({ el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: true }, + store, }); Vue.nextTick(() => { @@ -310,6 +360,7 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); expect(component.elWidth).toEqual(0); @@ -352,6 +403,7 @@ describe('Dashboard', () => { showTimeWindowDropdown: false, externalDashboardPath: '/mockPath', }, + store, }); }); @@ -377,6 +429,7 @@ describe('Dashboard', () => { showTimeWindowDropdown: false, externalDashboardPath: '', }, + store, }); }); diff --git a/spec/javascripts/monitoring/helpers.js b/spec/javascripts/monitoring/helpers.js new file mode 100644 index 00000000000..672e3b948c4 --- /dev/null +++ b/spec/javascripts/monitoring/helpers.js @@ -0,0 +1,8 @@ +// eslint-disable-next-line import/prefer-default-export +export const resetStore = store => { + store.replaceState({ + showEmptyState: true, + emptyState: 'loading', + groups: [], + }); +}; diff --git a/spec/javascripts/monitoring/mock_data.js b/spec/javascripts/monitoring/mock_data.js index 6d4ef960c1a..d9d8cb66749 100644 --- a/spec/javascripts/monitoring/mock_data.js +++ b/spec/javascripts/monitoring/mock_data.js @@ -685,6 +685,47 @@ export const metricsGroupsAPIResponse = { last_update: '2017-05-25T13:18:34.949Z', }; +export const singleGroupResponse = [ + { + group: 'System metrics (Kubernetes)', + priority: 5, + metrics: [ + { + title: 'Memory Usage (Total)', + weight: 0, + y_label: 'Total Memory Used', + queries: [ + { + query_range: + 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^production-(.*)",namespace="autodevops-deploy-33"}) by (job)) without (job) /1024/1024/1024', + unit: 'GB', + label: 'Total', + result: [ + { + metric: {}, + values: [ + [1558453960.079, '0.0357666015625'], + [1558454020.079, '0.035675048828125'], + [1558454080.079, '0.035152435302734375'], + [1558454140.079, '0.035221099853515625'], + [1558454200.079, '0.0352325439453125'], + [1558454260.079, '0.03479766845703125'], + [1558454320.079, '0.034793853759765625'], + [1558454380.079, '0.034931182861328125'], + [1558454440.079, '0.034816741943359375'], + [1558454500.079, '0.034816741943359375'], + [1558454560.079, '0.034816741943359375'], + ], + }, + ], + }, + ], + id: 15, + }, + ], + }, +]; + export default metricsGroupsAPIResponse; export const deploymentData = [ @@ -738,5836 +779,6 @@ export const statePaths = { documentationPath: '/help/administration/monitoring/prometheus/index.md', }; -export const singleRowMetricsMultipleSeries = [ - { - title: 'Multiple Time Series', - weight: 1, - y_label: 'Request Rates', - queries: [ - { - query_range: - 'sum(rate(nginx_responses_total{environment="production"}[2m])) by (status_code)', - label: 'Requests', - unit: 'Req/sec', - result: [ - { - metric: { - status_code: '1xx', - }, - values: [ - { - time: '2017-08-27T11:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T19:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T19:01:51.462Z', - value: '0', - }, - ], - }, - { - metric: { - status_code: '2xx', - }, - values: [ - { - time: '2017-08-27T11:01:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:02:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T11:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:04:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:05:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:07:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:08:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:09:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:14:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:16:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:18:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:19:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:20:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:21:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:23:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:24:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:25:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:26:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:27:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:29:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:31:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:32:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:33:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:34:51.462Z', - value: '1.333320635041571', - }, - { - time: '2017-08-27T11:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:36:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:37:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:38:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:39:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:40:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:41:51.462Z', - value: '1.3333587306424883', - }, - { - time: '2017-08-27T11:42:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:43:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:44:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:45:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:46:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:47:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:48:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:49:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:50:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:51:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:53:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:55:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:57:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:58:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:59:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:00:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:01:51.462Z', - value: '1.3333460318669703', - }, - { - time: '2017-08-27T12:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:04:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:05:51.462Z', - value: '1.31427319739812', - }, - { - time: '2017-08-27T12:06:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:07:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:08:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:09:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:10:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:13:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:16:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:18:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:19:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:20:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:21:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:23:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:24:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:25:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:26:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:27:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:29:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:31:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:32:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:33:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:34:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:36:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:37:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:38:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:39:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:41:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:42:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:43:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:44:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:45:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:46:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:47:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:48:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:49:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:50:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:51:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:53:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:55:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:56:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:57:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:58:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:59:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:00:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:01:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T13:02:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:03:51.462Z', - value: '1.2952627669098458', - }, - { - time: '2017-08-27T13:04:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:05:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:06:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:07:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:08:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:09:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:14:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:15:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T13:16:51.462Z', - value: '1.3333587306424883', - }, - { - time: '2017-08-27T13:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:18:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:19:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:20:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:21:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:22:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:23:51.462Z', - value: '1.276190476190476', - }, - { - time: '2017-08-27T13:24:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T13:25:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:26:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:27:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:29:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:31:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:32:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:33:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:34:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:35:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:36:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:37:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:38:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:39:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:40:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:41:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:42:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:43:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:44:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:45:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:46:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T13:47:51.462Z', - value: '1.276190476190476', - }, - { - time: '2017-08-27T13:48:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:49:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T13:50:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:51:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:52:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:53:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:54:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:55:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:56:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:57:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:58:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:59:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T14:00:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:01:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:04:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:05:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:07:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:08:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:09:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:16:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:17:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:18:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:19:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:20:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:21:51.462Z', - value: '1.3333079369916765', - }, - { - time: '2017-08-27T14:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:23:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:24:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:25:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:26:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:27:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:29:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:30:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:31:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:32:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:33:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T14:34:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:36:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:37:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:38:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:39:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:40:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:41:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:42:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:43:51.462Z', - value: '1.276190476190476', - }, - { - time: '2017-08-27T14:44:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T14:45:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:46:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:47:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:48:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:49:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:50:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:51:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:53:51.462Z', - value: '1.333320635041571', - }, - { - time: '2017-08-27T14:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:55:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:57:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:58:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:59:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:00:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:01:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:04:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T15:05:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:07:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:08:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:09:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:10:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:11:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:12:51.462Z', - value: '1.31427319739812', - }, - { - time: '2017-08-27T15:13:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:16:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:18:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:19:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:20:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:21:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:22:51.462Z', - value: '1.3333460318669703', - }, - { - time: '2017-08-27T15:23:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:24:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:25:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:26:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:27:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:28:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:29:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:31:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:32:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:33:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:34:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:35:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:36:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:37:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:38:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:39:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:41:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:42:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:43:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:44:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:45:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:46:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:47:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:48:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:49:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:50:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:51:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:53:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:55:51.462Z', - value: '1.3333587306424883', - }, - { - time: '2017-08-27T15:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:57:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:58:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:59:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:00:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:01:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:03:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:04:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:05:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:07:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:08:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:09:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:12:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:15:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:16:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:17:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:18:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:19:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:20:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:21:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:23:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:24:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T16:25:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:26:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:27:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:28:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:29:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:30:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:31:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:32:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:33:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:34:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:36:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:37:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:38:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:39:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:41:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:42:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:43:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:44:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:45:51.462Z', - value: '1.3142982314117277', - }, - { - time: '2017-08-27T16:46:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:47:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:48:51.462Z', - value: '1.333320635041571', - }, - { - time: '2017-08-27T16:49:51.462Z', - value: '1.31427319739812', - }, - { - time: '2017-08-27T16:50:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:51:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:53:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:55:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:57:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:58:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:59:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:00:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:01:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:04:51.462Z', - value: '1.2952504309564854', - }, - { - time: '2017-08-27T17:05:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:07:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:08:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:09:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:16:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:18:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:19:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:20:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:21:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:22:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:23:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:24:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:25:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:26:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:27:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:28:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:29:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T17:30:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:31:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:32:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:33:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:34:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T17:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:36:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:37:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:38:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:39:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:41:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:42:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:43:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:44:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:45:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:46:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:47:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:48:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:49:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:50:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:51:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:53:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:55:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:57:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:58:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:59:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:00:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:01:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:02:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:03:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:04:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:05:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:06:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:07:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:08:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:09:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:12:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:16:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:18:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:19:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:20:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:21:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:23:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:24:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T18:25:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:26:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:27:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:29:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:31:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:32:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:33:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:34:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:35:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:36:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:37:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:38:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:39:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:41:51.462Z', - value: '1.580952380952381', - }, - { - time: '2017-08-27T18:42:51.462Z', - value: '1.7333333333333334', - }, - { - time: '2017-08-27T18:43:51.462Z', - value: '2.057142857142857', - }, - { - time: '2017-08-27T18:44:51.462Z', - value: '2.1904761904761902', - }, - { - time: '2017-08-27T18:45:51.462Z', - value: '1.8285714285714287', - }, - { - time: '2017-08-27T18:46:51.462Z', - value: '2.1142857142857143', - }, - { - time: '2017-08-27T18:47:51.462Z', - value: '1.619047619047619', - }, - { - time: '2017-08-27T18:48:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:49:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:50:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:51:51.462Z', - value: '1.2952504309564854', - }, - { - time: '2017-08-27T18:52:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:53:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:54:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:55:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:56:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:57:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:58:51.462Z', - value: '1.7142857142857142', - }, - { - time: '2017-08-27T18:59:51.462Z', - value: '1.7333333333333334', - }, - { - time: '2017-08-27T19:00:51.462Z', - value: '1.3904761904761904', - }, - { - time: '2017-08-27T19:01:51.462Z', - value: '1.5047619047619047', - }, - ], - }, - ], - when: [ - { - value: 'hundred(s)', - color: 'green', - }, - ], - }, - ], - }, - { - title: 'Throughput', - weight: 1, - y_label: 'Requests / Sec', - queries: [ - { - query_range: - "sum(rate(nginx_requests_total{server_zone!='*', server_zone!='_', container_name!='POD',environment='production'}[2m]))", - label: 'Total', - unit: 'req / sec', - result: [ - { - metric: {}, - values: [ - { - time: '2017-08-27T11:01:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:02:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T11:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:04:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:05:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:07:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:08:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:09:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:14:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:16:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:18:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:19:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:20:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:21:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:23:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:24:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:25:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:26:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:27:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:29:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:31:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:32:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:33:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:34:51.462Z', - value: '0.4952333787297264', - }, - { - time: '2017-08-27T11:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:36:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:37:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:38:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:39:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:40:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:41:51.462Z', - value: '0.49524752852435283', - }, - { - time: '2017-08-27T11:42:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:43:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:44:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:45:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:46:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:47:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:48:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:49:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:50:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:51:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:53:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:55:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:57:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:58:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:59:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:00:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:01:51.462Z', - value: '0.49524281183630325', - }, - { - time: '2017-08-27T12:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:04:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:05:51.462Z', - value: '0.4857096599080009', - }, - { - time: '2017-08-27T12:06:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:07:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:08:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:09:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:10:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:13:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:16:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:18:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:19:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:20:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:21:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:23:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:24:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:25:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:26:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:27:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:29:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:31:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:32:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:33:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:34:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:36:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:37:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:38:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:39:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:41:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:42:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:43:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:44:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:45:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:46:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:47:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:48:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:49:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:50:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:51:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:53:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:55:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:56:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:57:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:58:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:59:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:00:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:01:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T13:02:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:03:51.462Z', - value: '0.4761995466580315', - }, - { - time: '2017-08-27T13:04:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:05:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:06:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:07:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:08:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:09:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:14:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:15:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T13:16:51.462Z', - value: '0.49524752852435283', - }, - { - time: '2017-08-27T13:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:18:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:19:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:20:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:21:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:22:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:23:51.462Z', - value: '0.4666666666666667', - }, - { - time: '2017-08-27T13:24:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T13:25:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:26:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:27:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:29:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:31:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:32:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:33:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:34:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:35:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:36:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:37:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:38:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:39:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:40:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:41:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:42:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:43:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:44:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:45:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:46:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T13:47:51.462Z', - value: '0.4666666666666667', - }, - { - time: '2017-08-27T13:48:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:49:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T13:50:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:51:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:52:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:53:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:54:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:55:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:56:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:57:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:58:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:59:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T14:00:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:01:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:04:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:05:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:07:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:08:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:09:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:16:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:17:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:18:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:19:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:20:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:21:51.462Z', - value: '0.4952286623111941', - }, - { - time: '2017-08-27T14:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:23:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:24:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:25:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:26:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:27:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:29:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:30:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:31:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:32:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:33:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T14:34:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:36:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:37:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:38:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:39:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:40:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:41:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:42:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:43:51.462Z', - value: '0.4666666666666667', - }, - { - time: '2017-08-27T14:44:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T14:45:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:46:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:47:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:48:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:49:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:50:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:51:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:53:51.462Z', - value: '0.4952333787297264', - }, - { - time: '2017-08-27T14:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:55:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:57:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:58:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:59:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:00:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:01:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:04:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T15:05:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:07:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:08:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:09:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:10:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:11:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:12:51.462Z', - value: '0.4857096599080009', - }, - { - time: '2017-08-27T15:13:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:16:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:18:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:19:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:20:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:21:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:22:51.462Z', - value: '0.49524281183630325', - }, - { - time: '2017-08-27T15:23:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:24:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:25:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:26:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:27:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:28:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:29:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:31:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:32:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:33:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:34:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:35:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:36:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:37:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:38:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:39:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:41:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:42:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:43:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:44:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:45:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:46:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:47:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:48:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:49:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:50:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:51:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:53:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:55:51.462Z', - value: '0.49524752852435283', - }, - { - time: '2017-08-27T15:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:57:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:58:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:59:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:00:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:01:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:03:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:04:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:05:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:07:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:08:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:09:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:12:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:15:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:16:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:17:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:18:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:19:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:20:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:21:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:23:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:24:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T16:25:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:26:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:27:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:28:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:29:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:30:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:31:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:32:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:33:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:34:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:36:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:37:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:38:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:39:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:41:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:42:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:43:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:44:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:45:51.462Z', - value: '0.485718911608682', - }, - { - time: '2017-08-27T16:46:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:47:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:48:51.462Z', - value: '0.4952333787297264', - }, - { - time: '2017-08-27T16:49:51.462Z', - value: '0.4857096599080009', - }, - { - time: '2017-08-27T16:50:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:51:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:53:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:55:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:57:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:58:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:59:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:00:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:01:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:04:51.462Z', - value: '0.47619501138106085', - }, - { - time: '2017-08-27T17:05:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:07:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:08:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:09:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:16:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:18:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:19:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:20:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:21:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:22:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:23:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:24:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:25:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:26:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:27:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:28:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:29:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T17:30:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:31:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:32:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:33:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:34:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T17:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:36:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:37:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:38:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:39:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:41:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:42:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:43:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:44:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:45:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:46:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:47:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:48:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:49:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:50:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:51:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:53:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:55:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:57:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:58:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:59:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:00:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:01:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:02:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:03:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:04:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:05:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:06:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:07:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:08:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:09:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:12:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:16:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:18:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:19:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:20:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:21:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:23:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:24:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T18:25:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:26:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:27:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:29:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:31:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:32:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:33:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:34:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:35:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:36:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:37:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:38:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:39:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:41:51.462Z', - value: '0.6190476190476191', - }, - { - time: '2017-08-27T18:42:51.462Z', - value: '0.6952380952380952', - }, - { - time: '2017-08-27T18:43:51.462Z', - value: '0.857142857142857', - }, - { - time: '2017-08-27T18:44:51.462Z', - value: '0.9238095238095239', - }, - { - time: '2017-08-27T18:45:51.462Z', - value: '0.7428571428571429', - }, - { - time: '2017-08-27T18:46:51.462Z', - value: '0.8857142857142857', - }, - { - time: '2017-08-27T18:47:51.462Z', - value: '0.638095238095238', - }, - { - time: '2017-08-27T18:48:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:49:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:50:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:51:51.462Z', - value: '0.47619501138106085', - }, - { - time: '2017-08-27T18:52:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:53:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:54:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:55:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:56:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:57:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:58:51.462Z', - value: '0.6857142857142856', - }, - { - time: '2017-08-27T18:59:51.462Z', - value: '0.6952380952380952', - }, - { - time: '2017-08-27T19:00:51.462Z', - value: '0.5238095238095237', - }, - { - time: '2017-08-27T19:01:51.462Z', - value: '0.5904761904761905', - }, - ], - }, - ], - }, - ], - }, -]; - export const queryWithoutData = { title: 'HTTP Error rate', weight: 10, diff --git a/spec/javascripts/monitoring/monitoring_store_spec.js b/spec/javascripts/monitoring/monitoring_store_spec.js deleted file mode 100644 index 5bf6937c92e..00000000000 --- a/spec/javascripts/monitoring/monitoring_store_spec.js +++ /dev/null @@ -1,59 +0,0 @@ -import MonitoringStore from '~/monitoring/stores/monitoring_store'; -import MonitoringMock, { deploymentData, environmentData } from './mock_data'; - -describe('MonitoringStore', () => { - const store = new MonitoringStore(); - store.storeMetrics(MonitoringMock.data); - - it('contains two groups that contains, one of which has two queries sorted by priority', () => { - expect(store.groups).toBeDefined(); - expect(store.groups.length).toEqual(2); - expect(store.groups[0].metrics.length).toEqual(2); - }); - - it('gets the metrics count for every group', () => { - expect(store.getMetricsCount()).toEqual(3); - }); - - it('contains deployment data', () => { - store.storeDeploymentData(deploymentData); - - expect(store.deploymentData).toBeDefined(); - expect(store.deploymentData.length).toEqual(3); - expect(typeof store.deploymentData[0]).toEqual('object'); - }); - - it('only stores environment data that contains deployments', () => { - store.storeEnvironmentsData(environmentData); - - expect(store.environmentsData.length).toEqual(2); - }); - - it('removes the data if all the values from a query are not defined', () => { - expect(store.groups[1].metrics[0].queries[0].result.length).toEqual(0); - }); - - it('assigns queries a metric id', () => { - expect(store.groups[1].metrics[0].queries[0].metricId).toEqual('100'); - }); - - it('assigns metric id of null if metric has no id', () => { - const noId = MonitoringMock.data.map(group => ({ - ...group, - ...{ - metrics: group.metrics.map(metric => { - const { id, ...metricWithoutId } = metric; - - return metricWithoutId; - }), - }, - })); - store.storeMetrics(noId); - - store.groups.forEach(group => { - group.metrics.forEach(metric => { - expect(metric.queries.every(query => query.metricId === null)).toBe(true); - }); - }); - }); -}); diff --git a/spec/javascripts/monitoring/store/actions_spec.js b/spec/javascripts/monitoring/store/actions_spec.js new file mode 100644 index 00000000000..a848cd24fe3 --- /dev/null +++ b/spec/javascripts/monitoring/store/actions_spec.js @@ -0,0 +1,158 @@ +import axios from '~/lib/utils/axios_utils'; +import MockAdapter from 'axios-mock-adapter'; +import store from '~/monitoring/stores'; +import * as types from '~/monitoring/stores/mutation_types'; +import { + fetchDeploymentsData, + fetchEnvironmentsData, + requestMetricsData, + setEndpoints, + setGettingStartedEmptyState, +} from '~/monitoring/stores/actions'; +import storeState from '~/monitoring/stores/state'; +import testAction from 'spec/helpers/vuex_action_helper'; +import { resetStore } from '../helpers'; +import { deploymentData, environmentData } from '../mock_data'; + +describe('Monitoring store actions', () => { + let mock; + + beforeEach(() => { + mock = new MockAdapter(axios); + }); + + afterEach(() => { + resetStore(store); + mock.restore(); + }); + + describe('requestMetricsData', () => { + it('sets emptyState to loading', () => { + const commit = jasmine.createSpy(); + const { state } = store; + + requestMetricsData({ state, commit }); + + expect(commit).toHaveBeenCalledWith(types.REQUEST_METRICS_DATA); + }); + }); + + describe('fetchDeploymentsData', () => { + it('commits RECEIVE_DEPLOYMENTS_DATA_SUCCESS on error', done => { + const dispatch = jasmine.createSpy(); + const { state } = store; + state.deploymentEndpoint = '/success'; + + mock.onGet(state.deploymentEndpoint).reply(200, { + deployments: deploymentData, + }); + + fetchDeploymentsData({ state, dispatch }) + .then(() => { + expect(dispatch).toHaveBeenCalledWith('receiveDeploymentsDataSuccess', deploymentData); + done(); + }) + .catch(done.fail); + }); + + it('commits RECEIVE_DEPLOYMENTS_DATA_FAILURE on error', done => { + const dispatch = jasmine.createSpy(); + const { state } = store; + state.deploymentEndpoint = '/error'; + + mock.onGet(state.deploymentEndpoint).reply(500); + + fetchDeploymentsData({ state, dispatch }) + .then(() => { + expect(dispatch).toHaveBeenCalledWith('receiveDeploymentsDataFailure'); + done(); + }) + .catch(done.fail); + }); + }); + + describe('fetchEnvironmentsData', () => { + it('commits RECEIVE_ENVIRONMENTS_DATA_SUCCESS on error', done => { + const dispatch = jasmine.createSpy(); + const { state } = store; + state.environmentsEndpoint = '/success'; + + mock.onGet(state.environmentsEndpoint).reply(200, { + environments: environmentData, + }); + + fetchEnvironmentsData({ state, dispatch }) + .then(() => { + expect(dispatch).toHaveBeenCalledWith('receiveEnvironmentsDataSuccess', environmentData); + done(); + }) + .catch(done.fail); + }); + + it('commits RECEIVE_ENVIRONMENTS_DATA_FAILURE on error', done => { + const dispatch = jasmine.createSpy(); + const { state } = store; + state.environmentsEndpoint = '/error'; + + mock.onGet(state.environmentsEndpoint).reply(500); + + fetchEnvironmentsData({ state, dispatch }) + .then(() => { + expect(dispatch).toHaveBeenCalledWith('receiveEnvironmentsDataFailure'); + done(); + }) + .catch(done.fail); + }); + }); + + describe('Set endpoints', () => { + let mockedState; + + beforeEach(() => { + mockedState = storeState(); + }); + + it('should commit SET_ENDPOINTS mutation', done => { + testAction( + setEndpoints, + { + metricsEndpoint: 'additional_metrics.json', + deploymentsEndpoint: 'deployments.json', + environmentsEndpoint: 'deployments.json', + }, + mockedState, + [ + { + type: types.SET_ENDPOINTS, + payload: { + metricsEndpoint: 'additional_metrics.json', + deploymentsEndpoint: 'deployments.json', + environmentsEndpoint: 'deployments.json', + }, + }, + ], + [], + done, + ); + }); + }); + + describe('Set empty states', () => { + let mockedState; + + beforeEach(() => { + mockedState = storeState(); + }); + + it('should commit SET_METRICS_ENDPOINT mutation', done => { + testAction( + setGettingStartedEmptyState, + null, + mockedState, + [{ type: types.SET_GETTING_STARTED_EMPTY_STATE }], + [], + done, + ); + }); + }); +}); diff --git a/spec/javascripts/monitoring/store/mutations_spec.js b/spec/javascripts/monitoring/store/mutations_spec.js new file mode 100644 index 00000000000..882ee1dec14 --- /dev/null +++ b/spec/javascripts/monitoring/store/mutations_spec.js @@ -0,0 +1,92 @@ +import mutations from '~/monitoring/stores/mutations'; +import * as types from '~/monitoring/stores/mutation_types'; +import state from '~/monitoring/stores/state'; +import { metricsGroupsAPIResponse, deploymentData } from '../mock_data'; + +describe('Monitoring mutations', () => { + let stateCopy; + + beforeEach(() => { + stateCopy = state(); + }); + + describe(types.RECEIVE_METRICS_DATA_SUCCESS, () => { + beforeEach(() => { + stateCopy.groups = []; + const groups = metricsGroupsAPIResponse.data; + + mutations[types.RECEIVE_METRICS_DATA_SUCCESS](stateCopy, groups); + }); + + it('normalizes values', () => { + const expectedTimestamp = '2017-05-25T08:22:34.925Z'; + const expectedValue = 0.0010794445585559514; + const [timestamp, value] = stateCopy.groups[0].metrics[0].queries[0].result[0].values[0]; + + expect(timestamp).toEqual(expectedTimestamp); + expect(value).toEqual(expectedValue); + }); + + it('contains two groups that contains, one of which has two queries sorted by priority', () => { + expect(stateCopy.groups).toBeDefined(); + expect(stateCopy.groups.length).toEqual(2); + expect(stateCopy.groups[0].metrics.length).toEqual(2); + }); + + it('assigns queries a metric id', () => { + expect(stateCopy.groups[1].metrics[0].queries[0].metricId).toEqual('100'); + }); + + it('removes the data if all the values from a query are not defined', () => { + expect(stateCopy.groups[1].metrics[0].queries[0].result.length).toEqual(0); + }); + + it('assigns metric id of null if metric has no id', () => { + stateCopy.groups = []; + const groups = metricsGroupsAPIResponse.data; + const noId = groups.map(group => ({ + ...group, + ...{ + metrics: group.metrics.map(metric => { + const { id, ...metricWithoutId } = metric; + + return metricWithoutId; + }), + }, + })); + + mutations[types.RECEIVE_METRICS_DATA_SUCCESS](stateCopy, noId); + + stateCopy.groups.forEach(group => { + group.metrics.forEach(metric => { + expect(metric.queries.every(query => query.metricId === null)).toBe(true); + }); + }); + }); + }); + + describe(types.RECEIVE_DEPLOYMENTS_DATA_SUCCESS, () => { + it('stores the deployment data', () => { + stateCopy.deploymentData = []; + mutations[types.RECEIVE_DEPLOYMENTS_DATA_SUCCESS](stateCopy, deploymentData); + + expect(stateCopy.deploymentData).toBeDefined(); + expect(stateCopy.deploymentData.length).toEqual(3); + expect(typeof stateCopy.deploymentData[0]).toEqual('object'); + }); + }); + + describe('SET_ENDPOINTS', () => { + it('should set all the endpoints', () => { + mutations[types.SET_ENDPOINTS](stateCopy, { + metricsEndpoint: 'additional_metrics.json', + environmentsEndpoint: 'environments.json', + deploymentsEndpoint: 'deployments.json', + }); + + expect(stateCopy.metricsEndpoint).toEqual('additional_metrics.json'); + expect(stateCopy.environmentsEndpoint).toEqual('environments.json'); + expect(stateCopy.deploymentsEndpoint).toEqual('deployments.json'); + }); + }); +}); diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js index 87ef0885d8c..8c80a425581 100644 --- a/spec/javascripts/test_bundle.js +++ b/spec/javascripts/test_bundle.js @@ -111,7 +111,7 @@ let longRunningTestTimeoutHandle; beforeEach(done => { longRunningTestTimeoutHandle = setTimeout(() => { done.fail('Test is running too long!'); - }, 2000); + }, 4000); done(); }); diff --git a/spec/lib/gitlab/background_migration/schedule_calculate_wiki_sizes_spec.rb b/spec/lib/gitlab/background_migration/schedule_calculate_wiki_sizes_spec.rb new file mode 100644 index 00000000000..d494ce68c5b --- /dev/null +++ b/spec/lib/gitlab/background_migration/schedule_calculate_wiki_sizes_spec.rb @@ -0,0 +1,62 @@ +require 'spec_helper' +require Rails.root.join('db', 'post_migrate', '20190527194900_schedule_calculate_wiki_sizes.rb') + +describe ScheduleCalculateWikiSizes, :migration, :sidekiq do + let(:migration_class) { Gitlab::BackgroundMigration::CalculateWikiSizes } + let(:migration_name) { migration_class.to_s.demodulize } + + let(:namespaces) { table(:namespaces) } + let(:projects) { table(:projects) } + let(:project_statistics) { table(:project_statistics) } + + context 'when missing wiki sizes exist' do + before do + namespaces.create!(id: 1, name: 'wiki-migration', path: 'wiki-migration') + projects.create!(id: 1, name: 'wiki-project-1', path: 'wiki-project-1', namespace_id: 1) + projects.create!(id: 2, name: 'wiki-project-2', path: 'wiki-project-2', namespace_id: 1) + projects.create!(id: 3, name: 'wiki-project-3', path: 'wiki-project-3', namespace_id: 1) + project_statistics.create!(id: 1, project_id: 1, namespace_id: 1, wiki_size: 1000) + project_statistics.create!(id: 2, project_id: 2, namespace_id: 1, wiki_size: nil) + project_statistics.create!(id: 3, project_id: 3, namespace_id: 1, wiki_size: nil) + end + + it 'schedules a background migration' do + Sidekiq::Testing.fake! do + Timecop.freeze do + migrate! + + expect(migration_name).to be_scheduled_delayed_migration(5.minutes, 2, 3) + expect(BackgroundMigrationWorker.jobs.size).to eq 1 + end + end + end + + it 'calculates missing wiki sizes' do + expect(project_statistics.find_by(id: 2).wiki_size).to be_nil + expect(project_statistics.find_by(id: 3).wiki_size).to be_nil + + migrate! + + expect(project_statistics.find_by(id: 2).wiki_size).not_to be_nil + expect(project_statistics.find_by(id: 3).wiki_size).not_to be_nil + end + end + + context 'when missing wiki sizes do not exist' do + before do + namespaces.create!(id: 1, name: 'wiki-migration', path: 'wiki-migration') + projects.create!(id: 1, name: 'wiki-project-1', path: 'wiki-project-1', namespace_id: 1) + project_statistics.create!(id: 1, project_id: 1, namespace_id: 1, wiki_size: 1000) + end + + it 'does not schedule a background migration' do + Sidekiq::Testing.fake! do + Timecop.freeze do + migrate! + + expect(BackgroundMigrationWorker.jobs.size).to eq 0 + end + end + end + end +end diff --git a/spec/lib/gitlab/data_builder/pipeline_spec.rb b/spec/lib/gitlab/data_builder/pipeline_spec.rb index 9ef987a0826..1f36fd5c6ef 100644 --- a/spec/lib/gitlab/data_builder/pipeline_spec.rb +++ b/spec/lib/gitlab/data_builder/pipeline_spec.rb @@ -50,5 +50,14 @@ describe Gitlab::DataBuilder::Pipeline do it { expect(attributes[:variables]).to be_a(Array) } it { expect(attributes[:variables]).to contain_exactly({ key: 'TRIGGER_KEY_1', value: 'TRIGGER_VALUE_1' }) } end + + context 'when pipeline is a detached merge request pipeline' do + let(:merge_request) { create(:merge_request, :with_detached_merge_request_pipeline) } + let(:pipeline) { merge_request.all_pipelines.first } + + it 'returns a source ref' do + expect(attributes[:ref]).to eq(merge_request.source_branch) + end + end end end diff --git a/spec/lib/gitlab/import_export/members_mapper_spec.rb b/spec/lib/gitlab/import_export/members_mapper_spec.rb index c663cf42a83..b95b5dfe791 100644 --- a/spec/lib/gitlab/import_export/members_mapper_spec.rb +++ b/spec/lib/gitlab/import_export/members_mapper_spec.rb @@ -12,7 +12,6 @@ describe Gitlab::ImportExport::MembersMapper do "access_level" => 40, "source_id" => 14, "source_type" => "Project", - "user_id" => 19, "notification_level" => 3, "created_at" => "2016-03-11T10:21:44.822Z", "updated_at" => "2016-03-11T10:21:44.822Z", @@ -25,7 +24,8 @@ describe Gitlab::ImportExport::MembersMapper do "id" => exported_user_id, "email" => user2.email, "username" => 'test' - } + }, + "user_id" => 19 }, { "id" => 3, @@ -80,6 +80,15 @@ describe Gitlab::ImportExport::MembersMapper do expect(ProjectMember.find_by_user_id(user2.id).access_level).to eq(ProjectMember::MAINTAINER) end + it 'removes old user_id from member_hash to avoid conflict with user key' do + expect(ProjectMember).to receive(:create) + .twice + .with(hash_excluding('user_id')) + .and_call_original + + members_mapper.map + end + context 'user is not an admin' do let(:user) { create(:user) } diff --git a/spec/lib/gitlab/lets_encrypt/client_spec.rb b/spec/lib/gitlab/lets_encrypt/client_spec.rb index 16a16acfd25..d63a2fbee04 100644 --- a/spec/lib/gitlab/lets_encrypt/client_spec.rb +++ b/spec/lib/gitlab/lets_encrypt/client_spec.rb @@ -5,12 +5,14 @@ require 'spec_helper' describe ::Gitlab::LetsEncrypt::Client do include LetsEncryptHelpers + set(:private_key) { OpenSSL::PKey::RSA.new(4096).to_pem } let(:client) { described_class.new } before do stub_application_setting( lets_encrypt_notification_email: 'myemail@test.example.com', - lets_encrypt_terms_of_service_accepted: true + lets_encrypt_terms_of_service_accepted: true, + lets_encrypt_private_key: private_key ) end diff --git a/spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb new file mode 100644 index 00000000000..c471c30a194 --- /dev/null +++ b/spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe Gitlab::Metrics::Samplers::PumaSampler do + subject { described_class.new(5) } + let(:null_metric) { double('null_metric', set: nil, observe: nil) } + + before do + allow(Gitlab::Metrics::NullMetric).to receive(:instance).and_return(null_metric) + end + + describe '#sample' do + before do + expect(subject).to receive(:puma_stats).and_return(puma_stats) + end + + context 'in cluster mode' do + let(:puma_stats) do + <<~EOS + { + "workers": 2, + "phase": 2, + "booted_workers": 2, + "old_workers": 0, + "worker_status": [{ + "pid": 32534, + "index": 0, + "phase": 1, + "booted": true, + "last_checkin": "2019-05-15T07:57:55Z", + "last_status": { + "backlog":0, + "running":1, + "pool_capacity":4, + "max_threads": 4 + } + }] + } + EOS + end + + it 'samples master statistics' do + labels = { worker: 'master' } + + expect(subject.metrics[:puma_workers]).to receive(:set).with(labels, 2) + expect(subject.metrics[:puma_running_workers]).to receive(:set).with(labels, 2) + expect(subject.metrics[:puma_stale_workers]).to receive(:set).with(labels, 0) + expect(subject.metrics[:puma_phase]).to receive(:set).once.with(labels, 2) + expect(subject.metrics[:puma_phase]).to receive(:set).once.with({ worker: 'worker_0' }, 1) + + subject.sample + end + + it 'samples worker statistics' do + labels = { worker: 'worker_0' } + + expect_worker_stats(labels) + + subject.sample + end + end + + context 'in single mode' do + let(:puma_stats) do + <<~EOS + { + "backlog":0, + "running":1, + "pool_capacity":4, + "max_threads": 4 + } + EOS + end + + it 'samples worker statistics' do + labels = {} + + expect(subject.metrics[:puma_workers]).to receive(:set).with(labels, 1) + expect(subject.metrics[:puma_running_workers]).to receive(:set).with(labels, 1) + expect_worker_stats(labels) + + subject.sample + end + end + end + + def expect_worker_stats(labels) + expect(subject.metrics[:puma_queued_connections]).to receive(:set).with(labels, 0) + expect(subject.metrics[:puma_active_connections]).to receive(:set).with(labels, 0) + expect(subject.metrics[:puma_running]).to receive(:set).with(labels, 1) + expect(subject.metrics[:puma_pool_capacity]).to receive(:set).with(labels, 4) + expect(subject.metrics[:puma_max_threads]).to receive(:set).with(labels, 4) + expect(subject.metrics[:puma_idle_threads]).to receive(:set).with(labels, 1) + end +end diff --git a/spec/lib/gitlab/rack_timeout_observer_spec.rb b/spec/lib/gitlab/rack_timeout_observer_spec.rb new file mode 100644 index 00000000000..3dc1a8b68fb --- /dev/null +++ b/spec/lib/gitlab/rack_timeout_observer_spec.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe Gitlab::RackTimeoutObserver do + let(:counter) { Gitlab::Metrics::NullMetric.instance } + + before do + allow(Gitlab::Metrics).to receive(:counter) + .with(any_args) + .and_return(counter) + end + + describe '#callback' do + context 'when request times out' do + let(:env) do + { + ::Rack::Timeout::ENV_INFO_KEY => double(state: :timed_out), + 'action_dispatch.request.parameters' => { + 'controller' => 'foo', + 'action' => 'bar' + } + } + end + + subject { described_class.new } + + it 'increments timeout counter' do + expect(counter) + .to receive(:increment) + .with({ controller: 'foo', action: 'bar', route: nil, state: :timed_out }) + + subject.callback.call(env) + end + end + + context 'when request expires' do + let(:endpoint) { double } + let(:env) do + { + ::Rack::Timeout::ENV_INFO_KEY => double(state: :expired), + Grape::Env::API_ENDPOINT => endpoint + } + end + + subject { described_class.new } + + it 'increments timeout counter' do + allow(endpoint).to receive_message_chain('route.pattern.origin') { 'foobar' } + expect(counter) + .to receive(:increment) + .with({ controller: nil, action: nil, route: 'foobar', state: :expired }) + + subject.callback.call(env) + end + end + end +end diff --git a/spec/migrations/generate_lets_encrypt_private_key_spec.rb b/spec/migrations/generate_lets_encrypt_private_key_spec.rb new file mode 100644 index 00000000000..f47cc0c36ef --- /dev/null +++ b/spec/migrations/generate_lets_encrypt_private_key_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' +require Rails.root.join('db', 'migrate', '20190524062810_generate_lets_encrypt_private_key.rb') + +describe GenerateLetsEncryptPrivateKey, :migration do + describe '#up' do + let(:applications_settings) { table(:applications_settings) } + + it 'generates RSA private key and saves it in application settings' do + application_setting = described_class::ApplicationSetting.create! + + described_class.new.up + application_setting.reload + + expect(application_setting.lets_encrypt_private_key).to be_present + expect do + OpenSSL::PKey::RSA.new(application_setting.lets_encrypt_private_key) + end.not_to raise_error + end + end +end diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index bc81c34f7ab..32eef9e0e01 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -3490,6 +3490,18 @@ describe Ci::Build do end end + describe '#report_artifacts' do + subject { build.report_artifacts } + + context 'when the build has reports' do + let!(:report) { create(:ci_job_artifact, :codequality, job: build) } + + it 'returns the artifacts with reports' do + expect(subject).to contain_exactly(report) + end + end + end + describe '#artifacts_metadata_entry' do set(:build) { create(:ci_build, project: project) } let(:path) { 'other_artifacts_0.1.2/another-subdirectory/banana_sample.gif' } diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb index 5964f66c398..e6d682c24d9 100644 --- a/spec/models/ci/job_artifact_spec.rb +++ b/spec/models/ci/job_artifact_spec.rb @@ -23,6 +23,21 @@ describe Ci::JobArtifact do it_behaves_like 'having unique enum values' + describe '.with_reports' do + let!(:artifact) { create(:ci_job_artifact, :archive) } + + subject { described_class.with_reports } + + it { is_expected.to be_empty } + + context 'when there are reports' do + let!(:metrics_report) { create(:ci_job_artifact, :junit) } + let!(:codequality_report) { create(:ci_job_artifact, :codequality) } + + it { is_expected.to eq([metrics_report, codequality_report]) } + end + end + describe '.test_reports' do subject { described_class.test_reports } diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index bfde367c47f..d80183af33e 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -147,6 +147,7 @@ describe Namespace do namespace: namespace, statistics: build(:project_statistics, repository_size: 101, + wiki_size: 505, lfs_objects_size: 202, build_artifacts_size: 303, packages_size: 404)) @@ -157,6 +158,7 @@ describe Namespace do namespace: namespace, statistics: build(:project_statistics, repository_size: 10, + wiki_size: 50, lfs_objects_size: 20, build_artifacts_size: 30, packages_size: 40)) @@ -167,8 +169,9 @@ describe Namespace do project2 statistics = described_class.with_statistics.find(namespace.id) - expect(statistics.storage_size).to eq 1110 + expect(statistics.storage_size).to eq 1665 expect(statistics.repository_size).to eq 111 + expect(statistics.wiki_size).to eq 555 expect(statistics.lfs_objects_size).to eq 222 expect(statistics.build_artifacts_size).to eq 333 expect(statistics.packages_size).to eq 444 @@ -179,6 +182,7 @@ describe Namespace do expect(statistics.storage_size).to eq 0 expect(statistics.repository_size).to eq 0 + expect(statistics.wiki_size).to eq 0 expect(statistics.lfs_objects_size).to eq 0 expect(statistics.build_artifacts_size).to eq 0 expect(statistics.packages_size).to eq 0 diff --git a/spec/models/project_services/pipelines_email_service_spec.rb b/spec/models/project_services/pipelines_email_service_spec.rb index ca17e7453b8..b85565e0c25 100644 --- a/spec/models/project_services/pipelines_email_service_spec.rb +++ b/spec/models/project_services/pipelines_email_service_spec.rb @@ -4,7 +4,11 @@ require 'spec_helper' describe PipelinesEmailService, :mailer do let(:pipeline) do - create(:ci_pipeline, project: project, sha: project.commit('master').sha) + create(:ci_pipeline, :failed, + project: project, + sha: project.commit('master').sha, + ref: project.default_branch + ) end let(:project) { create(:project, :repository) } @@ -84,12 +88,7 @@ describe PipelinesEmailService, :mailer do subject.test(data) end - context 'when pipeline is failed' do - before do - data[:object_attributes][:status] = 'failed' - pipeline.update(status: 'failed') - end - + context 'when pipeline is failed and on default branch' do it_behaves_like 'sending email' end @@ -101,6 +100,25 @@ describe PipelinesEmailService, :mailer do it_behaves_like 'sending email' end + + context 'when pipeline is failed and on a non-default branch' do + before do + data[:object_attributes][:ref] = 'not-the-default-branch' + pipeline.update(ref: 'not-the-default-branch') + end + + context 'with notify_only_default branch on' do + before do + subject.notify_only_default_branch = true + end + + it_behaves_like 'sending email' + end + + context 'with notify_only_default_branch off' do + it_behaves_like 'sending email' + end + end end describe '#execute' do @@ -110,11 +128,6 @@ describe PipelinesEmailService, :mailer do context 'with recipients' do context 'with failed pipeline' do - before do - data[:object_attributes][:status] = 'failed' - pipeline.update(status: 'failed') - end - it_behaves_like 'sending email' end @@ -133,11 +146,6 @@ describe PipelinesEmailService, :mailer do end context 'with failed pipeline' do - before do - data[:object_attributes][:status] = 'failed' - pipeline.update(status: 'failed') - end - it_behaves_like 'sending email' end @@ -150,6 +158,40 @@ describe PipelinesEmailService, :mailer do it_behaves_like 'not sending email' end end + + context 'with notify_only_default_branch off' do + context 'with default branch' do + it_behaves_like 'sending email' + end + + context 'with non default branch' do + before do + data[:object_attributes][:ref] = 'not-the-default-branch' + pipeline.update(ref: 'not-the-default-branch') + end + + it_behaves_like 'sending email' + end + end + + context 'with notify_only_default_branch on' do + before do + subject.notify_only_default_branch = true + end + + context 'with default branch' do + it_behaves_like 'sending email' + end + + context 'with non default branch' do + before do + data[:object_attributes][:ref] = 'not-the-default-branch' + pipeline.update(ref: 'not-the-default-branch') + end + + it_behaves_like 'not sending email' + end + end end context 'with empty recipients list' do diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index 738398a06f9..f985c114d4b 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -16,16 +16,18 @@ describe ProjectStatistics do statistics.update!( commit_count: 8.exabytes - 1, repository_size: 2.exabytes, + wiki_size: 1.exabytes, lfs_objects_size: 2.exabytes, - build_artifacts_size: 4.exabytes - 1 + build_artifacts_size: 3.exabytes - 1 ) statistics.reload expect(statistics.commit_count).to eq(8.exabytes - 1) expect(statistics.repository_size).to eq(2.exabytes) + expect(statistics.wiki_size).to eq(1.exabytes) expect(statistics.lfs_objects_size).to eq(2.exabytes) - expect(statistics.build_artifacts_size).to eq(4.exabytes - 1) + expect(statistics.build_artifacts_size).to eq(3.exabytes - 1) expect(statistics.storage_size).to eq(8.exabytes - 1) end end @@ -33,6 +35,7 @@ describe ProjectStatistics do describe '#total_repository_size' do it "sums repository and LFS object size" do statistics.repository_size = 2 + statistics.wiki_size = 6 statistics.lfs_objects_size = 3 statistics.build_artifacts_size = 4 @@ -40,10 +43,17 @@ describe ProjectStatistics do end end + describe '#wiki_size' do + it "is initialized with not null value" do + expect(statistics.wiki_size).to eq 0 + end + end + describe '#refresh!' do before do allow(statistics).to receive(:update_commit_count) allow(statistics).to receive(:update_repository_size) + allow(statistics).to receive(:update_wiki_size) allow(statistics).to receive(:update_lfs_objects_size) allow(statistics).to receive(:update_storage_size) end @@ -56,6 +66,7 @@ describe ProjectStatistics do it "sums all counters" do expect(statistics).to have_received(:update_commit_count) expect(statistics).to have_received(:update_repository_size) + expect(statistics).to have_received(:update_wiki_size) expect(statistics).to have_received(:update_lfs_objects_size) end end @@ -69,6 +80,45 @@ describe ProjectStatistics do expect(statistics).to have_received(:update_lfs_objects_size) expect(statistics).not_to have_received(:update_commit_count) expect(statistics).not_to have_received(:update_repository_size) + expect(statistics).not_to have_received(:update_wiki_size) + end + end + + context 'without repositories' do + it 'does not crash' do + expect(project.repository.exists?).to be_falsey + expect(project.wiki.repository.exists?).to be_falsey + + statistics.refresh! + + expect(statistics).to have_received(:update_commit_count) + expect(statistics).to have_received(:update_repository_size) + expect(statistics).to have_received(:update_wiki_size) + expect(statistics.repository_size).to eq(0) + expect(statistics.commit_count).to eq(0) + expect(statistics.wiki_size).to eq(0) + end + end + + context 'with deleted repositories' do + let(:project) { create(:project, :repository, :wiki_repo) } + + before do + Gitlab::GitalyClient::StorageSettings.allow_disk_access do + FileUtils.rm_rf(project.repository.path) + FileUtils.rm_rf(project.wiki.repository.path) + end + end + + it 'does not crash' do + statistics.refresh! + + expect(statistics).to have_received(:update_commit_count) + expect(statistics).to have_received(:update_repository_size) + expect(statistics).to have_received(:update_wiki_size) + expect(statistics.repository_size).to eq(0) + expect(statistics.commit_count).to eq(0) + expect(statistics.wiki_size).to eq(0) end end end @@ -95,6 +145,17 @@ describe ProjectStatistics do end end + describe '#update_wiki_size' do + before do + allow(project.wiki.repository).to receive(:size).and_return(34) + statistics.update_wiki_size + end + + it "stores the size of the wiki" do + expect(statistics.wiki_size).to eq 34.megabytes + end + end + describe '#update_lfs_objects_size' do let!(:lfs_object1) { create(:lfs_object, size: 23.megabytes) } let!(:lfs_object2) { create(:lfs_object, size: 34.megabytes) } @@ -114,12 +175,13 @@ describe ProjectStatistics do it "sums all storage counters" do statistics.update!( repository_size: 2, + wiki_size: 4, lfs_objects_size: 3 ) statistics.reload - expect(statistics.storage_size).to eq 5 + expect(statistics.storage_size).to eq 9 end end diff --git a/spec/presenters/label_presenter_spec.rb b/spec/presenters/label_presenter_spec.rb index fae8188670f..d566da7c872 100644 --- a/spec/presenters/label_presenter_spec.rb +++ b/spec/presenters/label_presenter_spec.rb @@ -62,4 +62,32 @@ describe LabelPresenter do expect(label.can_subscribe_to_label_in_different_levels?).to be_falsey end end + + describe '#project_label?' do + context 'with group label' do + subject { group_label.project_label? } + + it { is_expected.to be_falsey } + end + + context 'with project label' do + subject { label.project_label? } + + it { is_expected.to be_truthy } + end + end + + describe '#subject_name' do + context 'with group label' do + subject { group_label.subject_name } + + it { is_expected.to eq(group_label.group.name) } + end + + context 'with project label' do + subject { label.subject_name } + + it { is_expected.to eq(label.project.name) } + end + end end diff --git a/spec/requests/api/graphql/gitlab_schema_spec.rb b/spec/requests/api/graphql/gitlab_schema_spec.rb index dd518274f82..a724c5c3f1c 100644 --- a/spec/requests/api/graphql/gitlab_schema_spec.rb +++ b/spec/requests/api/graphql/gitlab_schema_spec.rb @@ -3,41 +3,82 @@ require 'spec_helper' describe 'GitlabSchema configurations' do include GraphqlHelpers - let(:project) { create(:project, :repository) } - let(:query) { graphql_query_for('project', { 'fullPath' => project.full_path }, %w(id name description)) } - let(:current_user) { create(:user) } + let(:project) { create(:project) } - describe '#max_complexity' do - context 'when complexity is too high' do - it 'shows an error' do - allow(GitlabSchema).to receive(:max_query_complexity).and_return 1 + shared_examples 'imposing query limits' do + describe '#max_complexity' do + context 'when complexity is too high' do + it 'shows an error' do + allow(GitlabSchema).to receive(:max_query_complexity).and_return 1 - post_graphql(query, current_user: nil) + subject - expect(graphql_errors.first['message']).to include('which exceeds max complexity of 1') + expect(graphql_errors.flatten.first['message']).to include('which exceeds max complexity of 1') + end end end - end - describe '#max_depth' do - context 'when query depth is too high' do - it 'shows error' do - errors = [{ "message" => "Query has depth of 2, which exceeds max depth of 1" }] - allow(GitlabSchema).to receive(:max_query_depth).and_return 1 + describe '#max_depth' do + context 'when query depth is too high' do + it 'shows error' do + errors = { "message" => "Query has depth of 2, which exceeds max depth of 1" } + allow(GitlabSchema).to receive(:max_query_depth).and_return 1 - post_graphql(query) + subject - expect(graphql_errors).to eq(errors) + expect(graphql_errors.flatten).to include(errors) + end end + + context 'when query depth is within range' do + it 'has no error' do + allow(GitlabSchema).to receive(:max_query_depth).and_return 5 + + subject + + expect(Array.wrap(graphql_errors).compact).to be_empty + end + end + end + end + + context 'regular queries' do + subject do + query = graphql_query_for('project', { 'fullPath' => project.full_path }, %w(id name description)) + post_graphql(query) end - context 'when query depth is within range' do - it 'has no error' do - allow(GitlabSchema).to receive(:max_query_depth).and_return 5 + it_behaves_like 'imposing query limits' + end + + context 'multiplexed queries' do + subject do + queries = [ + { query: graphql_query_for('project', { 'fullPath' => project.full_path }, %w(id name description)) }, + { query: graphql_query_for('echo', { 'text' => "$test" }, []), variables: { "test" => "Hello world" } } + ] + + post_multiplex(queries) + end + + it_behaves_like 'imposing query limits' do + it "fails all queries when only one of the queries is too complex" do + # The `project` query above has a complexity of 5 + allow(GitlabSchema).to receive(:max_query_complexity).and_return 4 + + subject - post_graphql(query) + # Expect a response for each query, even though it will be empty + expect(json_response.size).to eq(2) + json_response.each do |single_query_response| + expect(single_query_response).not_to have_key('data') + end - expect(graphql_errors).to be_nil + # Expect errors for each query + expect(graphql_errors.size).to eq(2) + graphql_errors.each do |single_query_errors| + expect(single_query_errors.first['message']).to include('which exceeds max complexity of 4') + end end end end diff --git a/spec/requests/api/graphql/multiplexed_queries_spec.rb b/spec/requests/api/graphql/multiplexed_queries_spec.rb new file mode 100644 index 00000000000..844fd979285 --- /dev/null +++ b/spec/requests/api/graphql/multiplexed_queries_spec.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true +require 'spec_helper' + +describe 'Multiplexed queries' do + include GraphqlHelpers + + it 'returns responses for multiple queries' do + queries = [ + { query: 'query($text: String) { echo(text: $text) }', + variables: { 'text' => 'Hello' } }, + { query: 'query($text: String) { echo(text: $text) }', + variables: { 'text' => 'World' } } + ] + + post_multiplex(queries) + + first_response = json_response.first['data']['echo'] + second_response = json_response.last['data']['echo'] + + expect(first_response).to eq('nil says: Hello') + expect(second_response).to eq('nil says: World') + end + + it 'returns error and data combinations' do + queries = [ + { query: 'query($text: String) { broken query }' }, + { query: 'query working($text: String) { echo(text: $text) }', + variables: { 'text' => 'World' } } + ] + + post_multiplex(queries) + + first_response = json_response.first['errors'] + second_response = json_response.last['data']['echo'] + + expect(first_response).not_to be_empty + expect(second_response).to eq('nil says: World') + end +end diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index 7176bc23e34..c41408fba65 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -90,8 +90,9 @@ describe API::Groups do it "includes statistics if requested" do attributes = { - storage_size: 702, + storage_size: 1158, repository_size: 123, + wiki_size: 456, lfs_objects_size: 234, build_artifacts_size: 345 }.stringify_keys diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index b84202364e1..bab1520b960 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -276,6 +276,18 @@ describe API::Users do expect(response).to have_gitlab_http_status(400) end end + + context "when authenticated and ldap is enabled" do + it "returns non-ldap user" do + create :omniauth_user, provider: "ldapserver1" + + get api("/users", user), params: { skip_ldap: "true" } + + expect(response).to have_gitlab_http_status(200) + expect(json_response).to be_an Array + expect(json_response.first["username"]).to eq user.username + end + end end describe "GET /users/:id" do diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index dd9540c11d1..6f40e88d26f 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -138,9 +138,11 @@ describe 'project routing' do describe Projects::AutocompleteSourcesController, 'routing' do [:members, :issues, :merge_requests, :labels, :milestones, :commands, :snippets].each do |action| it "to ##{action}" do - expect(get("/gitlab/gitlabhq/autocomplete_sources/#{action}")).to route_to("projects/autocomplete_sources##{action}", namespace_id: 'gitlab', project_id: 'gitlabhq') + expect(get("/gitlab/gitlabhq/-/autocomplete_sources/#{action}")).to route_to("projects/autocomplete_sources##{action}", namespace_id: 'gitlab', project_id: 'gitlabhq') end end + + it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/autocomplete_sources/labels", "/gitlab/gitlabhq/-/autocomplete_sources/labels" end # pages_project_wikis GET /:project_id/wikis/pages(.:format) projects/wikis#pages @@ -239,7 +241,10 @@ describe 'project routing' do it_behaves_like 'RESTful project resources' do let(:actions) { [:index, :new, :create, :edit, :update] } let(:controller) { 'deploy_keys' } + let(:controller_path) { '/-/deploy_keys' } end + + it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/deploy_keys", "/gitlab/gitlabhq/-/deploy_keys" end # project_protected_branches GET /:project_id/protected_branches(.:format) protected_branches#index @@ -447,7 +452,10 @@ describe 'project routing' do it_behaves_like 'RESTful project resources' do let(:actions) { [:index, :create, :update, :destroy] } let(:controller) { 'project_members' } + let(:controller_path) { '/-/project_members' } end + + it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/project_members", "/gitlab/gitlabhq/-/project_members" end # project_milestones GET /:project_id/milestones(.:format) milestones#index diff --git a/spec/rubocop/cop/qa/element_with_pattern_spec.rb b/spec/rubocop/cop/qa/element_with_pattern_spec.rb index c5beb40f9fd..ef20d9a1f26 100644 --- a/spec/rubocop/cop/qa/element_with_pattern_spec.rb +++ b/spec/rubocop/cop/qa/element_with_pattern_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'rubocop' @@ -23,7 +25,7 @@ describe RuboCop::Cop::QA::ElementWithPattern do element :groups_filter, 'search_field_tag :filter' ^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `qa-groups-filter` instead. element :groups_filter_placeholder, /Search by name/ - ^^^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `qa-groups-filter-placeholder` instead. + ^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `qa-groups-filter-placeholder` instead. end RUBY end @@ -35,6 +37,13 @@ describe RuboCop::Cop::QA::ElementWithPattern do element :groups_filter_placeholder end RUBY + + expect_no_offenses(<<-RUBY) + view 'app/views/shared/groups/_search_form.html.haml' do + element :groups_filter, required: true + element :groups_filter_placeholder, required: false + end + RUBY end end diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb index 1edf69dc290..d922e8246c7 100644 --- a/spec/serializers/build_details_entity_spec.rb +++ b/spec/serializers/build_details_entity_spec.rb @@ -122,5 +122,38 @@ describe BuildDetailsEntity do it { is_expected.to include(failure_reason: 'unmet_prerequisites') } end + + context 'when a build has environment with latest deployment' do + let(:build) do + create(:ci_build, :running, environment: environment.name, pipeline: pipeline) + end + + let(:environment) do + create(:environment, project: project, name: 'staging', state: :available) + end + + before do + create(:deployment, :success, environment: environment, project: project) + + allow(request).to receive(:project).and_return(project) + end + + it 'does not serialize latest deployment commit and associated builds' do + response = subject.with_indifferent_access + + response.dig(:deployment_status, :environment, :last_deployment).tap do |deployment| + expect(deployment).not_to include(:commit, :manual_actions, :scheduled_actions) + end + end + end + + context 'when the build has reports' do + let!(:report) { create(:ci_job_artifact, :codequality, job: build) } + + it 'exposes the report artifacts' do + expect(subject[:reports].count).to eq(1) + expect(subject[:reports].first[:file_type]).to eq('codequality') + end + end end end diff --git a/spec/serializers/deployment_entity_spec.rb b/spec/serializers/deployment_entity_spec.rb index 894fd7a0a12..76ad2aee5c5 100644 --- a/spec/serializers/deployment_entity_spec.rb +++ b/spec/serializers/deployment_entity_spec.rb @@ -10,6 +10,7 @@ describe DeploymentEntity do let(:build) { create(:ci_build, :manual, pipeline: pipeline) } let(:pipeline) { create(:ci_pipeline, project: project, user: user) } let(:entity) { described_class.new(deployment, request: request) } + subject { entity.as_json } before do @@ -47,6 +48,16 @@ describe DeploymentEntity do expect(subject[:manual_actions]).not_to be_present end end + + context 'when deployment details serialization was disabled' do + let(:entity) do + described_class.new(deployment, request: request, deployment_details: false) + end + + it 'does not serialize manual actions details' do + expect(subject.with_indifferent_access).not_to include(:manual_actions) + end + end end describe 'scheduled_actions' do @@ -69,5 +80,35 @@ describe DeploymentEntity do expect(subject[:scheduled_actions]).to be_empty end end + + context 'when deployment details serialization was disabled' do + let(:entity) do + described_class.new(deployment, request: request, deployment_details: false) + end + + it 'does not serialize scheduled actions details' do + expect(subject.with_indifferent_access).not_to include(:scheduled_actions) + end + end + end + + context 'when deployment details serialization was disabled' do + include Gitlab::Routing + + let(:entity) do + described_class.new(deployment, request: request, deployment_details: false) + end + + it 'does not serialize deployment details' do + expect(subject.with_indifferent_access) + .not_to include(:commit, :manual_actions, :scheduled_actions) + end + + it 'only exposes deployable name and path' do + project_job_path(project, deployment.deployable).tap do |path| + expect(subject.fetch(:deployable)) + .to eq(name: 'test', build_path: path) + end + end end end diff --git a/spec/serializers/job_artifact_report_entity_spec.rb b/spec/serializers/job_artifact_report_entity_spec.rb new file mode 100644 index 00000000000..eef5c16d0fb --- /dev/null +++ b/spec/serializers/job_artifact_report_entity_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe JobArtifactReportEntity do + let(:report) { create(:ci_job_artifact, :codequality) } + let(:entity) { described_class.new(report, request: double) } + + describe '#as_json' do + subject { entity.as_json } + + it 'exposes file_type' do + expect(subject[:file_type]).to eq(report.file_type) + end + + it 'exposes file_format' do + expect(subject[:file_format]).to eq(report.file_format) + end + + it 'exposes size' do + expect(subject[:size]).to eq(report.size) + end + + it 'exposes download path' do + expect(subject[:download_path]).to include("jobs/#{report.job.id}/artifacts/download") + end + end +end diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb index 47f767ae4ab..6be612ec226 100644 --- a/spec/serializers/pipeline_entity_spec.rb +++ b/spec/serializers/pipeline_entity_spec.rb @@ -48,8 +48,8 @@ describe PipelineEntity do it 'contains flags' do expect(subject).to include :flags expect(subject[:flags]) - .to include :latest, :stuck, :auto_devops, - :yaml_errors, :retryable, :cancelable, :merge_request + .to include :stuck, :auto_devops, :yaml_errors, + :retryable, :cancelable, :merge_request end end @@ -64,6 +64,12 @@ describe PipelineEntity do create(:ci_build, :failed, pipeline: pipeline) end + it 'does not serialize stage builds' do + subject.with_indifferent_access.dig(:details, :stages, 0).tap do |stage| + expect(stage).not_to include(:groups, :latest_statuses, :retries) + end + end + context 'user has ability to retry pipeline' do before do project.add_developer(user) @@ -92,6 +98,12 @@ describe PipelineEntity do create(:ci_build, :pending, pipeline: pipeline) end + it 'does not serialize stage builds' do + subject.with_indifferent_access.dig(:details, :stages, 0).tap do |stage| + expect(stage).not_to include(:groups, :latest_statuses, :retries) + end + end + context 'user has ability to cancel pipeline' do before do project.add_developer(user) diff --git a/spec/services/projects/update_statistics_service_spec.rb b/spec/services/projects/update_statistics_service_spec.rb index 5000ea58e5f..8534853fbc7 100644 --- a/spec/services/projects/update_statistics_service_spec.rb +++ b/spec/services/projects/update_statistics_service_spec.rb @@ -17,19 +17,9 @@ describe Projects::UpdateStatisticsService do end end - context 'with an existing project without a repository' do + context 'with an existing project' do let(:project) { create(:project) } - it 'does nothing' do - expect_any_instance_of(ProjectStatistics).not_to receive(:refresh!) - - service.execute - end - end - - context 'with an existing project with a repository' do - let(:project) { create(:project, :repository) } - it 'refreshes the project statistics' do expect_any_instance_of(ProjectStatistics).to receive(:refresh!) .with(only: statistics.map(&:to_sym)) diff --git a/spec/services/suggestions/apply_service_spec.rb b/spec/services/suggestions/apply_service_spec.rb index 7732767137c..bdbcb0fdb07 100644 --- a/spec/services/suggestions/apply_service_spec.rb +++ b/spec/services/suggestions/apply_service_spec.rb @@ -5,6 +5,16 @@ require 'spec_helper' describe Suggestions::ApplyService do include ProjectForksHelper + def build_position(args = {}) + default_args = { old_path: "files/ruby/popen.rb", + new_path: "files/ruby/popen.rb", + old_line: nil, + new_line: 9, + diff_refs: merge_request.diff_refs } + + Gitlab::Diff::Position.new(default_args.merge(args)) + end + shared_examples 'successfully creates commit and updates suggestion' do def apply(suggestion) result = subject.execute(suggestion) @@ -43,13 +53,7 @@ describe Suggestions::ApplyService do let(:project) { create(:project, :repository) } let(:user) { create(:user, :commit_email) } - let(:position) do - Gitlab::Diff::Position.new(old_path: "files/ruby/popen.rb", - new_path: "files/ruby/popen.rb", - old_line: nil, - new_line: 9, - diff_refs: merge_request.diff_refs) - end + let(:position) { build_position } let(:diff_note) do create(:diff_note_on_merge_request, noteable: merge_request, position: position, project: project) @@ -333,6 +337,56 @@ describe Suggestions::ApplyService do it_behaves_like 'successfully creates commit and updates suggestion' end + + context 'remove an empty line suggestion' do + let(:expected_content) do + <<~CONTENT + require 'fileutils' + require 'open3' + + module Popen + extend self + + def popen(cmd, path=nil) + unless cmd.is_a?(Array) + raise RuntimeError, "System commands must be given as an array of strings" + end + + path ||= Dir.pwd + vars = { + "PWD" => path + } + + options = { + chdir: path + } + + unless File.directory?(path) + FileUtils.mkdir_p(path) + end + + @cmd_output = "" + @cmd_status = 0 + + Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr| + @cmd_output << stdout.read + @cmd_output << stderr.read + @cmd_status = wait_thr.value.exitstatus + end + + return @cmd_output, @cmd_status + end + end + CONTENT + end + + let(:position) { build_position(new_line: 13) } + let(:suggestion) do + create(:suggestion, :content_from_repo, note: diff_note, to_content: "") + end + + it_behaves_like 'successfully creates commit and updates suggestion' + end end context 'fork-project' do diff --git a/spec/services/suggestions/create_service_spec.rb b/spec/services/suggestions/create_service_spec.rb index ce4990a34a4..ccd44e615a8 100644 --- a/spec/services/suggestions/create_service_spec.rb +++ b/spec/services/suggestions/create_service_spec.rb @@ -151,6 +151,26 @@ describe Suggestions::CreateService do subject.execute end end + + context 'when a patch removes an empty line' do + let(:markdown) do + <<-MARKDOWN.strip_heredoc + ```suggestion + ``` + MARKDOWN + end + let(:position) { build_position(new_line: 13) } + + it 'creates an appliable suggestion' do + subject.execute + + suggestion = note.suggestions.last + + expect(suggestion).to be_appliable + expect(suggestion.from_content).to eq("\n") + expect(suggestion.to_content).to eq("") + end + end end end end diff --git a/spec/support/helpers/graphql_helpers.rb b/spec/support/helpers/graphql_helpers.rb index 44ed9da25fc..e95c7f2a6d6 100644 --- a/spec/support/helpers/graphql_helpers.rb +++ b/spec/support/helpers/graphql_helpers.rb @@ -134,6 +134,10 @@ module GraphqlHelpers end.join(", ") end + def post_multiplex(queries, current_user: nil, headers: {}) + post api('/', current_user, version: 'graphql'), params: { _json: queries }, headers: headers + end + def post_graphql(query, current_user: nil, variables: nil, headers: {}) post api('/', current_user, version: 'graphql'), params: { query: query, variables: variables }, headers: headers end @@ -147,7 +151,14 @@ module GraphqlHelpers end def graphql_errors - json_response['errors'] + case json_response + when Hash # regular query + json_response['errors'] + when Array # multiplexed queries + json_response.map { |response| response['errors'] } + else + raise "Unkown GraphQL response type #{json_response.class}" + end end def graphql_mutation_response(mutation_name) diff --git a/spec/workers/project_cache_worker_spec.rb b/spec/workers/project_cache_worker_spec.rb index 3c40269adc7..51afb076da1 100644 --- a/spec/workers/project_cache_worker_spec.rb +++ b/spec/workers/project_cache_worker_spec.rb @@ -25,10 +25,11 @@ describe ProjectCacheWorker do end context 'with an existing project without a repository' do - it 'does nothing' do + it 'updates statistics but does not refresh the method cashes' do allow_any_instance_of(Repository).to receive(:exists?).and_return(false) - expect(worker).not_to receive(:update_statistics) + expect(worker).to receive(:update_statistics) + expect_any_instance_of(Repository).not_to receive(:refresh_method_caches) worker.perform(project.id) end |