mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-09 01:17:30 +08:00
feat: support statistics summary for load testing
This commit is contained in:
@@ -2,6 +2,9 @@ package boomer
|
||||
|
||||
import (
|
||||
"math"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -95,6 +98,16 @@ func (b *Boomer) EnableMemoryProfile(memoryProfile string, duration time.Duratio
|
||||
b.memoryProfileDuration = duration
|
||||
}
|
||||
|
||||
// EnableGracefulQuit catch SIGINT and SIGTERM signals to quit gracefully
|
||||
func (b *Boomer) EnableGracefulQuit() {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, syscall.SIGTERM, syscall.SIGINT)
|
||||
go func() {
|
||||
<-c
|
||||
b.Quit()
|
||||
}()
|
||||
}
|
||||
|
||||
// Run accepts a slice of Task and connects to the locust master.
|
||||
func (b *Boomer) Run(tasks ...*Task) {
|
||||
if b.cpuProfile != "" {
|
||||
|
||||
Reference in New Issue
Block a user