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
0
Merge Requests
0
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
Boxiang Sun
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 {
type
:
String
,
required
:
true
,
},
showTimeWindowDropdown
:
{
type
:
Boolean
,
required
:
true
,
},
customMetricsAvailable
:
{
type
:
Boolean
,
required
:
false
,
...
...
@@ -248,7 +244,7 @@ export default {
>
</gl-dropdown>
</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>
<gl-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 = {}) => {
props
:
{
...
el
.
dataset
,
hasMetrics
:
parseBoolean
(
el
.
dataset
.
hasMetrics
),
showTimeWindowDropdown
:
gon
.
features
.
metricsTimeWindow
,
...
props
,
},
});
...
...
app/controllers/clusters/clusters_controller.rb
View file @
3f5447db
...
...
@@ -12,9 +12,6 @@ class Clusters::ClustersController < Clusters::BaseController
before_action
:authorize_update_cluster!
,
only:
[
:update
]
before_action
:authorize_admin_cluster!
,
only:
[
:destroy
]
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
...
...
app/controllers/projects/environments_controller.rb
View file @
3f5447db
...
...
@@ -11,7 +11,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
before_action
:verify_api_request!
,
only: :terminal_websocket_authorize
before_action
:expire_etag_cache
,
only:
[
:index
]
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_show_multiple_dashboards
)
push_frontend_feature_flag
(
:grafana_dashboard_link
)
...
...
@@ -221,8 +220,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
def
metrics_params
return
unless
Feature
.
enabled?
(
:metrics_time_window
,
project
)
params
.
require
([
:start
,
: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
end
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
expect
{
additional_metrics
(
end:
'1552647300.651094'
)
}
.
to
raise_error
(
ActionController
::
ParameterMissing
)
...
...
spec/javascripts/monitoring/dashboard_spec.js
View file @
3f5447db
...
...
@@ -68,7 +68,7 @@ describe('Dashboard', () => {
it
(
'
shows a getting started empty state when no metrics are present
'
,
()
=>
{
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
showTimeWindowDropdown
:
false
},
propsData
:
{
...
propsData
},
store
,
});
...
...
@@ -85,7 +85,7 @@ describe('Dashboard', () => {
it
(
'
shows up a loading state
'
,
done
=>
{
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showTimeWindowDropdown
:
false
},
propsData
:
{
...
propsData
,
hasMetrics
:
true
},
store
,
});
...
...
@@ -102,7 +102,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showLegend
:
false
,
showTimeWindowDropdown
:
false
,
},
store
,
});
...
...
@@ -122,7 +121,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
store
,
});
...
...
@@ -142,7 +140,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
store
,
});
...
...
@@ -173,7 +170,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
store
,
});
...
...
@@ -203,7 +199,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
store
,
});
...
...
@@ -237,7 +232,6 @@ describe('Dashboard', () => {
hasMetrics
:
true
,
showPanels
:
false
,
environmentsEndpoint
:
''
,
showTimeWindowDropdown
:
false
,
},
store
,
});
...
...
@@ -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
=>
{
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
...
...
@@ -278,7 +251,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
true
,
},
store
,
});
...
...
@@ -304,7 +276,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
true
,
},
store
,
});
...
...
@@ -338,7 +309,7 @@ describe('Dashboard', () => {
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showTimeWindowDropdown
:
true
},
propsData
:
{
...
propsData
,
hasMetrics
:
true
},
store
,
});
...
...
@@ -359,7 +330,7 @@ describe('Dashboard', () => {
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showTimeWindowDropdown
:
true
},
propsData
:
{
...
propsData
,
hasMetrics
:
true
},
store
,
});
...
...
@@ -388,7 +359,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
},
store
,
});
...
...
@@ -424,7 +394,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
externalDashboardUrl
:
'
/mockUrl
'
,
},
store
,
...
...
@@ -450,7 +419,6 @@ describe('Dashboard', () => {
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
,
showTimeWindowDropdown
:
false
,
externalDashboardUrl
:
''
,
},
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