Skip to content

Commit

Permalink
plot: Reuse decoder helper in plot
Browse files Browse the repository at this point in the history
  • Loading branch information
tsenart committed Aug 18, 2018
1 parent 5892206 commit b22f4d4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions plot.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,11 @@ func plotCmd() command {
}

func plotRun(files []string, threshold int, title, output string) error {
srcs := make([]vegeta.Decoder, len(files))
for i, f := range files {
in, err := file(f, false)
if err != nil {
return err
}
defer in.Close()
srcs[i] = vegeta.NewDecoder(in)
dec, mc, err := decoder(files)
defer mc.Close()
if err != nil {
return err
}
dec := vegeta.NewRoundRobinDecoder(srcs...)

out, err := file(output, true)
if err != nil {
Expand Down

0 comments on commit b22f4d4

Please sign in to comment.