Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3f5447db
Commit
3f5447db
authored
Jun 07, 2019
by
Sarah Yasonik
Committed by
Nick Thomas
Jun 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove metrics_time_window feature flag
parent
d842d80e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
62 deletions
+10
-62
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+1
-5
app/assets/javascripts/monitoring/monitoring_bundle.js
app/assets/javascripts/monitoring/monitoring_bundle.js
+0
-1
app/controllers/clusters/clusters_controller.rb
app/controllers/clusters/clusters_controller.rb
+0
-3
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+0
-3
changelogs/unreleased/62091-remove-time-windows-flag.yml
changelogs/unreleased/62091-remove-time-windows-flag.yml
+5
-0
spec/controllers/projects/environments_controller_spec.rb
spec/controllers/projects/environments_controller_spec.rb
+0
-14
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+4
-36
No files found.
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
3f5447db
...
@@ -106,10 +106,6 @@ export default {
...
@@ -106,10 +106,6 @@ export default {
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
showTimeWindowDropdown
:
{
type
:
Boolean
,
required
:
true
,
},
customMetricsAvailable
:
{
customMetricsAvailable
:
{
type
:
Boolean
,
type
:
Boolean
,
required
:
false
,
required
:
false
,
...
@@ -248,7 +244,7 @@ export default {
...
@@ -248,7 +244,7 @@ export default {
>
>
</gl-dropdown>
</gl-dropdown>
</div>
</div>
<div
v-if=
"showTimeWindowDropdown"
class=
"d-flex align-items-center prepend-left-8"
>
<div
class=
"d-flex align-items-center prepend-left-8"
>
<strong>
{{
s__
(
'
Metrics|Show last
'
)
}}
</strong>
<strong>
{{
s__
(
'
Metrics|Show last
'
)
}}
</strong>
<gl-dropdown
<gl-dropdown
class=
"prepend-left-10 js-time-window-dropdown"
class=
"prepend-left-10 js-time-window-dropdown"
...
...
app/assets/javascripts/monitoring/monitoring_bundle.js
View file @
3f5447db
...
@@ -16,7 +16,6 @@ export default (props = {}) => {
...
@@ -16,7 +16,6 @@ export default (props = {}) => {
props
:
{
props
:
{
...
el
.
dataset
,
...
el
.
dataset
,
hasMetrics
:
parseBoolean
(
el
.
dataset
.
hasMetrics
),
hasMetrics
:
parseBoolean
(
el
.
dataset
.
hasMetrics
),
showTimeWindowDropdown
:
gon
.
features
.
metricsTimeWindow
,
...
props
,
...
props
,
},
},
});
});
...
...
app/controllers/clusters/clusters_controller.rb
View file @
3f5447db
...
@@ -12,9 +12,6 @@ class Clusters::ClustersController < Clusters::BaseController
...
@@ -12,9 +12,6 @@ class Clusters::ClustersController < Clusters::BaseController
before_action
:authorize_update_cluster!
,
only:
[
:update
]
before_action
:authorize_update_cluster!
,
only:
[
:update
]
before_action
:authorize_admin_cluster!
,
only:
[
:destroy
]
before_action
:authorize_admin_cluster!
,
only:
[
:destroy
]
before_action
:update_applications_status
,
only:
[
:cluster_status
]
before_action
:update_applications_status
,
only:
[
:cluster_status
]
before_action
only:
[
:show
]
do
push_frontend_feature_flag
(
:metrics_time_window
)
end
helper_method
:token_in_session
helper_method
:token_in_session
...
...
app/controllers/projects/environments_controller.rb
View file @
3f5447db
...
@@ -11,7 +11,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
...
@@ -11,7 +11,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
before_action
:verify_api_request!
,
only: :terminal_websocket_authorize
before_action
:verify_api_request!
,
only: :terminal_websocket_authorize
before_action
:expire_etag_cache
,
only:
[
:index
]
before_action
:expire_etag_cache
,
only:
[
:index
]
before_action
only:
[
:metrics
,
:additional_metrics
,
:metrics_dashboard
]
do
before_action
only:
[
:metrics
,
:additional_metrics
,
:metrics_dashboard
]
do
push_frontend_feature_flag
(
:metrics_time_window
)
push_frontend_feature_flag
(
:environment_metrics_use_prometheus_endpoint
)
push_frontend_feature_flag
(
:environment_metrics_use_prometheus_endpoint
)
push_frontend_feature_flag
(
:environment_metrics_show_multiple_dashboards
)
push_frontend_feature_flag
(
:environment_metrics_show_multiple_dashboards
)
push_frontend_feature_flag
(
:grafana_dashboard_link
)
push_frontend_feature_flag
(
:grafana_dashboard_link
)
...
@@ -221,8 +220,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
...
@@ -221,8 +220,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
end
def
metrics_params
def
metrics_params
return
unless
Feature
.
enabled?
(
:metrics_time_window
,
project
)
params
.
require
([
:start
,
:end
])
params
.
require
([
:start
,
:end
])
end
end
...
...
changelogs/unreleased/62091-remove-time-windows-flag.yml
0 → 100644
View file @
3f5447db
---
title
:
Allow users to specify a time range on metrics dashboard
merge_request
:
28670
author
:
type
:
added
spec/controllers/projects/environments_controller_spec.rb
View file @
3f5447db
...
@@ -433,20 +433,6 @@ describe Projects::EnvironmentsController do
...
@@ -433,20 +433,6 @@ describe Projects::EnvironmentsController do
end
end
context
'when only one time param is provided'
do
context
'when only one time param is provided'
do
context
'when :metrics_time_window feature flag is disabled'
do
before
do
stub_feature_flags
(
metrics_time_window:
false
)
expect
(
environment
).
to
receive
(
:additional_metrics
).
with
(
no_args
).
and_return
(
nil
)
end
it
'returns a time-window agnostic response'
do
additional_metrics
(
start:
'1552647300.651094'
)
expect
(
response
).
to
have_gitlab_http_status
(
204
)
expect
(
json_response
).
to
eq
({})
end
end
it
'raises an error when start is missing'
do
it
'raises an error when start is missing'
do
expect
{
additional_metrics
(
end:
'1552647300.651094'
)
}
expect
{
additional_metrics
(
end:
'1552647300.651094'
)
}
.
to
raise_error
(
ActionController
::
ParameterMissing
)
.
to
raise_error
(
ActionController
::
ParameterMissing
)
...
...
spec/javascripts/monitoring/dashboard_spec.js
View file @
3f5447db
...
@@ -68,7 +68,7 @@ describe('Dashboard', () => {
...
@@ -68,7 +68,7 @@ describe('Dashboard', () => {
it
(
'
shows a getting started empty state when no metrics are present
'
,
()
=>
{
it
(
'
shows a getting started empty state when no metrics are present
'
,
()
=>
{
component
=
new
DashboardComponent
({
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
showTimeWindowDropdown
:
false
},
propsData
:
{
...
propsData
},
store
,
store
,
});
});
...
@@ -85,7 +85,7 @@ describe('Dashboard', () => {
...
@@ -85,7 +85,7 @@ describe('Dashboard', () => {
it
(
'
shows up a loading state
'
,
done
=>
{
it
(
'
shows up a loading state
'
,
done
=>
{
component
=
new
DashboardComponent
({
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showTimeWindowDropdown
:
false
},
propsData
:
{
...
propsData
,
hasMetrics
:
true
},
store
,
store
,
});
});
...
@@ -102,7 +102,6 @@ describe('Dashboard', () => {
...
@@ -102,7 +102,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showLegend
:
false
,
showLegend
:
false
,
showTimeWindowDropdown
:
false
,
},
},
store
,
store
,
});
});
...
@@ -122,7 +121,6 @@ describe('Dashboard', () => {
...
@@ -122,7 +121,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
},
store
,
store
,
});
});
...
@@ -142,7 +140,6 @@ describe('Dashboard', () => {
...
@@ -142,7 +140,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
},
store
,
store
,
});
});
...
@@ -173,7 +170,6 @@ describe('Dashboard', () => {
...
@@ -173,7 +170,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
},
store
,
store
,
});
});
...
@@ -203,7 +199,6 @@ describe('Dashboard', () => {
...
@@ -203,7 +199,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
},
store
,
store
,
});
});
...
@@ -237,7 +232,6 @@ describe('Dashboard', () => {
...
@@ -237,7 +232,6 @@ describe('Dashboard', () => {
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
environmentsEndpoint
:
''
,
environmentsEndpoint
:
''
,
showTimeWindowDropdown
:
false
,
},
},
store
,
store
,
});
});
...
@@ -250,27 +244,6 @@ describe('Dashboard', () => {
...
@@ -250,27 +244,6 @@ describe('Dashboard', () => {
});
});
});
});
it
(
'
does not show the time window dropdown when the feature flag is not set
'
,
done
=>
{
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
store
,
});
setTimeout
(()
=>
{
const
timeWindowDropdown
=
component
.
$el
.
querySelector
(
'
.js-time-window-dropdown
'
);
expect
(
timeWindowDropdown
).
toBeNull
();
done
();
});
});
it
(
'
renders the time window dropdown with a set of options
'
,
done
=>
{
it
(
'
renders the time window dropdown with a set of options
'
,
done
=>
{
component
=
new
DashboardComponent
({
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
...
@@ -278,7 +251,6 @@ describe('Dashboard', () => {
...
@@ -278,7 +251,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
showTimeWindowDropdown
:
true
,
},
},
store
,
store
,
});
});
...
@@ -304,7 +276,6 @@ describe('Dashboard', () => {
...
@@ -304,7 +276,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
showTimeWindowDropdown
:
true
,
},
},
store
,
store
,
});
});
...
@@ -338,7 +309,7 @@ describe('Dashboard', () => {
...
@@ -338,7 +309,7 @@ describe('Dashboard', () => {
component
=
new
DashboardComponent
({
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showTimeWindowDropdown
:
true
},
propsData
:
{
...
propsData
,
hasMetrics
:
true
},
store
,
store
,
});
});
...
@@ -359,7 +330,7 @@ describe('Dashboard', () => {
...
@@ -359,7 +330,7 @@ describe('Dashboard', () => {
component
=
new
DashboardComponent
({
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showTimeWindowDropdown
:
true
},
propsData
:
{
...
propsData
,
hasMetrics
:
true
},
store
,
store
,
});
});
...
@@ -388,7 +359,6 @@ describe('Dashboard', () => {
...
@@ -388,7 +359,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
},
store
,
store
,
});
});
...
@@ -424,7 +394,6 @@ describe('Dashboard', () => {
...
@@ -424,7 +394,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
externalDashboardUrl
:
'
/mockUrl
'
,
externalDashboardUrl
:
'
/mockUrl
'
,
},
},
store
,
store
,
...
@@ -450,7 +419,6 @@ describe('Dashboard', () => {
...
@@ -450,7 +419,6 @@ describe('Dashboard', () => {
...
propsData
,
...
propsData
,
hasMetrics
:
true
,
hasMetrics
:
true
,
showPanels
:
false
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
externalDashboardUrl
:
''
,
externalDashboardUrl
:
''
,
},
},
store
,
store
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment