Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drawing-app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
hlgr
drawing-app
Compare revisions
master to a88dda00c4759432b32b10c56329186324ebcc51
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
hlgr/drawing-app
Select target project
No results found
a88dda00c4759432b32b10c56329186324ebcc51
Select Git revision
Branches
NativeCRDT
circle-recognition
e2e-benchmark
erasure-masks
master
path-attributes
xmpp-connection
Tags
AsPresented
8 results
Swap
Target
sweng-group-15/drawing-app
Select target project
hlgr/drawing-app
sweng-group-15/drawing-app
2 results
master
Select Git revision
Branches
NativeCRDT
circle-recognition
e2e-benchmark
erasure-masks
master
path-attributes
xmpp-connection
7 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Add a simple end-to-end benchmark
· a88dda00
Nayeem Rahman
authored
5 years ago
a88dda00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
__e2e_tests__/peerN-benchmark.js
+37
-0
37 additions, 0 deletions
__e2e_tests__/peerN-benchmark.js
with
37 additions
and
0 deletions
__e2e_tests__/peerN-benchmark.js
0 → 100644
View file @
a88dda00
import
{
Selector
}
from
"
testcafe
"
const
host
=
"
127.0.0.1
"
const
port
=
process
.
env
.
PORT
||
3000
const
peerIndex
=
parseInt
(
process
.
env
.
PEER_INDEX
)
const
numPeers
=
parseInt
(
process
.
env
.
NUM_PEERS
)
fixture
`Peer
${
peerIndex
}
`
.
page
`
${
host
}
:
${
port
}
`
const
syncTimeout
=
numPeers
*
1000
const
pollInterval
=
500
test
(
`Strokes from all peers should be rendered for peer
${
peerIndex
}
`
,
async
(
t
)
=>
{
const
canvas
=
Selector
(
"
#canvas
"
).
with
({
timeout
:
1000
})
await
t
.
drag
(
canvas
,
10
*
peerIndex
,
10
)
let
elapsed
=
0
let
syncComplete
=
false
for
(;
elapsed
<
syncTimeout
;
elapsed
+=
pollInterval
)
{
if
(
await
canvas
.
childElementCount
==
numPeers
)
{
syncComplete
=
true
break
}
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
pollInterval
))
}
if
(
syncComplete
)
{
console
.
log
(
`Peer
${
peerIndex
}
: Sync completed in
${
elapsed
}
ms +-
${
pollInterval
}
ms.`
,
)
}
else
{
console
.
log
(
`Peer
${
peerIndex
}
: Sync failed,
${
await
canvas
.
childElementCount
}
out of
${
numPeers
}
strokes were rendered before the
${
syncTimeout
}
ms timeout.`
,
)
}
})
This diff is collapsed.
Click to expand it.