Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-orbit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Katerina Roukounaki
cloud-orbit
Commits
c10ca491
Commit
c10ca491
authored
Nov 14, 2014
by
Aggelos Giantsios
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the auxiliary functions from worker.erl
parent
c7bb52d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
2 deletions
+67
-2
WorkerAux.hs
WorkerAux.hs
+67
-2
No files found.
WorkerAux.hs
View file @
c10ca491
--
--
-- orbit-int workeraux
-- orbit-int workeraux
--
--
module
WorkerAux
(
now
)
where
module
WorkerAux
(
defaultCt
,
now
,
worker_stats
,
verts_recvd_from_stat
,
credit_retd_from_stat
,
min_atomic_credit_from_stat
,
init_idle_from_stat
,
tail_idle_from_stat
,
max_idle_from_stat
)
where
import
Control.Distributed.Process
(
NodeId
)
import
Types
import
Types
(
Ct
(
..
)
(
Ct
(
..
)
,
Freq
,
Stats
)
import
Table
(
freq_to_stat
)
)
defaultCt
=
Ct
{
defaultCt
=
Ct
{
verts_recvd
=
0
verts_recvd
=
0
,
credit_retd
=
0
,
credit_retd
=
0
,
min_atomic_credit
=
0
,
min_atomic_credit
=
0
,
last_event
=
0
--master:now()
,
last_event
=
now
,
init_idle
=
-
1
,
init_idle
=
-
1
,
tail_idle
=
-
1
,
tail_idle
=
-
1
,
max_idle
=
-
1
,
max_idle
=
-
1
...
@@ -21,3 +38,51 @@ defaultCt = Ct {
...
@@ -21,3 +38,51 @@ defaultCt = Ct {
-- FIXME get current wall clock time
-- FIXME get current wall clock time
now
::
Int
now
::
Int
now
=
42
now
=
42
-- produce readable statistics
worker_stats
::
NodeId
->
Freq
->
Ct
->
Stats
worker_stats
node
frequency
statData
=
(
"node"
,
show
node
)
:
(
"vertices_recvd"
,
show
$
verts_recvd
statData
)
:
(
"credit_retd"
,
show
$
credit_retd
statData
)
:
(
"min_atomic_credit"
,
show
$
min_atomic_credit
statData
)
:
(
"init_idle_time"
,
show
$
init_idle
statData
)
:
(
"max_idle_time"
,
show
$
max_idle
statData
)
:
(
"tail_idle_time"
,
show
$
tail_idle
statData
)
:
freq_to_stat
frequency
verts_recvd_from_stat
::
Stats
->
Int
verts_recvd_from_stat
stat
=
case
"vertices_recvd"
`
lookup
`
stat
of
Just
val
->
read
val
::
Int
Nothing
->
0
-- instead of false
credit_retd_from_stat
::
Stats
->
Int
credit_retd_from_stat
stat
=
case
"credit_retd"
`
lookup
`
stat
of
Just
val
->
read
val
::
Int
Nothing
->
0
-- instead of false
min_atomic_credit_from_stat
::
Stats
->
Int
min_atomic_credit_from_stat
stat
=
case
"min_atomic_credit"
`
lookup
`
stat
of
Just
val
->
read
val
::
Int
Nothing
->
0
-- instead of false
init_idle_from_stat
::
Stats
->
Int
init_idle_from_stat
stat
=
case
"init_idle_time"
`
lookup
`
stat
of
Just
val
->
read
val
::
Int
Nothing
->
0
-- instead of false
tail_idle_from_stat
::
Stats
->
Int
tail_idle_from_stat
stat
=
case
"tail_idle_time"
`
lookup
`
stat
of
Just
val
->
read
val
::
Int
Nothing
->
0
-- instead of false
max_idle_from_stat
::
Stats
->
Int
max_idle_from_stat
stat
=
case
"max_idle_time"
`
lookup
`
stat
of
Just
val
->
read
val
::
Int
Nothing
->
0
-- instead of false
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