Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
e3e71973
Commit
e3e71973
authored
Aug 14, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: simplify
parent
8f653d3c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
8 deletions
+4
-8
benchmarks_test.go
benchmarks_test.go
+1
-1
network/ipfs_impl_test.go
network/ipfs_impl_test.go
+2
-6
sessionpeermanager/latencytracker.go
sessionpeermanager/latencytracker.go
+1
-1
No files found.
benchmarks_test.go
View file @
e3e71973
...
@@ -202,7 +202,7 @@ func runDistribution(b *testing.B, instances []testinstance.Instance, blocks []b
...
@@ -202,7 +202,7 @@ func runDistribution(b *testing.B, instances []testinstance.Instance, blocks []b
nst
:=
fetcher
.
Adapter
.
Stats
()
nst
:=
fetcher
.
Adapter
.
Stats
()
stats
:=
runStats
{
stats
:=
runStats
{
Time
:
time
.
Now
()
.
Sub
(
start
),
Time
:
time
.
Since
(
start
),
MsgRecd
:
nst
.
MessagesRecvd
,
MsgRecd
:
nst
.
MessagesRecvd
,
MsgSent
:
nst
.
MessagesSent
,
MsgSent
:
nst
.
MessagesSent
,
Dups
:
st
.
DupBlksReceived
,
Dups
:
st
.
DupBlksReceived
,
...
...
network/ipfs_impl_test.go
View file @
e3e71973
...
@@ -41,16 +41,12 @@ func (r *receiver) ReceiveError(err error) {
...
@@ -41,16 +41,12 @@ func (r *receiver) ReceiveError(err error) {
func
(
r
*
receiver
)
PeerConnected
(
p
peer
.
ID
)
{
func
(
r
*
receiver
)
PeerConnected
(
p
peer
.
ID
)
{
r
.
peers
[
p
]
=
struct
{}{}
r
.
peers
[
p
]
=
struct
{}{}
select
{
r
.
connectionEvent
<-
struct
{}{}
case
r
.
connectionEvent
<-
struct
{}{}
:
}
}
}
func
(
r
*
receiver
)
PeerDisconnected
(
p
peer
.
ID
)
{
func
(
r
*
receiver
)
PeerDisconnected
(
p
peer
.
ID
)
{
delete
(
r
.
peers
,
p
)
delete
(
r
.
peers
,
p
)
select
{
r
.
connectionEvent
<-
struct
{}{}
case
r
.
connectionEvent
<-
struct
{}{}
:
}
}
}
func
TestMessageSendAndReceive
(
t
*
testing
.
T
)
{
func
TestMessageSendAndReceive
(
t
*
testing
.
T
)
{
// create network
// create network
...
...
sessionpeermanager/latencytracker.go
View file @
e3e71973
...
@@ -43,7 +43,7 @@ func (lt *latencyTracker) CheckDuration(key cid.Cid) (time.Duration, bool) {
...
@@ -43,7 +43,7 @@ func (lt *latencyTracker) CheckDuration(key cid.Cid) (time.Duration, bool) {
request
,
ok
:=
lt
.
requests
[
key
]
request
,
ok
:=
lt
.
requests
[
key
]
var
latency
time
.
Duration
var
latency
time
.
Duration
if
ok
{
if
ok
{
latency
=
time
.
Now
()
.
Sub
(
request
.
startedAt
)
latency
=
time
.
Since
(
request
.
startedAt
)
}
}
return
latency
,
ok
return
latency
,
ok
}
}
...
...
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