Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Nicolas Pope
ftl
Commits
d02320b1
Commit
d02320b1
authored
4 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Webservice ping for keepalive and latency
parent
ea007e23
No related branches found
No related tags found
No related merge requests found
Pipeline
#29190
failed
4 years ago
Stage: all
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+3
-3
3 additions, 3 deletions
.gitlab-ci.yml
web-service/server/src/index.js
+16
-1
16 additions, 1 deletion
web-service/server/src/index.js
web-service/server/src/peer.js
+2
-0
2 additions, 0 deletions
web-service/server/src/peer.js
with
21 additions
and
4 deletions
.gitlab-ci.yml
+
3
−
3
View file @
d02320b1
...
...
@@ -55,9 +55,9 @@ webserver-deploy:
.build-windows
:
&build-windows
-
'
call
vcvars64.bat'
-
if not exist "../ftl_build" mkdir "../ftl_
build
"
-
cd .
./ftl_
build
-
cmake %CMAKE_ARGS% %CMAKE_ARGS_WINDOWS% -DREALSENSE_DIR="C:/Program Files (x86)/Intel RealSense SDK 2.0" -DOPENVR_DIR="C:/Program Files (x86)/OpenVRSDK" -DOPUS_DIR="C:/Program Files (x86)/Opus" ..
/ftl
-
mkdir ./
build
-
cd .
/
build
-
cmake %CMAKE_ARGS% %CMAKE_ARGS_WINDOWS% -DREALSENSE_DIR="C:/Program Files (x86)/Intel RealSense SDK 2.0" -DOPENVR_DIR="C:/Program Files (x86)/OpenVRSDK" -DOPUS_DIR="C:/Program Files (x86)/Opus" ..
-
devenv ftl.utu.fi.sln /build Release
-
rmdir /q /s "%DEPLOY_DIR%/%CI_COMMIT_REF_SLUG%"
-
mkdir "%DEPLOY_DIR%/%CI_COMMIT_REF_SLUG%"
...
...
This diff is collapsed.
Click to expand it.
web-service/server/src/index.js
+
16
−
1
View file @
d02320b1
...
...
@@ -40,6 +40,18 @@ let peer_data = [];
let
cfg_to_peer
=
{};
setInterval
(()
=>
{
for
(
x
in
peer_by_id
)
{
let
p
=
peer_by_id
[
x
];
let
start
=
(
new
Date
()).
getMilliseconds
();
p
.
rpc
(
"
__ping__
"
,
(
ts
)
=>
{
let
end
=
(
new
Date
()).
getMilliseconds
();
p
.
latency
=
(
end
-
start
)
/
2
;
console
.
log
(
"
Ping:
"
,
p
.
latency
,
ts
);
});
}
},
20000
);
/**
* A client stream request object. Each source maintains a list of clients who
* are wanting frames from that source. Clients can only request N frames at a
...
...
@@ -143,7 +155,8 @@ RGBDStream.prototype.pushFrames = function(latency, spacket, packet) {
//console.log("Frame = ", packet[0], packet[1]);
for
(
let
i
=
0
;
i
<
this
.
clients
.
length
;
i
++
)
{
this
.
clients
[
i
].
push
(
this
.
base_uri
,
latency
,
spacket
,
packet
);
let
l
=
latency
+
this
.
peer
.
latency
+
this
.
clients
[
i
].
peer
.
latency
;
this
.
clients
[
i
].
push
(
this
.
base_uri
,
Math
.
ceil
(
l
),
spacket
,
packet
);
}
/*let i=0;
...
...
@@ -346,6 +359,8 @@ app.ws('/', (ws, req) => {
for
(
let
c
in
cfg_to_peer
)
{
if
(
cfg_to_peer
[
c
]
===
p
)
delete
cfg_to_peer
[
c
];
}
// FIXME: Clear peer_data
});
p
.
bind
(
"
new_peer
"
,
(
id
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
web-service/server/src/peer.js
+
2
−
0
View file @
d02320b1
...
...
@@ -35,6 +35,8 @@ function Peer(ws) {
this
.
callbacks
=
{};
this
.
cbid
=
0
;
this
.
latency
=
0
;
this
.
uri
=
"
unknown
"
;
this
.
name
=
"
unknown
"
;
this
.
master
=
false
;
...
...
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