This repository has been archived by the owner on Aug 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite metrics calculation and retrieval
This commit moves most of the aggregation logic into the cli leaving the goad runners with a cleaner implementation of the metrics to transmit to the cli. We introduce a runner id that allows tracking of the individual lambdas being executed on aws and later aggregation of results for different aws regions. The infrastructure package has been restructured to move more of the aws specific functionality into the corresponding packages. A VSCode debug configuration has been added to version control. Closes #143
- Loading branch information
1 parent
1d56f40
commit be3d5fa
Showing
13 changed files
with
495 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
|
||
{ | ||
"name": "Launch Cli", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "debug", | ||
"remotePath": "", | ||
"port": 2345, | ||
"host": "127.0.0.1", | ||
"program": "${workspaceRoot}", | ||
"env": {}, | ||
"args": [], | ||
"showLog": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package api | ||
|
||
import "time" | ||
|
||
// RunnerResult defines the common API for goad runners to send data back to the | ||
// cli. | ||
type RunnerResult struct { | ||
AveTimeForReq int64 `json:"ave-time-for-req"` | ||
AveTimeToFirst int64 `json:"ave-time-to-first"` | ||
Fastest int64 `json:"fastest"` | ||
FatalError string `json:"fatal-error"` | ||
Finished bool `json:"finished"` | ||
Region string `json:"region"` | ||
RunnerID int `json:"runner-id"` | ||
Slowest int64 `json:"slowest"` | ||
Statuses map[string]int `json:"statuses"` | ||
TimeDelta time.Duration `json:"time-delta"` | ||
BytesRead int `json:"bytes-read"` | ||
ConnectionErrors int `json:"connection-errors"` | ||
RequestCount int `json:"request-count"` | ||
TimedOut int `json:"timed-out"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package util | ||
|
||
func RemoveDuplicates(strs []string) []string { | ||
strsMap := make(map[string]bool) | ||
for _, str := range strs { | ||
strsMap[str] = true | ||
} | ||
returnStrs := make([]string, 0) | ||
for str := range strsMap { | ||
returnStrs = append(returnStrs, str) | ||
} | ||
return returnStrs | ||
} |
Oops, something went wrong.