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
d82880b2
Commit
d82880b2
authored
Mar 12, 2021
by
Sarah GP
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust link performance
parent
7c2299a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
1 deletion
+90
-1
app/assets/javascripts/pipelines/components/graph_shared/links_inner.vue
...scripts/pipelines/components/graph_shared/links_inner.vue
+1
-1
app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue
...scripts/pipelines/components/graph_shared/links_layer.vue
+89
-0
No files found.
app/assets/javascripts/pipelines/components/graph_shared/links_inner.vue
View file @
d82880b2
...
@@ -148,7 +148,7 @@ export default {
...
@@ -148,7 +148,7 @@ export default {
const
data
=
{
const
data
=
{
histograms
:
[
histograms
:
[
{
name
:
PIPELINES_DETAIL_LINK_DURATION
,
value
:
duration
},
{
name
:
PIPELINES_DETAIL_LINK_DURATION
,
value
:
duration
/
1000
},
{
name
:
PIPELINES_DETAIL_LINKS_TOTAL
,
value
:
this
.
links
.
length
},
{
name
:
PIPELINES_DETAIL_LINKS_TOTAL
,
value
:
this
.
links
.
length
},
{
{
name
:
PIPELINES_DETAIL_LINKS_JOB_RATIO
,
name
:
PIPELINES_DETAIL_LINKS_JOB_RATIO
,
...
...
app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue
View file @
d82880b2
<
script
>
<
script
>
import
{
isEmpty
}
from
'
lodash
'
;
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
PIPELINES_DETAIL_LINKS_MARK_CALCULATE_START
,
PIPELINES_DETAIL_LINKS_MARK_CALCULATE_END
,
PIPELINES_DETAIL_LINKS_MEASURE_CALCULATION
,
PIPELINES_DETAIL_LINK_DURATION
,
PIPELINES_DETAIL_LINKS_TOTAL
,
PIPELINES_DETAIL_LINKS_JOB_RATIO
,
}
from
'
~/performance/constants
'
;
import
{
performanceMarkAndMeasure
}
from
'
~/performance/utils
'
;
import
{
reportToSentry
}
from
'
../graph/utils
'
;
import
{
reportToSentry
}
from
'
../graph/utils
'
;
import
LinksInner
from
'
./links_inner.vue
'
;
import
LinksInner
from
'
./links_inner.vue
'
;
import
{
parseData
}
from
'
../parsing_utils
'
;
import
{
reportPerformance
}
from
'
./api
'
;
export
default
{
export
default
{
name
:
'
LinksLayer
'
,
name
:
'
LinksLayer
'
,
...
@@ -20,6 +32,11 @@ export default {
...
@@ -20,6 +32,11 @@ export default {
type
:
Array
,
type
:
Array
,
required
:
true
,
required
:
true
,
},
},
metricsConfig
:
{
type
:
Object
,
required
:
false
,
default
:
()
=>
({}),
},
neverShowLinks
:
{
neverShowLinks
:
{
type
:
Boolean
,
type
:
Boolean
,
required
:
false
,
required
:
false
,
...
@@ -47,6 +64,9 @@ export default {
...
@@ -47,6 +64,9 @@ export default {
return
acc
+
Number
(
groups
.
length
);
return
acc
+
Number
(
groups
.
length
);
},
0
);
},
0
);
},
},
shouldCollectMetrics
()
{
return
this
.
metricsConfig
.
collectMetrics
&&
this
.
metricsConfig
.
path
;
},
showAlert
()
{
showAlert
()
{
/*
/*
This is a hard override that allows us to turn off the links without
This is a hard override that allows us to turn off the links without
...
@@ -75,7 +95,64 @@ export default {
...
@@ -75,7 +95,64 @@ export default {
errorCaptured
(
err
,
_vm
,
info
)
{
errorCaptured
(
err
,
_vm
,
info
)
{
reportToSentry
(
this
.
$options
.
name
,
`error:
${
err
}
, info:
${
info
}
`
);
reportToSentry
(
this
.
$options
.
name
,
`error:
${
err
}
, info:
${
info
}
`
);
},
},
mounted
(){
/*
This is code to get metrics for the graph (to observe links performance).
It is currently here because we want values for links without drawing them.
It can be removed when https://gitlab.com/gitlab-org/gitlab/-/issues/298930
is closed and functionality is enabled by default.
*/
if
(
this
.
neverShowLinks
&&
!
isEmpty
(
this
.
pipelineData
))
{
window
.
requestAnimationFrame
(()
=>
{
this
.
prepareLinkData
();
})
}
},
methods
:
{
methods
:
{
beginPerfMeasure
()
{
if
(
this
.
shouldCollectMetrics
)
{
performanceMarkAndMeasure
({
mark
:
PIPELINES_DETAIL_LINKS_MARK_CALCULATE_START
});
}
},
finishPerfMeasureAndSend
(
numLinks
)
{
if
(
this
.
shouldCollectMetrics
)
{
performanceMarkAndMeasure
({
mark
:
PIPELINES_DETAIL_LINKS_MARK_CALCULATE_END
,
measures
:
[
{
name
:
PIPELINES_DETAIL_LINKS_MEASURE_CALCULATION
,
start
:
PIPELINES_DETAIL_LINKS_MARK_CALCULATE_START
,
},
],
});
}
window
.
requestAnimationFrame
(()
=>
{
const
duration
=
window
.
performance
.
getEntriesByName
(
PIPELINES_DETAIL_LINKS_MEASURE_CALCULATION
,
)[
0
]?.
duration
;
if
(
!
duration
)
{
return
;
}
const
data
=
{
histograms
:
[
{
name
:
PIPELINES_DETAIL_LINK_DURATION
,
value
:
duration
/
1000
},
{
name
:
PIPELINES_DETAIL_LINKS_TOTAL
,
value
:
numLinks
},
{
name
:
PIPELINES_DETAIL_LINKS_JOB_RATIO
,
value
:
numLinks
/
this
.
numGroups
,
},
],
};
reportPerformance
(
this
.
metricsConfig
.
path
,
data
);
});
},
dismissAlert
()
{
dismissAlert
()
{
this
.
alertDismissed
=
true
;
this
.
alertDismissed
=
true
;
},
},
...
@@ -83,6 +160,17 @@ export default {
...
@@ -83,6 +160,17 @@ export default {
this
.
dismissAlert
();
this
.
dismissAlert
();
this
.
showLinksOverride
=
true
;
this
.
showLinksOverride
=
true
;
},
},
prepareLinkData
()
{
this
.
beginPerfMeasure
();
let
numLinks
;
try
{
const
arrayOfJobs
=
this
.
pipelineData
.
flatMap
(({
groups
})
=>
groups
);
numLinks
=
parseData
(
arrayOfJobs
).
links
.
length
;
}
catch
(
err
)
{
reportToSentry
(
this
.
$options
.
name
,
err
);
}
this
.
finishPerfMeasureAndSend
(
numLinks
);
},
},
},
};
};
</
script
>
</
script
>
...
@@ -92,6 +180,7 @@ export default {
...
@@ -92,6 +180,7 @@ export default {
:container-measurements=
"containerMeasurements"
:container-measurements=
"containerMeasurements"
:pipeline-data=
"pipelineData"
:pipeline-data=
"pipelineData"
:total-groups=
"numGroups"
:total-groups=
"numGroups"
:metrics-config=
"metricsConfig"
v-bind=
"$attrs"
v-bind=
"$attrs"
v-on=
"$listeners"
v-on=
"$listeners"
>
>
...
...
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