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-dms3
Commits
513c5687
Commit
513c5687
authored
Dec 25, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename
parent
1891c891
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
epictest/addcat_test.go
epictest/addcat_test.go
+4
-4
epictest/bench_test.go
epictest/bench_test.go
+1
-1
No files found.
epictest/addcat_test.go
View file @
513c5687
...
@@ -24,7 +24,7 @@ func Test1KBInstantaneous(t *testing.T) {
...
@@ -24,7 +24,7 @@ func Test1KBInstantaneous(t *testing.T) {
BlockstoreLatency
:
0
,
BlockstoreLatency
:
0
,
}
}
if
err
:=
AddCat
Bytes
(
RandomBytes
(
1
*
KB
),
conf
);
err
!=
nil
{
if
err
:=
Direct
AddCat
(
RandomBytes
(
1
*
KB
),
conf
);
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
}
}
...
@@ -56,7 +56,7 @@ func TestDegenerateSlowRouting(t *testing.T) {
...
@@ -56,7 +56,7 @@ func TestDegenerateSlowRouting(t *testing.T) {
func
Test100MBMacbookCoastToCoast
(
t
*
testing
.
T
)
{
func
Test100MBMacbookCoastToCoast
(
t
*
testing
.
T
)
{
SkipUnlessEpic
(
t
)
SkipUnlessEpic
(
t
)
conf
:=
Config
{}
.
Network_NYtoSF
()
.
Blockstore_SlowSSD2014
()
.
Routing_Slow
()
conf
:=
Config
{}
.
Network_NYtoSF
()
.
Blockstore_SlowSSD2014
()
.
Routing_Slow
()
if
err
:=
AddCat
Bytes
(
RandomBytes
(
100
*
1024
*
1024
),
conf
);
err
!=
nil
{
if
err
:=
Direct
AddCat
(
RandomBytes
(
100
*
1024
*
1024
),
conf
);
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
}
}
...
@@ -65,7 +65,7 @@ func AddCatPowers(conf Config, megabytesMax int64) error {
...
@@ -65,7 +65,7 @@ func AddCatPowers(conf Config, megabytesMax int64) error {
var
i
int64
var
i
int64
for
i
=
1
;
i
<
megabytesMax
;
i
=
i
*
2
{
for
i
=
1
;
i
<
megabytesMax
;
i
=
i
*
2
{
fmt
.
Printf
(
"%d MB
\n
"
,
i
)
fmt
.
Printf
(
"%d MB
\n
"
,
i
)
if
err
:=
AddCat
Bytes
(
RandomBytes
(
i
*
1024
*
1024
),
conf
);
err
!=
nil
{
if
err
:=
Direct
AddCat
(
RandomBytes
(
i
*
1024
*
1024
),
conf
);
err
!=
nil
{
return
err
return
err
}
}
}
}
...
@@ -78,7 +78,7 @@ func RandomBytes(n int64) []byte {
...
@@ -78,7 +78,7 @@ func RandomBytes(n int64) []byte {
return
data
.
Bytes
()
return
data
.
Bytes
()
}
}
func
AddCat
Bytes
(
data
[]
byte
,
conf
Config
)
error
{
func
Direct
AddCat
(
data
[]
byte
,
conf
Config
)
error
{
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
defer
cancel
()
const
numPeers
=
2
const
numPeers
=
2
...
...
epictest/bench_test.go
View file @
513c5687
...
@@ -10,7 +10,7 @@ func benchmarkAddCat(numBytes int64, conf Config, b *testing.B) {
...
@@ -10,7 +10,7 @@ func benchmarkAddCat(numBytes int64, conf Config, b *testing.B) {
b
.
StartTimer
()
b
.
StartTimer
()
for
n
:=
0
;
n
<
b
.
N
;
n
++
{
for
n
:=
0
;
n
<
b
.
N
;
n
++
{
if
err
:=
AddCat
Bytes
(
data
,
conf
);
err
!=
nil
{
if
err
:=
Direct
AddCat
(
data
,
conf
);
err
!=
nil
{
b
.
Fatal
(
err
)
b
.
Fatal
(
err
)
}
}
}
}
...
...
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