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
3fad597e
Commit
3fad597e
authored
Oct 26, 2018
by
Jose Ivan Vargas
Committed by
Mike Greiling
Oct 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "No longer require a deploy to start Prometheus monitoring" - EE
parent
edd6fc97
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
39 deletions
+31
-39
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+5
-1
app/models/environment.rb
app/models/environment.rb
+1
-1
changelogs/unreleased/45068-no-longer-require-a-deploy-to-start-prometheus-monitoring.yml
...onger-require-a-deploy-to-start-prometheus-monitoring.yml
+5
-0
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+16
-0
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+4
-37
No files found.
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
3fad597e
...
...
@@ -175,6 +175,7 @@ export default {
this
.
state
=
'
noData
'
;
return
;
}
this
.
showEmptyState
=
false
;
})
.
then
(
this
.
resize
)
...
...
@@ -216,7 +217,10 @@ export default {
name=
"chevron-down"
/>
</button>
<div
class=
"dropdown-menu dropdown-menu-selectable dropdown-menu-drop-up"
>
<div
v-if=
"store.environmentsData.length > 0"
class=
"dropdown-menu dropdown-menu-selectable dropdown-menu-drop-up"
>
<ul>
<li
v-for=
"environment in store.environmentsData"
...
...
app/models/environment.rb
View file @
3fad597e
...
...
@@ -155,7 +155,7 @@ class Environment < ActiveRecord::Base
end
def
has_metrics?
prometheus_adapter
&
.
can_query?
&&
available?
&&
last_deployment
.
present?
prometheus_adapter
&
.
can_query?
&&
available?
end
def
metrics
...
...
changelogs/unreleased/45068-no-longer-require-a-deploy-to-start-prometheus-monitoring.yml
0 → 100644
View file @
3fad597e
---
title
:
No longer require a deploy to start Prometheus monitoring
merge_request
:
22401
author
:
type
:
changed
spec/javascripts/monitoring/dashboard_spec.js
View file @
3fad597e
...
...
@@ -113,6 +113,22 @@ describe('Dashboard', () => {
});
});
it
(
'
hides the dropdown list when there is no environments
'
,
done
=>
{
const
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
},
});
component
.
store
.
storeEnvironmentsData
([]);
setTimeout
(()
=>
{
const
dropdownMenuEnvironments
=
component
.
$el
.
querySelectorAll
(
'
.dropdown-menu ul
'
);
expect
(
dropdownMenuEnvironments
.
length
).
toEqual
(
0
);
done
();
});
});
it
(
'
renders the dropdown with a single is-active element
'
,
done
=>
{
const
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
...
...
spec/models/environment_spec.rb
View file @
3fad597e
...
...
@@ -334,7 +334,7 @@ describe Environment do
describe
'#has_terminals?'
do
subject
{
environment
.
has_terminals?
}
context
'when the enviroment is available'
do
context
'when the enviro
n
ment is available'
do
context
'with a deployment service'
do
shared_examples
'same behavior between KubernetesService and Platform::Kubernetes'
do
context
'and a deployment'
do
...
...
@@ -492,7 +492,7 @@ describe Environment do
describe
'#has_metrics?'
do
subject
{
environment
.
has_metrics?
}
context
'when the enviroment is available'
do
context
'when the enviro
n
ment is available'
do
context
'with a deployment service'
do
let
(
:project
)
{
create
(
:prometheus_project
)
}
...
...
@@ -501,8 +501,8 @@ describe Environment do
it
{
is_expected
.
to
be_truthy
}
end
context
'
but
no deployments'
do
it
{
is_expected
.
to
be_
fals
y
}
context
'
and
no deployments'
do
it
{
is_expected
.
to
be_
truth
y
}
end
end
...
...
@@ -549,39 +549,6 @@ describe Environment do
end
end
describe
'#has_metrics?'
do
subject
{
environment
.
has_metrics?
}
context
'when the enviroment is available'
do
context
'with a deployment service'
do
let
(
:project
)
{
create
(
:prometheus_project
)
}
context
'and a deployment'
do
let!
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
)
}
it
{
is_expected
.
to
be_truthy
}
end
context
'but no deployments'
do
it
{
is_expected
.
to
be_falsy
}
end
end
context
'without a monitoring service'
do
it
{
is_expected
.
to
be_falsy
}
end
end
context
'when the environment is unavailable'
do
let
(
:project
)
{
create
(
:prometheus_project
)
}
before
do
environment
.
stop
end
it
{
is_expected
.
to
be_falsy
}
end
end
describe
'#additional_metrics'
do
let
(
:project
)
{
create
(
:prometheus_project
)
}
subject
{
environment
.
additional_metrics
}
...
...
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