Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jabis Sevón
/
esm
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
93993793
authored
2016-08-21 17:19:17 +0200
by
Jabis Sevon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
interfacing with existing socket.io
1 parent
29484dc7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
index.html
index.js
index.html
View file @
9399379
...
...
@@ -1551,8 +1551,9 @@
Chart
.
defaults
.
global
.
elements
.
line
.
backgroundColor
=
"rgba(0,0,0,0)"
;
Chart
.
defaults
.
global
.
elements
.
line
.
borderColor
=
"rgba(0,0,0,0.9)"
;
Chart
.
defaults
.
global
.
elements
.
line
.
borderWidth
=
2
;
var
socket
=
io
.
connect
(
location
.
protocol
+
'//'
+
location
.
hostname
+
':'
+
location
.
port
);
var
config
=
{};
config
.
path
=
'/status'
;
var
socket
=
io
.
connect
(
location
.
protocol
+
'//'
+
location
.
hostname
+
':'
+
location
.
port
+
''
+
config
.
path
);
var
defaultSpan
=
0
;
var
spans
=
[];
...
...
index.js
View file @
9399379
...
...
@@ -85,11 +85,12 @@
});
return
(
req
,
res
,
next
)
=>
{
if
(
io
===
null
||
io
===
undefined
)
{
if
(
global
.
socket
)
io
=
global
.
socket
;
if
(
io
===
null
||
io
===
undefined
||
global
.
socket
===
undefined
||
global
.
socket
===
null
)
{
//console.log(req)
io
=
require
(
'socket.io'
).
listen
(
server
);
io
.
on
(
'connection'
,
(
socket
)
=>
{
}
io
.
o
f
(
config
.
path
).
o
n
(
'connection'
,
(
socket
)
=>
{
socket
.
emit
(
'start'
,
config
.
spans
);
socket
.
on
(
'change'
,
function
()
{
socket
.
emit
(
'start'
,
config
.
spans
);
...
...
@@ -101,7 +102,7 @@
span
.
responses
=
[];
setInterval
(()
=>
gatherOsMetrics
(
io
,
span
),
span
.
interval
*
1000
);
});
}
const
startTime
=
process
.
hrtime
();
if
(
req
.
path
===
config
.
path
)
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment