Artificial delay for testing

This commit is contained in:
breel
2020-07-31 22:07:54 -06:00
parent 8444156866
commit e706548f55
4 changed files with 50 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ type Config struct {
MaxFileSize int64
RPS int
SysRPS int
Delay time.Duration
}
func New() Config {
@@ -38,6 +39,7 @@ func New() Config {
as.Append(args.STRING, "drivertype", "database driver to use", "boltdb")
as.Append(args.BOOL, "auth", "check for authorized access", false)
as.Append(args.DURATION, "authlifetime", "duration auth is valid for", time.Hour)
as.Append(args.DURATION, "delay", "time to delay requests", time.Duration(0))
as.Append(args.INT, "max-file-size", "max file size for uploads in bytes", 50*(1<<20))
as.Append(args.INT, "rps", "rps per namespace", 5)
as.Append(args.INT, "sys-rps", "rps for the sys", 10)
@@ -56,6 +58,7 @@ func New() Config {
DriverType: as.GetString("drivertype"),
Auth: as.GetBool("auth"),
AuthLifetime: as.GetDuration("authlifetime"),
Delay: as.GetDuration("delay"),
MaxFileSize: int64(as.GetInt("max-file-size")),
RPS: as.GetInt("rps"),
SysRPS: as.GetInt("sys-rps"),