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
596fe67a
Commit
596fe67a
authored
Aug 29, 2017
by
Mike Greiling
Committed by
Phil Hughes
Aug 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Monitoring graph date formatting is wrong"
parent
f0d22bb6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
15 deletions
+27
-15
app/assets/javascripts/monitoring/components/monitoring_column.vue
...s/javascripts/monitoring/components/monitoring_column.vue
+2
-0
app/assets/javascripts/monitoring/components/monitoring_deployment.vue
...vascripts/monitoring/components/monitoring_deployment.vue
+3
-6
app/assets/javascripts/monitoring/components/monitoring_flag.vue
...ets/javascripts/monitoring/components/monitoring_flag.vue
+2
-5
app/assets/javascripts/monitoring/constants.js
app/assets/javascripts/monitoring/constants.js
+0
-4
app/assets/javascripts/monitoring/utils/date_time_formatters.js
...sets/javascripts/monitoring/utils/date_time_formatters.js
+15
-0
changelogs/unreleased/37104-fix-graph-date-format.yml
changelogs/unreleased/37104-fix-graph-date-format.yml
+5
-0
No files found.
app/assets/javascripts/monitoring/components/monitoring_column.vue
View file @
596fe67a
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
measurements
from
'
../utils/measurements
'
;
import
measurements
from
'
../utils/measurements
'
;
import
{
formatRelevantDigits
}
from
'
../../lib/utils/number_utils
'
;
import
{
formatRelevantDigits
}
from
'
../../lib/utils/number_utils
'
;
import
{
timeScaleFormat
}
from
'
../utils/date_time_formatters
'
;
import
bp
from
'
../../breakpoints
'
;
import
bp
from
'
../../breakpoints
'
;
const
bisectDate
=
d3
.
bisector
(
d
=>
d
.
time
).
left
;
const
bisectDate
=
d3
.
bisector
(
d
=>
d
.
time
).
left
;
...
@@ -159,6 +160,7 @@
...
@@ -159,6 +160,7 @@
const
xAxis
=
d3
.
svg
.
axis
()
const
xAxis
=
d3
.
svg
.
axis
()
.
scale
(
axisXScale
)
.
scale
(
axisXScale
)
.
ticks
(
measurements
.
xTicks
)
.
ticks
(
measurements
.
xTicks
)
.
tickFormat
(
timeScaleFormat
)
.
orient
(
'
bottom
'
);
.
orient
(
'
bottom
'
);
const
yAxis
=
d3
.
svg
.
axis
()
const
yAxis
=
d3
.
svg
.
axis
()
...
...
app/assets/javascripts/monitoring/components/monitoring_deployment.vue
View file @
596fe67a
<
script
>
<
script
>
import
{
import
{
dateFormat
,
timeFormat
}
from
'
../utils/date_time_formatters
'
;
dateFormat
,
timeFormat
,
}
from
'
../constants
'
;
export
default
{
export
default
{
props
:
{
props
:
{
...
@@ -58,7 +55,7 @@
...
@@ -58,7 +55,7 @@
class=
"deploy-info"
class=
"deploy-info"
v-if=
"showDeployInfo"
>
v-if=
"showDeployInfo"
>
<g
<g
v-for=
"(deployment, index) in deploymentData"
v-for=
"(deployment, index) in deploymentData"
:key=
"index"
:key=
"index"
:class=
"nameDeploymentClass(deployment)"
:class=
"nameDeploymentClass(deployment)"
:transform=
"transformDeploymentGroup(deployment)"
>
:transform=
"transformDeploymentGroup(deployment)"
>
...
@@ -92,7 +89,7 @@
...
@@ -92,7 +89,7 @@
width=
"90"
width=
"90"
height=
"58"
>
height=
"58"
>
</rect>
</rect>
<g
<g
transform=
"translate(5, 2)"
>
transform=
"translate(5, 2)"
>
<text
<text
class=
"deploy-info-text text-metric-bold"
>
class=
"deploy-info-text text-metric-bold"
>
...
...
app/assets/javascripts/monitoring/components/monitoring_flag.vue
View file @
596fe67a
<
script
>
<
script
>
import
{
import
{
dateFormat
,
timeFormat
}
from
'
../utils/date_time_formatters
'
;
dateFormat
,
timeFormat
,
}
from
'
../constants
'
;
export
default
{
export
default
{
props
:
{
props
:
{
...
@@ -72,7 +69,7 @@
...
@@ -72,7 +69,7 @@
r=
"5"
r=
"5"
transform=
"translate(-5, 20)"
>
transform=
"translate(-5, 20)"
>
</circle>
</circle>
<svg
<svg
class=
"rect-text-metric"
class=
"rect-text-metric"
:x=
"currentFlagPosition"
:x=
"currentFlagPosition"
y=
"0"
>
y=
"0"
>
...
...
app/assets/javascripts/monitoring/constants.js
deleted
100644 → 0
View file @
f0d22bb6
import
d3
from
'
d3
'
;
export
const
dateFormat
=
d3
.
time
.
format
(
'
%b %d, %Y
'
);
export
const
timeFormat
=
d3
.
time
.
format
(
'
%H:%M%p
'
);
app/assets/javascripts/monitoring/utils/date_time_formatters.js
0 → 100644
View file @
596fe67a
import
d3
from
'
d3
'
;
export
const
dateFormat
=
d3
.
time
.
format
(
'
%b %-d, %Y
'
);
export
const
timeFormat
=
d3
.
time
.
format
(
'
%-I:%M%p
'
);
export
const
timeScaleFormat
=
d3
.
time
.
format
.
multi
([
[
'
.%L
'
,
d
=>
d
.
getMilliseconds
()],
[
'
:%S
'
,
d
=>
d
.
getSeconds
()],
[
'
%-I:%M
'
,
d
=>
d
.
getMinutes
()],
[
'
%-I %p
'
,
d
=>
d
.
getHours
()],
[
'
%a %-d
'
,
d
=>
d
.
getDay
()
&&
d
.
getDate
()
!==
1
],
[
'
%b %-d
'
,
d
=>
d
.
getDate
()
!==
1
],
[
'
%B
'
,
d
=>
d
.
getMonth
()],
[
'
%Y
'
,
()
=>
true
],
]);
changelogs/unreleased/37104-fix-graph-date-format.yml
0 → 100644
View file @
596fe67a
---
title
:
Fix incorrect date/time formatting on prometheus graphs
merge_request
:
13865
author
:
type
:
fixed
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