Decouple Reporters from Attack function
This changeset breaks the API of Attack in order to decouple Reporters and the Attack function. Attack now returns a slice with non-deterministic order of Results which one can use on the calling code with or without Reporters, hence making it much more useful on a library usage setting. These developments could be of interest to issue #11 which was closed in the past.
This commit is contained in:
@@ -20,8 +20,8 @@ func NewTimingsPlotReporter() *TimingsPlotReporter {
|
||||
return &TimingsPlotReporter{results: list.New()}
|
||||
}
|
||||
|
||||
// add inserts response to be used in the report, sorted by timestamp.
|
||||
func (r *TimingsPlotReporter) add(res *Result) {
|
||||
// Add inserts response to be used in the report, sorted by timestamp.
|
||||
func (r *TimingsPlotReporter) Add(res *Result) {
|
||||
// Empty list
|
||||
if r.results.Len() == 0 {
|
||||
r.results.PushFront(res)
|
||||
|
||||
Reference in New Issue
Block a user