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
Léo-Paul Géneau
gitlab-ce
Commits
b5ada8ea
Commit
b5ada8ea
authored
Oct 12, 2017
by
Jose Ivan Vargas Lopez
Committed by
Phil Hughes
Oct 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Prometheus service page shows error"
parent
ba90f023
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
app/assets/javascripts/prometheus_metrics/prometheus_metrics.js
...sets/javascripts/prometheus_metrics/prometheus_metrics.js
+5
-1
changelogs/unreleased/35652-prometheus-service-page-shows-error.yml
.../unreleased/35652-prometheus-service-page-shows-error.yml
+5
-0
spec/javascripts/prometheus_metrics/prometheus_metrics_spec.js
...javascripts/prometheus_metrics/prometheus_metrics_spec.js
+8
-4
No files found.
app/assets/javascripts/prometheus_metrics/prometheus_metrics.js
View file @
b5ada8ea
...
@@ -81,7 +81,11 @@ export default class PrometheusMetrics {
...
@@ -81,7 +81,11 @@ export default class PrometheusMetrics {
loadActiveMetrics
()
{
loadActiveMetrics
()
{
this
.
showMonitoringMetricsPanelState
(
PANEL_STATE
.
LOADING
);
this
.
showMonitoringMetricsPanelState
(
PANEL_STATE
.
LOADING
);
backOff
((
next
,
stop
)
=>
{
backOff
((
next
,
stop
)
=>
{
$
.
getJSON
(
this
.
activeMetricsEndpoint
)
$
.
ajax
({
url
:
this
.
activeMetricsEndpoint
,
dataType
:
'
json
'
,
global
:
false
,
})
.
done
((
res
)
=>
{
.
done
((
res
)
=>
{
if
(
res
&&
res
.
success
)
{
if
(
res
&&
res
.
success
)
{
stop
(
res
);
stop
(
res
);
...
...
changelogs/unreleased/35652-prometheus-service-page-shows-error.yml
0 → 100644
View file @
b5ada8ea
---
title
:
Fix flash errors showing up on a non configured prometheus integration
merge_request
:
35652
author
:
type
:
fixed
spec/javascripts/prometheus_metrics/prometheus_metrics_spec.js
View file @
b5ada8ea
...
@@ -109,12 +109,16 @@ describe('PrometheusMetrics', () => {
...
@@ -109,12 +109,16 @@ describe('PrometheusMetrics', () => {
it
(
'
should show loader animation while response is being loaded and hide it when request is complete
'
,
(
done
)
=>
{
it
(
'
should show loader animation while response is being loaded and hide it when request is complete
'
,
(
done
)
=>
{
const
deferred
=
$
.
Deferred
();
const
deferred
=
$
.
Deferred
();
spyOn
(
$
,
'
getJSON
'
).
and
.
returnValue
(
deferred
.
promise
());
spyOn
(
$
,
'
ajax
'
).
and
.
returnValue
(
deferred
.
promise
());
prometheusMetrics
.
loadActiveMetrics
();
prometheusMetrics
.
loadActiveMetrics
();
expect
(
prometheusMetrics
.
$monitoredMetricsLoading
.
hasClass
(
'
hidden
'
)).
toBeFalsy
();
expect
(
prometheusMetrics
.
$monitoredMetricsLoading
.
hasClass
(
'
hidden
'
)).
toBeFalsy
();
expect
(
$
.
getJSON
).
toHaveBeenCalledWith
(
prometheusMetrics
.
activeMetricsEndpoint
);
expect
(
$
.
ajax
).
toHaveBeenCalledWith
({
url
:
prometheusMetrics
.
activeMetricsEndpoint
,
dataType
:
'
json
'
,
global
:
false
,
});
deferred
.
resolve
({
data
:
metrics
,
success
:
true
});
deferred
.
resolve
({
data
:
metrics
,
success
:
true
});
...
@@ -126,7 +130,7 @@ describe('PrometheusMetrics', () => {
...
@@ -126,7 +130,7 @@ describe('PrometheusMetrics', () => {
it
(
'
should show empty state if response failed to load
'
,
(
done
)
=>
{
it
(
'
should show empty state if response failed to load
'
,
(
done
)
=>
{
const
deferred
=
$
.
Deferred
();
const
deferred
=
$
.
Deferred
();
spyOn
(
$
,
'
getJSON
'
).
and
.
returnValue
(
deferred
.
promise
());
spyOn
(
$
,
'
ajax
'
).
and
.
returnValue
(
deferred
.
promise
());
spyOn
(
prometheusMetrics
,
'
populateActiveMetrics
'
);
spyOn
(
prometheusMetrics
,
'
populateActiveMetrics
'
);
prometheusMetrics
.
loadActiveMetrics
();
prometheusMetrics
.
loadActiveMetrics
();
...
@@ -142,7 +146,7 @@ describe('PrometheusMetrics', () => {
...
@@ -142,7 +146,7 @@ describe('PrometheusMetrics', () => {
it
(
'
should populate metrics list once response is loaded
'
,
(
done
)
=>
{
it
(
'
should populate metrics list once response is loaded
'
,
(
done
)
=>
{
const
deferred
=
$
.
Deferred
();
const
deferred
=
$
.
Deferred
();
spyOn
(
$
,
'
getJSON
'
).
and
.
returnValue
(
deferred
.
promise
());
spyOn
(
$
,
'
ajax
'
).
and
.
returnValue
(
deferred
.
promise
());
spyOn
(
prometheusMetrics
,
'
populateActiveMetrics
'
);
spyOn
(
prometheusMetrics
,
'
populateActiveMetrics
'
);
prometheusMetrics
.
loadActiveMetrics
();
prometheusMetrics
.
loadActiveMetrics
();
...
...
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