Skip to content

Commit

Permalink
feat: some optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag authored and flemzord committed Oct 4, 2023
1 parent d8652ce commit 4c1cbd9
Show file tree
Hide file tree
Showing 8 changed files with 494 additions and 56 deletions.
28 changes: 16 additions & 12 deletions tests/benchmarks/extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ func (c *Extension) StartLedger(configuration LedgerConfiguration) *Ledger {
}

func (c *Extension) StopLedger() {
if os.Getenv("NO_CLEANUP") == "true" {
return
}
c.logger.Infof("Shutting down ledger container...")
if err := c.pool.Client.KillContainer(docker.KillContainerOptions{
ID: c.resource.Container.ID,
Expand Down Expand Up @@ -298,18 +301,19 @@ func v2EnvVars(testID string, configuration LedgerConfiguration) []string {
"BIND=:3068",
"STORAGE_DRIVER=postgres",
"STORAGE_POSTGRES_CONN_STRING=" + configuration.PostgresDSN,
"STORAGE_POSTGRES_MAX_OPEN_CONNS=500",
"OTEL_RESOURCE_ATTRIBUTES=testid=" + testID,
"OTEL_TRACES=true",
"OTEL_TRACES_EXPORTER=otlp",
"OTEL_TRACES_EXPORTER_OTLP_ENDPOINT=" + configuration.OTLP.Endpoint,
"OTEL_TRACES_EXPORTER_OTLP_INSECURE=true",
"OTEL_METRICS=true",
"OTEL_METRICS_EXPORTER=otlp",
"OTEL_METRICS_EXPORTER_OTLP_ENDPOINT=" + configuration.OTLP.Endpoint,
"OTEL_METRICS_EXPORTER_OTLP_INSECURE=true",
"OTEL_METRICS_RUNTIME=true",
"OTEL_METRICS_EXPORTER_PUSH_INTERVAL=1s",
"STORAGE_POSTGRES_MAX_OPEN_CONNS=50",
"STORAGE_POSTGRES_MAX_IDLE_CONNS=50",
//"OTEL_RESOURCE_ATTRIBUTES=testid=" + testID,
//"OTEL_TRACES=true",
//"OTEL_TRACES_EXPORTER=otlp",
//"OTEL_TRACES_EXPORTER_OTLP_ENDPOINT=" + configuration.OTLP.Endpoint,
//"OTEL_TRACES_EXPORTER_OTLP_INSECURE=true",
//"OTEL_METRICS=true",
//"OTEL_METRICS_EXPORTER=otlp",
//"OTEL_METRICS_EXPORTER_OTLP_ENDPOINT=" + configuration.OTLP.Endpoint,
//"OTEL_METRICS_EXPORTER_OTLP_INSECURE=true",
//"OTEL_METRICS_RUNTIME=true",
//"OTEL_METRICS_EXPORTER_PUSH_INTERVAL=1s",
"DEBUG=false",
}
}
Expand Down
22 changes: 15 additions & 7 deletions tests/benchmarks/extension/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ module github.com/formancehq/stack/tests/benchmarks/extension

go 1.20

require go.k6.io/k6 v0.45.1-0.20230719100510-ac9c6bc85d13
require (
github.com/ory/dockertest/v3 v3.10.0
github.com/prometheus/client_golang v1.14.1-0.20221122130035-8b6e68085b10
github.com/sirupsen/logrus v1.9.3
go.k6.io/k6 v0.45.1-0.20230719100510-ac9c6bc85d13
golang.org/x/mod v0.12.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
Expand All @@ -15,36 +21,38 @@ require (
github.com/docker/docker v24.0.4+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dop251/goja v0.0.0-20230531210528-d7324b2d74f7 // indirect
github.com/dop251/goja v0.0.0-20230621100801-7749907a8a20 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/go-sourcemap/sourcemap v2.1.4-0.20211119122758-180fcef48034+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mstoykov/atlas v0.0.0-20220811071828-388f114305dd // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.27.8 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.8 // indirect
github.com/ory/dockertest/v3 v3.10.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.1.2 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.11.0 // indirect
gopkg.in/guregu/null.v3 v3.3.0 // indirect
Expand Down
Loading

0 comments on commit 4c1cbd9

Please sign in to comment.