mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-18 13:21:00 +02:00
Load testing: synthetic VMs, multiple worker support and Grafana k6 test (#389)
* Load testing: synthetic VMs, multiple worker support and Grafana k6 test * echoserver: prevent fallthrough when Accept() fails * Move default local-dev context logic to CreateDevController() * Synthetic: add a random delay to startup script echoing
This commit is contained in:
@@ -59,7 +59,7 @@ func (controller *Controller) createWorker(ctx *gin.Context) responder.Responder
|
||||
return responder.Code(http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
if uint(len(workers)+1) > controller.maxWorkersPerLicense {
|
||||
if !controller.synthetic && uint(len(workers)+1) > controller.maxWorkersPerLicense {
|
||||
return responder.JSON(http.StatusConflict, NewErrorResponse("cannot register a new worker "+
|
||||
"because the license capacity of %d workers has been reached, "+
|
||||
"consider upgrading at https://tart.run/licensing/", controller.maxWorkersPerLicense))
|
||||
|
||||
@@ -66,6 +66,7 @@ type Controller struct {
|
||||
disableDBCompression bool
|
||||
pingInterval time.Duration
|
||||
prometheusMetrics bool
|
||||
synthetic bool
|
||||
|
||||
sshListenAddr string
|
||||
sshSigner ssh.Signer
|
||||
|
||||
@@ -84,6 +84,12 @@ func WithPrometheusMetrics() Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithSynthetic() Option {
|
||||
return func(controller *Controller) {
|
||||
controller.synthetic = true
|
||||
}
|
||||
}
|
||||
|
||||
func WithLogger(logger *zap.Logger) Option {
|
||||
return func(controller *Controller) {
|
||||
controller.logger = logger.Sugar()
|
||||
|
||||
Reference in New Issue
Block a user