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
51a9797d
Commit
51a9797d
authored
Nov 30, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restored the timeScaleFormat for the prometheus dashboard
parent
4e0e2fd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
6 deletions
+41
-6
app/assets/javascripts/monitoring/components/graph.vue
app/assets/javascripts/monitoring/components/graph.vue
+3
-2
app/assets/javascripts/monitoring/utils/date_time_formatters.js
...sets/javascripts/monitoring/utils/date_time_formatters.js
+38
-4
No files found.
app/assets/javascripts/monitoring/components/graph.vue
View file @
51a9797d
...
...
@@ -10,7 +10,7 @@
import
MonitoringMixin
from
'
../mixins/monitoring_mixins
'
;
import
eventHub
from
'
../event_hub
'
;
import
measurements
from
'
../utils/measurements
'
;
import
{
bisectDate
}
from
'
../utils/date_time_formatters
'
;
import
{
bisectDate
,
timeScaleFormat
}
from
'
../utils/date_time_formatters
'
;
import
createTimeSeries
from
'
../utils/multiple_time_series
'
;
import
bp
from
'
../../breakpoints
'
;
...
...
@@ -171,7 +171,8 @@
axisYScale
.
domain
([
0
,
d3
.
max
(
allValues
.
map
(
d
=>
d
.
value
))]);
const
xAxis
=
d3
.
axisBottom
()
.
scale
(
axisXScale
);
.
scale
(
axisXScale
)
.
tickFormat
(
timeScaleFormat
);
const
yAxis
=
d3
.
axisLeft
()
.
scale
(
axisYScale
)
...
...
app/assets/javascripts/monitoring/utils/date_time_formatters.js
View file @
51a9797d
import
{
timeFormat
as
time
}
from
'
d3-time-format
'
;
import
{
timeSecond
,
timeMinute
,
timeHour
,
timeDay
,
timeMonth
,
timeYear
}
from
'
d3-time
'
;
import
{
bisector
}
from
'
d3-array
'
;
export
const
dateFormat
=
time
(
'
%b %-d, %Y
'
);
export
const
timeFormat
=
time
(
'
%-I:%M%p
'
);
export
const
dateFormatWithName
=
time
(
'
%a, %b %-d
'
);
export
const
bisectDate
=
bisector
(
d
=>
d
.
time
).
left
;
const
d3
=
{
time
,
bisector
,
timeSecond
,
timeMinute
,
timeHour
,
timeDay
,
timeMonth
,
timeYear
};
export
const
dateFormat
=
d3
.
time
(
'
%b %-d, %Y
'
);
export
const
timeFormat
=
d3
.
time
(
'
%-I:%M%p
'
);
export
const
dateFormatWithName
=
d3
.
time
(
'
%a, %b %-d
'
);
export
const
bisectDate
=
d3
.
bisector
(
d
=>
d
.
time
).
left
;
const
formatMillisecond
=
d3
.
time
(
'
.%L
'
);
const
formatSecond
=
d3
.
time
(
'
:%S
'
);
const
formatMinute
=
d3
.
time
(
'
%-I:%M
'
);
const
formatHour
=
d3
.
time
(
'
%-I %p
'
);
const
formatDay
=
d3
.
time
(
'
%a %d
'
);
const
formatWeek
=
d3
.
time
(
'
%b %d
'
);
const
formatMonth
=
d3
.
time
(
'
%B
'
);
const
formatYear
=
d3
.
time
(
'
%Y
'
);
export
function
timeScaleFormat
(
date
)
{
let
formatFunction
;
if
(
d3
.
timeSecond
(
date
)
<
date
)
{
formatFunction
=
formatMillisecond
;
}
else
if
(
d3
.
timeMinute
(
date
)
<
date
)
{
formatFunction
=
formatSecond
;
}
else
if
(
d3
.
timeHour
(
date
)
<
date
)
{
formatFunction
=
formatMinute
;
}
else
if
(
d3
.
timeDay
(
date
)
<
date
)
{
formatFunction
=
formatHour
;
}
else
if
(
d3
.
timeWeek
(
date
)
<
date
)
{
formatFunction
=
formatDay
;
}
else
if
(
d3
.
timeMonth
(
date
)
<
date
)
{
formatFunction
=
formatWeek
;
}
else
if
(
d3
.
timeYear
(
date
)
<
date
)
{
formatFunction
=
formatMonth
;
}
else
{
formatFunction
=
formatYear
;
}
return
formatFunction
(
date
);
}
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