Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xanadu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
SYNERG
xanadu
Commits
4d37177c
Commit
4d37177c
authored
Mar 04, 2020
by
nilanjandaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added request sampler for prob model
parent
ca61f8b9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
29 deletions
+65
-29
dispatch_system/dispatch_daemon/config.json
dispatch_system/dispatch_daemon/config.json
+1
-1
dispatch_system/dispatch_manager/lib.js
dispatch_system/dispatch_manager/lib.js
+46
-26
dispatch_system/dispatch_manager/repository/worker_env/node_modules/.bin/mime
...atch_manager/repository/worker_env/node_modules/.bin/mime
+8
-1
dispatch_system/dispatch_manager/repository/worker_env/node_modules/.bin/mime
...atch_manager/repository/worker_env/node_modules/.bin/mime
+8
-1
resource_manager/src/common/cJSON
resource_manager/src/common/cJSON
+1
-0
resource_manager/src/common/nlib
resource_manager/src/common/nlib
+1
-0
No files found.
dispatch_system/dispatch_daemon/config.json
View file @
4d37177c
{
"id"
:
"192.168.31.51"
,
"master_node"
:
"10.129.6.5"
}
\ No newline at end of file
{
"id"
:
"10.196.6.51"
,
"master_node"
:
"10.129.6.5"
}
\ No newline at end of file
dispatch_system/dispatch_manager/lib.js
View file @
4d37177c
...
...
@@ -47,10 +47,7 @@ function generateExecutor(functionPath, functionHash) {
}
function
reverseProxy
(
req
,
res
,
functionToResource
,
resourceMap
)
{
if
(
req
.
headers
[
"
x-resource-id
"
])
{
branchChainPredictor
(
req
,
resourceMap
)
}
branchChainPredictor
(
req
,
resourceMap
)
return
new
Promise
((
resolve
,
reject
)
=>
{
let
runtime
=
req
.
body
.
runtime
let
id
=
req
.
params
.
id
+
runtime
...
...
@@ -144,33 +141,56 @@ function compare(a, b) {
}
function
branchChainPredictor
(
req
,
resourceMap
)
{
let
resource_id
=
req
.
headers
[
'
x-resource-id
'
]
let
resource
=
resourceMap
.
get
(
resource_id
)
let
forwardBranch
=
req
.
params
.
id
if
(
!
functionBranchTree
.
has
(
resource
.
functionHash
))
{
let
data
=
{
req_count
:
1
,
branches
:
new
Map
()
console
.
log
(
req
.
headers
[
'
x-resource-id
'
]);
if
(
req
.
headers
[
'
x-resource-id
'
]
===
undefined
)
{
let
functionHash
=
req
.
params
.
id
if
(
functionBranchTree
.
has
(
functionHash
))
{
let
branchInfo
=
functionBranchTree
.
get
(
functionHash
)
branchInfo
.
req_count
++
}
else
{
let
data
=
{
req_count
:
1
,
parent
:
true
,
branches
:
new
Map
()
}
functionBranchTree
.
set
(
functionHash
,
data
)
}
data
.
branches
.
set
(
forwardBranch
,
1
)
functionBranchTree
.
set
(
resource
.
functionHash
,
data
)
}
else
{
let
branchInfo
=
functionBranchTree
.
get
(
resource
.
functionHash
)
branchInfo
.
req_count
++
if
(
branchInfo
.
branches
.
has
(
forwardBranch
))
{
let
branchProb
=
branchInfo
.
branches
.
get
(
forwardBranch
)
branchProb
=
(
branchProb
*
(
branchInfo
.
req_count
-
1
)
+
1.0
)
branchInfo
.
branches
.
set
(
forwardBranch
,
branchProb
)
let
resource_id
=
req
.
headers
[
'
x-resource-id
'
]
let
resource
=
resourceMap
.
get
(
resource_id
)
let
forwardBranch
=
req
.
params
.
id
if
(
!
functionBranchTree
.
has
(
resource
.
functionHash
))
{
let
data
=
{
req_count
:
1
,
parent
:
false
,
branches
:
new
Map
()
}
data
.
branches
.
set
(
forwardBranch
,
1
)
functionBranchTree
.
set
(
resource
.
functionHash
,
data
)
}
else
{
branchInfo
.
branches
.
set
(
forwardBranch
,
1.0
)
}
for
(
let
[
branch
,
prob
]
of
branchInfo
.
branches
.
entries
())
{
if
(
branch
!==
forwardBranch
)
prob
*=
(
branchInfo
.
req_count
-
1
)
prob
/=
branchInfo
.
req_count
branchInfo
.
branches
.
set
(
branch
,
prob
)
let
branchInfo
=
functionBranchTree
.
get
(
resource
.
functionHash
)
if
(
!
branchInfo
.
parent
)
branchInfo
.
req_count
++
if
(
branchInfo
.
branches
.
has
(
forwardBranch
))
{
let
branchProb
=
branchInfo
.
branches
.
get
(
forwardBranch
)
branchProb
=
(
branchProb
*
(
branchInfo
.
req_count
-
1
)
+
1.0
)
branchInfo
.
branches
.
set
(
forwardBranch
,
branchProb
)
}
else
{
branchInfo
.
branches
.
set
(
forwardBranch
,
1.0
)
}
for
(
let
[
branch
,
prob
]
of
branchInfo
.
branches
.
entries
())
{
if
(
branch
!==
forwardBranch
)
prob
*=
(
branchInfo
.
req_count
-
1
)
prob
/=
branchInfo
.
req_count
branchInfo
.
branches
.
set
(
branch
,
prob
)
}
}
}
console
.
log
(
functionBranchTree
);
}
...
...
dispatch_system/dispatch_manager/repository/worker_env/node_modules/.bin/mime
deleted
120000 → 0
View file @
ca61f8b9
../mime/cli.js
\ No newline at end of file
dispatch_system/dispatch_manager/repository/worker_env/node_modules/.bin/mime
0 → 100755
View file @
4d37177c
#!/usr/bin/env node
var
mime
=
require
(
'
./mime.js
'
);
var
file
=
process
.
argv
[
2
];
var
type
=
mime
.
lookup
(
file
);
process
.
stdout
.
write
(
type
+
'
\n
'
);
cJSON
@
f790e17b
Subproject commit f790e17b6cecef030c4eda811149d238c2085fcf
nlib
@
75bc1a11
Subproject commit 75bc1a11e2a10cf249f566b40c85d6526c16f123
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