| 41 | ` |
| 42 | |
| 43 | func plotCmd() command { |
| 44 | fs := flag.NewFlagSet("vegeta plot", flag.ExitOnError) |
| 45 | title := fs.String("title", "Vegeta Plot", "Title and header of the resulting HTML page") |
| 46 | threshold := fs.Int("threshold", 4000, "Threshold of data points above which series are downsampled.") |
| 47 | output := fs.String("output", "stdout", "Output file") |
| 48 | |
| 49 | fs.Usage = func() { |
| 50 | fmt.Fprintf(os.Stderr, "%s\n", plotUsage) |
| 51 | } |
| 52 | |
| 53 | return command{fs, func(args []string) error { |
| 54 | fs.Parse(args) |
| 55 | files := fs.Args() |
| 56 | if len(files) == 0 { |
| 57 | files = append(files, "stdin") |
| 58 | } |
| 59 | return plotRun(files, *threshold, *title, *output) |
| 60 | }} |
| 61 | } |
| 62 | |
| 63 | func plotRun(files []string, threshold int, title, output string) error { |
| 64 | dec, mc, err := decoder(files) |