Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
server
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Netrino
server
Commits
409a0a9a
Commit
409a0a9a
authored
Jun 7, 2021
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
fixed bwLoggign to be more accurate
parent
cb4831e2
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
io/receivePostPhase.go
+1
-2
1 addition, 2 deletions
io/receivePostPhase.go
io/transmitPhasestream.go
+13
-9
13 additions, 9 deletions
io/transmitPhasestream.go
with
14 additions
and
11 deletions
io/receivePostPhase.go
+
1
−
2
View file @
409a0a9a
...
...
@@ -168,9 +168,8 @@ func ReceiveStreamPostPhase(streamServer mixmessages.Node_StreamPostPhaseServer,
//queue the phase to be operated on if it is not queued yet
p
.
AttemptToQueue
(
instance
.
GetResourceQueue
()
.
GetPhaseQueue
())
start
,
strmErr
:=
StreamPostPhase
(
p
,
batchInfo
.
BatchSize
,
streamServer
)
start
,
end
,
strmErr
:=
StreamPostPhase
(
p
,
batchInfo
.
BatchSize
,
streamServer
)
end
:=
time
.
Now
()
jww
.
INFO
.
Printf
(
"
\t
bwLogging: Round %d, "
+
"received phase: %s, "
+
"from: %s, to: %s, "
+
...
...
This diff is collapsed.
Click to expand it.
io/transmitPhasestream.go
+
13
−
9
View file @
409a0a9a
...
...
@@ -85,7 +85,7 @@ func StreamTransmitPhase(roundID id.Round, serverInstance phase.GenericInstance,
}
}
}
end
:=
time
.
Now
()
measureFunc
:=
currentPhase
.
Measure
if
measureFunc
!=
nil
{
measureFunc
(
measure
.
TagTransmitLastSlot
)
...
...
@@ -102,8 +102,6 @@ func StreamTransmitPhase(roundID id.Round, serverInstance phase.GenericInstance,
jww
.
INFO
.
Printf
(
"[%s] RID %d StreamTransmitPhase FOR
\"
%s
\"
"
+
" COMPLETE/SEND"
,
name
,
roundID
,
rType
)
end
:=
time
.
Now
()
jww
.
INFO
.
Printf
(
"
\t
bwLogging: Round %d, "
+
"transmitted phase: %s, "
+
"from: %s, to: %s, "
+
...
...
@@ -131,11 +129,11 @@ func StreamTransmitPhase(roundID id.Round, serverInstance phase.GenericInstance,
// StreamPostPhase implements the server gRPC handler for posting a
// phase from another node
func
StreamPostPhase
(
p
phase
.
Phase
,
batchSize
uint32
,
stream
mixmessages
.
Node_StreamPostPhaseServer
)
(
time
.
Time
,
error
)
{
stream
mixmessages
.
Node_StreamPostPhaseServer
)
(
time
.
Time
,
time
.
Time
,
error
)
{
// Send a chunk for each slot received along with
// its index until an error is received
slot
,
err
:=
stream
.
Recv
()
start
:=
time
.
Now
()
var
start
,
end
time
.
Time
slotsReceived
:=
uint32
(
0
)
for
;
err
==
nil
;
slot
,
err
=
stream
.
Recv
()
{
index
:=
slot
.
Index
...
...
@@ -144,13 +142,19 @@ func StreamPostPhase(p phase.Phase, batchSize uint32,
if
phaseErr
!=
nil
{
err
=
errors
.
Errorf
(
"Failed on phase input %v for slot %v: %+v"
,
index
,
slot
,
phaseErr
)
return
start
,
phaseErr
return
start
,
end
,
phaseErr
}
chunk
:=
services
.
NewChunk
(
index
,
index
+
1
)
p
.
Send
(
chunk
)
slotsReceived
++
if
slotsReceived
==
1
{
start
=
time
.
Now
()
}
else
if
slotsReceived
==
batchSize
{
end
=
time
.
Now
()
}
}
// Set error in ack message if we didn't receive all slots
...
...
@@ -170,10 +174,10 @@ func StreamPostPhase(p phase.Phase, batchSize uint32,
errClose
:=
stream
.
SendAndClose
(
&
ack
)
if
errClose
!=
nil
&&
ack
.
Error
!=
""
{
return
start
,
errors
.
WithMessage
(
errClose
,
ack
.
Error
)
return
start
,
end
,
errors
.
WithMessage
(
errClose
,
ack
.
Error
)
}
else
if
errClose
==
nil
&&
ack
.
Error
!=
""
{
return
start
,
errors
.
New
(
ack
.
Error
)
return
start
,
end
,
errors
.
New
(
ack
.
Error
)
}
else
{
return
start
,
errClose
return
start
,
end
,
errClose
}
}
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