Skip to content

Commit

Permalink
Merge master into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafai-gr committed Nov 3, 2024
2 parents b36f447 + 77f8a0a commit 1575237
Show file tree
Hide file tree
Showing 36 changed files with 2,620 additions and 434 deletions.
91 changes: 91 additions & 0 deletions cmd/lookoutingesterv2/dbloadtester/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package main

import (
"fmt"
"time"

log "github.com/sirupsen/logrus"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"sigs.k8s.io/yaml"

"github.com/armadaproject/armada/internal/common"
"github.com/armadaproject/armada/internal/common/app"
"github.com/armadaproject/armada/internal/lookoutingesterv2/configuration"
"github.com/armadaproject/armada/internal/lookoutingesterv2/dbloadtester"
)

func init() {
pflag.StringSlice(
"lookoutIngesterConfig",
[]string{},
"Fully qualified path to application configuration file (for multiple config files repeat this arg or separate paths with commas)",
)
pflag.Parse()
}

const ReportTemplate string = `
Load Test on LookoutIngester at %s
Configuration:
Total Jobs Simulated: %d
Total Concurrent Jobs Simulated: %d
Maximum Batch of Jobs Per Queue: %d
Queues in Use: %s
LookoutIngester Config:
%s
Results:
Total Load Test Duration: %s
Total DB Insertion Duration: %s
Number of Events Processed: %d
Average DB Insertion Time Per Event: %f milliseconds
Events Processed By DB Per Second: %f events
`

func main() {
common.ConfigureLogging()
common.BindCommandlineArguments()

var config configuration.LookoutIngesterV2Configuration
userSpecifiedConfigs := viper.GetStringSlice("lookoutIngesterConfig")
common.LoadConfig(&config, "./config/lookoutingesterv2", userSpecifiedConfigs)

loadtesterConfig := dbloadtester.Config{
TotalJobs: 500000,
TotalConcurrentJobs: 50000,
QueueSubmitBatchSize: 300,
QueueNames: []string{"queue1", "queue2", "queue3"},
JobTemplateFile: "internal/lookoutingesterv2/dbloadtester/test_data.yaml",
}

loadtester := dbloadtester.Setup(
config,
loadtesterConfig,
)

results, err := loadtester.Run(app.CreateContextWithShutdown())
if err != nil {
log.Errorf("Ingestion simulator failed: %v", err)
}

LIConfig, err := yaml.Marshal(config)
if err != nil {
log.Warn("Failed to marshal lookout ingester config for report output")
}
fmt.Printf(
ReportTemplate,
time.Now().Format("2006-01-02"),
loadtesterConfig.TotalJobs,
loadtesterConfig.TotalConcurrentJobs,
loadtesterConfig.QueueSubmitBatchSize,
loadtesterConfig.QueueNames,
string(LIConfig),
results.TotalTestDuration,
results.TotalDBInsertionDuration,
results.TotalEventsProcessed,
float64(results.TotalDBInsertionDuration.Milliseconds())/float64(results.TotalEventsProcessed),
float64(results.TotalEventsProcessed)/float64(results.TotalDBInsertionDuration.Seconds()),
)
}
2 changes: 1 addition & 1 deletion cmd/simulator/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func runSimulations(cmd *cobra.Command, args []string) error {
}

if pathExists(outputDirPath) && overwriteDirIfExists {
err := os.Remove(outputDirPath)
err := os.RemoveAll(outputDirPath)
if err != nil {
return err
}
Expand Down
66 changes: 33 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ require (
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru v1.0.2
github.com/jolestar/go-commons-pool v2.0.0+incompatible
github.com/jstemmer/go-junit-report/v2 v2.0.0
github.com/mattn/go-zglob v0.0.4
github.com/jstemmer/go-junit-report/v2 v2.1.0
github.com/mattn/go-zglob v0.0.6
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.5.0
github.com/oklog/ulid v1.3.1
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.1
github.com/prometheus/client_golang v1.20.5
github.com/renstrom/shortuuid v3.0.0+incompatible
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/weaveworks/promrus v1.2.0
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225
golang.org/x/net v0.22.0
golang.org/x/oauth2 v0.18.0
golang.org/x/sync v0.6.0
google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.59.0
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c
golang.org/x/net v0.30.0
golang.org/x/oauth2 v0.23.0
golang.org/x/sync v0.8.0
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/grpc v1.67.1
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.26.15
k8s.io/apimachinery v0.26.15
Expand Down Expand Up @@ -78,14 +78,14 @@ require (
github.com/magefile/mage v1.14.0
github.com/minio/highwayhash v1.0.2
github.com/openconfig/goyang v1.2.0
github.com/prometheus/common v0.48.0
github.com/prometheus/common v0.60.0
github.com/redis/go-redis/extra/redisprometheus/v9 v9.0.5
github.com/redis/go-redis/v9 v9.5.1
github.com/redis/go-redis/v9 v9.7.0
github.com/segmentio/fasthash v1.0.3
github.com/xitongsys/parquet-go v1.6.2
golang.org/x/term v0.18.0
golang.org/x/term v0.25.0
golang.org/x/time v0.5.0
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142
gopkg.in/inf.v0 v0.9.1
)

Expand All @@ -106,7 +106,7 @@ require (
github.com/bits-and-blooms/bitset v1.4.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/caarlos0/log v0.4.4 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charmbracelet/lipgloss v0.9.1 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
Expand All @@ -122,7 +122,7 @@ require (
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
Expand Down Expand Up @@ -152,7 +152,8 @@ require (
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.5 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/linkedin/goavro/v2 v2.9.8 // indirect
Expand All @@ -170,21 +171,21 @@ require (
github.com/muesli/termenv v0.15.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.8 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/pquerna/cachecontrol v0.2.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.2 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xitongsys/parquet-go-source v0.0.0-20200817004010-026bad9b25d0 // indirect
Expand All @@ -195,16 +196,15 @@ require (
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.4.1 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/cli-runtime v0.26.15 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
Expand Down
Loading

0 comments on commit 1575237

Please sign in to comment.