Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
15de8c00
Commit
15de8c00
authored
8 months ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
disable statistics for integration tests
parent
b69a5181
No related branches found
Branches containing commit
No related tags found
1 merge request
!2242
Translated using Weblate (Danish)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab/ci/integrationtest.yml
+1
-0
1 addition, 0 deletions
.gitlab/ci/integrationtest.yml
metager/resources/js/statistics.js
+17
-12
17 additions, 12 deletions
metager/resources/js/statistics.js
with
18 additions
and
12 deletions
.gitlab/ci/integrationtest.yml
+
1
−
0
View file @
15de8c00
...
...
@@ -10,6 +10,7 @@ integrationtest:
BRANCH_NAME
:
$CI_COMMIT_REF_NAME
COMMIT_NAME
:
$CI_COMMIT_REF_SLUG
SELENIUM_HOST
:
selenium-standalone-firefox
MATOMO_ENABLED
:
false
dependencies
:
[]
# No artifacts required
before_script
:
-
export COMPOSER_HOME=$(pwd)/metager/.composer
...
...
This diff is collapsed.
Click to expand it.
metager/resources/js/statistics.js
+
17
−
12
View file @
15de8c00
...
...
@@ -4,6 +4,7 @@
*/
class
Statistics
{
#load_complete
=
false
;
#load_time
=
new
Date
();
constructor
()
{
let
performance
=
window
.
performance
.
getEntriesByType
(
'
navigation
'
)[
0
];
...
...
@@ -14,7 +15,6 @@ class Statistics {
let
readyStateCheckInterval
=
setInterval
(()
=>
{
performance
=
window
.
performance
.
getEntriesByType
(
'
navigation
'
)[
0
];
if
(
performance
.
loadEventEnd
==
0
)
return
;
console
.
log
(
"
load end
"
);
clearInterval
(
readyStateCheckInterval
);
this
.
#init
();
},
100
);
...
...
@@ -23,29 +23,34 @@ class Statistics {
}
#init
()
{
this
.
pageLoad
(
);
setTimeout
(
this
.
pageLoad
.
bind
(
this
),
60000
);
document
.
querySelectorAll
(
"
a
"
).
forEach
(
anchor
=>
{
anchor
.
addEventListener
(
"
click
"
,
e
=>
this
.
pageLeave
(
e
.
target
.
href
).
bind
(
this
));
anchor
.
addEventListener
(
"
click
"
,
e
=>
this
.
pageLeave
(
e
.
target
.
closest
(
"
a
"
).
href
));
});
}
pageLeave
(
target
)
{
let
params
=
{};
params
.
url
=
target
;
params
.
link
=
target
;
try
{
this
.
pageLoad
();
// Make sure to track the initial page load
let
url
=
new
URL
(
target
);
if
(
url
.
host
==
document
.
location
.
host
)
return
;
this
.
pageLoad
(
params
);
navigator
.
sendBeacon
(
"
/stats/pl
"
,
new
URLSearchParams
(
params
));
}
catch
(
error
)
{
}
if
(
url
.
host
!=
document
.
location
.
host
)
{
params
.
link
=
target
;
params
.
url
=
target
;
this
.
pageLoad
(
params
);
}
}
catch
(
error
)
{
console
.
error
(
error
)
}
}
pageLoad
(
overwrite_params
=
{})
{
if
(
this
.
#load_complete
)
return
;
this
.
#load_complete
=
true
;
let
params
=
{};
if
(
this
.
#load_complete
&&
!
overwrite_params
.
hasOwnProperty
(
"
link
"
))
return
;
if
(
!
this
.
#load_complete
)
{
params
.
cdt
=
this
.
#load_time
.
getTime
();
this
.
#load_complete
=
true
;
}
// Page performance
try
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment