From 5828835bcd18eff070789fd82401480c244bbc27 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 21 Mar 2021 18:34:30 +0700 Subject: all: load pass attack results and implement function to get attack result When the service started, it will load all previous attack results from directory Environment.ResultsDir. It will only scan the file name and append it to HttpTarget.Results due to the size and time to load one of them can take time. Through the web interface, user can click "Show" button to load the result and display it on the screen. --- example/example.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'example/example.go') diff --git a/example/example.go b/example/example.go index c49400e..190b39a 100644 --- a/example/example.go +++ b/example/example.go @@ -32,7 +32,7 @@ type Example struct { // func New() (ex *Example, err error) { env := &trunks.Environment{ - ResultsDir: "testdata/example/", + ResultsDir: "example/testdata/", ResultsSuffix: "example", } @@ -92,7 +92,7 @@ func (ex *Example) registerEndpoints() (err error) { func (ex *Example) registerTargets() (err error) { targetHttp := &trunks.Target{ - Name: "Example HTTP target", + Name: "Example", Opts: &trunks.AttackOptions{ BaseUrl: fmt.Sprintf("http://%s", ex.trunks.Env.ListenAddress), Duration: 5 * time.Second, -- cgit v1.3-5-g9baa