code: func (b *Benchmark) Run(ctx context.Context) error {
  	fmt.Printf("Listening for incoming connections at %s:%d\n", b.cfg.IP, b.cfg.Port)
  	if err := b.collector.Listen(b.cfg.Port); err != nil {
  		return err
  	}
  	j, err := b.launch(ctx)
  	if err != nil {
  		return err
  	}
  	fmt.Printf("Service %s launched (%d instances)\n", j.ID, b.cfg.Count)
  
  	// Periodically print stats.
  	doneCh := make(chan struct{})
  	go func() {
  		for {
  			select {
  			case <-time.After(5 * time.Second):
  				fmt.Printf("\n%s: Progression report\n", time.Now())
  				b.collector.Stats(os.Stdout, time.Second)
  			case <-doneCh:
  				return
  			}
  		}
  	}()
  
  	fmt.Println("Collecting metrics...")
  	b.collector.Collect(ctx, b.cfg.Count)
  	doneCh <- struct{}{}
  
  	fmt.Printf("\n%s: Benchmark completed\n", time.Now())
  	b.collector.Stats(os.Stdout, time.Second)
  
  	return nil
  }
docs: // Run starts the benchmark session and waits for it to be completed.