Skip to content

Commit

Permalink
Change perf proc
Browse files Browse the repository at this point in the history
  • Loading branch information
lchenut committed Aug 10, 2023
1 parent eee2f0b commit cca526c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions libp2p/protocols/perf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ proc new*(T: typedesc[Perf]): T {.public.} =
p.codec = PerfCodec
return p

proc perfDownload*(p: Perf, conn: Connection,
sizeToRead: uint64): Future[Duration] {.async, public.} =
proc perfDownload*(conn: Connection, sizeToRead: uint64):
Future[Duration] {.async, public.} =
var
size = sizeToRead
buf: array[PerfSize, byte]
Expand All @@ -91,8 +91,8 @@ proc perfDownload*(p: Perf, conn: Connection,
trace "got download benchmark duration", conn, duration
return duration

proc perfUpload*(p: Perf, conn: Connection,
sizeToWrite: uint64): Future[Duration] {.async, public.} =
proc perfUpload*(conn: Connection, sizeToWrite: uint64):
Future[Duration] {.async, public.} =
var
size = sizeToWrite
buf: array[PerfSize, byte]
Expand All @@ -112,9 +112,8 @@ proc perfUpload*(p: Perf, conn: Connection,
trace "got upload benchmark duration", conn, duration
return duration

proc perf*(p: Perf, conn: Connection,
sizeToWrite: uint64 = 0, sizeToRead: uint64 = 0):
Future[Duration] {.async, public.} =
proc perf*(conn: Connection, sizeToWrite: uint64 = 0, sizeToRead: uint64 = 0):
Future[Duration] {.async, public.} =
var
size = sizeToWrite
buf: array[PerfSize, byte]
Expand Down

0 comments on commit cca526c

Please sign in to comment.