Sys level rps

This commit is contained in:
breel
2020-07-30 15:55:42 -06:00
parent 6a175d245a
commit 5a383a1e71
3 changed files with 49 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ type Config struct {
AuthLifetime time.Duration
MaxFileSize int64
RPS int
SysRPS int
}
func New() Config {
@@ -39,6 +40,7 @@ func New() Config {
as.Append(args.DURATION, "authlifetime", "duration auth is valid for", time.Hour)
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)
if err := as.Parse(); err != nil {
os.Remove(f.Name())
@@ -56,5 +58,6 @@ func New() Config {
AuthLifetime: as.GetDuration("authlifetime"),
MaxFileSize: int64(as.GetInt("max-file-size")),
RPS: as.GetInt("rps"),
SysRPS: as.GetInt("sys-rps"),
}
}