Skip to content

Commit

Permalink
Update util/common/traces/generate.go
Browse files Browse the repository at this point in the history
Co-authored-by: Jeffrey Chien <[email protected]>
  • Loading branch information
okankoAMZ and jefchien committed Oct 5, 2023
1 parent 6e2686a commit 9b05e93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mockserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (ts *transactionHttpServer) GetNumberOfTransactionsPerMinute(w http.Respons

w.Header().Set("Content-Type", "application/json")
if err := json.NewEncoder(w).Encode(TransactionPayload{tpm}); err != nil {
w.WriteHeader(http.StatusInternalServerError)
io.WriteString(w, err.Error())
log.Printf("Unable to write response: %v", err)
}
Expand Down Expand Up @@ -128,7 +129,7 @@ func StartHttpServer() {
if err := appServer.ListenAndServe(); err != nil {
log.Printf("Verification server error: %v", err)
err := appServer.Shutdown(context.TODO())
log.Fatalf("Shuwdown server error: %v", err)
log.Fatalf("Shutdown server error: %v", err)
}
}(&store)
wg.Wait()
Expand Down
4 changes: 2 additions & 2 deletions util/common/traces/generate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package traces

import (
"fmt"
"github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/common"
"github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/xray"
"time"
Expand Down Expand Up @@ -34,9 +35,8 @@ func StartTraceGeneration(receiver string, agentConfigPath string, agentRuntime
cfg.Generator = xray.NewLoadGenerator(&xrayGenCfg)
cfg.Name = "xray-performance-test"
case "otlp":
panic("Only supports xray for now.")
default:
panic("Invalid trace receiver")
return fmt.Errorf("%s is not supported.", receiver)
}
err := common.GenerateTraces(cfg)
return err
Expand Down

0 comments on commit 9b05e93

Please sign in to comment.