[#396] Rename params

session-token -> session-tokens
rebalance_timer -> rebalance interval
request_timeout -> healthcheck_timeout

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2022-04-14 19:09:57 +04:00 committed by Alex Vanin
parent 0f3ae334e5
commit 8d9e473804
7 changed files with 30 additions and 30 deletions

View file

@ -200,8 +200,8 @@ func issueSecret() *cli.Command {
Value: "REP 2 IN X CBF 3 SELECT 2 FROM * AS X",
},
&cli.StringFlag{
Name: "session-token",
Usage: "create session token with rules, if the rules are set as 'none', no session tokens will be created",
Name: "session-tokens",
Usage: "create session tokens with rules, if the rules are set as 'none', no session tokens will be created",
Required: false,
Destination: &sessionTokenFlag,
Value: "",
@ -278,7 +278,7 @@ It will be ceil rounded to the nearest amount of epoch.`,
sessionRules, skipSessionRules, err := getSessionRules(sessionTokenFlag)
if err != nil {
return cli.Exit(fmt.Sprintf("couldn't parse 'session-token' flag: %s", err.Error()), 8)
return cli.Exit(fmt.Sprintf("couldn't parse 'session-tokens' flag: %s", err.Error()), 8)
}
issueSecretOptions := &authmate.IssueSecretOptions{

View file

@ -61,9 +61,9 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
prmPool pool.InitParameters
reBalance = defaultRebalanceTimer
reBalance = defaultRebalanceInterval
conTimeout = defaultConnectTimeout
reqTimeout = defaultRequestTimeout
hckTimeout = defaultHealthcheckTimeout
maxClientsCount = defaultMaxClientsCount
maxClientsDeadline = defaultMaxClientsDeadline
@ -73,8 +73,8 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
conTimeout = v
}
if v := v.GetDuration(cfgRequestTimeout); v > 0 {
reqTimeout = v
if v := v.GetDuration(cfgHealthcheckTimeout); v > 0 {
hckTimeout = v
}
if v := v.GetInt(cfgMaxClientsCount); v > 0 {
@ -85,7 +85,7 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
maxClientsDeadline = v
}
if v := v.GetDuration(cfgRebalanceTimer); v > 0 {
if v := v.GetDuration(cfgRebalanceInterval); v > 0 {
reBalance = v
}
@ -106,7 +106,7 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
prmPool.SetKey(&key.PrivateKey)
prmPool.SetNodeDialTimeout(conTimeout)
prmPool.SetHealthcheckTimeout(reqTimeout)
prmPool.SetHealthcheckTimeout(hckTimeout)
prmPool.SetClientRebalanceInterval(reBalance)
for _, peer := range fetchPeers(l, v) {
prmPool.AddNode(peer)

View file

@ -17,10 +17,10 @@ import (
)
const (
defaultRebalanceTimer = 15 * time.Second
defaultRequestTimeout = 15 * time.Second
defaultConnectTimeout = 30 * time.Second
defaultShutdownTimeout = 15 * time.Second
defaultRebalanceInterval = 15 * time.Second
defaultHealthcheckTimeout = 15 * time.Second
defaultConnectTimeout = 30 * time.Second
defaultShutdownTimeout = 15 * time.Second
defaultMaxClientsCount = 100
defaultMaxClientsDeadline = time.Second * 30
@ -40,9 +40,9 @@ const ( // Settings.
cfgTLSCertFile = "tls.cert_file"
// Timeouts.
cfgConnectTimeout = "connect_timeout"
cfgRequestTimeout = "request_timeout"
cfgRebalanceTimer = "rebalance_timer"
cfgConnectTimeout = "connect_timeout"
cfgHealthcheckTimeout = "healthcheck_timeout"
cfgRebalanceInterval = "rebalance_interval"
// Caching.
cfgObjectsCacheLifetime = "cache.objects.lifetime"
@ -180,9 +180,9 @@ func newSettings() *viper.Viper {
flags.String(cfgAddress, "", `address of wallet account`)
config := flags.String(cmdConfig, "", "config path")
flags.Duration(cfgRequestTimeout, defaultRequestTimeout, "set gRPC request timeout")
flags.Duration(cfgConnectTimeout, defaultConnectTimeout, "set gRPC connect timeout")
flags.Duration(cfgRebalanceTimer, defaultRebalanceTimer, "set gRPC connection rebalance timer")
flags.Duration(cfgHealthcheckTimeout, defaultHealthcheckTimeout, "set timeout to check node health during rebalance")
flags.Duration(cfgConnectTimeout, defaultConnectTimeout, "set timeout to connect to NeoFS nodes")
flags.Duration(cfgRebalanceInterval, defaultRebalanceInterval, "set rebalance interval")
flags.Int(cfgMaxClientsCount, defaultMaxClientsCount, "set max-clients count")
flags.Duration(cfgMaxClientsDeadline, defaultMaxClientsDeadline, "set max-clients deadline")

View file

@ -45,9 +45,9 @@ S3_GW_PPROF=false
# Timeout to connect to a node
S3_GW_CONNECT_TIMEOUT=30s
# Timeout to check node health during rebalance.
S3_GW_REQUEST_TIMEOUT=15s
S3_GW_HEALTHCHECK_TIMEOUT=15s
# Interval to check node health
S3_GW_REBALANCE_TIMER=15s
S3_GW_REBALANCE_INTERVAL=15s
# Limits for processing of clients' requests
S3_GW_MAX_CLIENTS_COUNT=100

View file

@ -46,10 +46,10 @@ pprof: false
# Timeout to connect to a node
connect_timeout: 30s
# Timeout to check node health during rebalance.
request_timeout: 15s
# Timeout to check node health during rebalance
healthcheck_timeout: 15s
# Interval to check node health
rebalance_timer: 15s
rebalance_interval: 15s
# Limits for processing of clients' requests
max_clients_count: 100

View file

@ -187,12 +187,12 @@ If bearer rules are not set, a token will be auto-generated with a value:
### Session tokens
With session token, there are 3 options:
1. append `--session-token` parameter with your custom rules in json format (as a string or file path). E.g.:
1. append `--session-tokens` parameter with your custom rules in json format (as a string or file path). E.g.:
```shell
$ neofs-authmate issue-secret --wallet wallet.json \
--peer 192.168.130.71:8080 \
--gate-public-key 0313b1ac3a8076e155a7e797b24f0b650cccad5941ea59d7cfd51a024a8b2a06bf \
--session-token session.json
--session-tokens session.json
```
where content of `session.json`:
```json
@ -219,7 +219,7 @@ where content of `session.json`:
the authmate creates a `SETEACL` session token automatically in case when a user specified the token rule with `PUT` and
forgot about the rule with `SETEACL`.
2. append `--session-token` parameter with the value `none` -- no session token will be created
2. append `--session-tokens` parameter with the value `none` -- no session token will be created
3. skip the parameter, and `authmate` will create session tokens with default rules (the same as in `session.json`
in example above)

View file

@ -84,12 +84,12 @@ $ neofs-s3-gw --max_clients_count 150 --max_clients_deadline 1m
### Connection to NeoFS
Timeout to connect to NeoFS nodes can be set with `--connect_timeout` (default 30s)
and timeout to check node health during rebalance`--request_timeout` (default 15s).
and timeout to check node health during rebalance`--healthcheck_timeout` (default 15s).
Also, interval to check node health can be specified by `--rebalance_timer` value, default value is 15s.
Also, interval to check node health can be specified by `--rebalance_interval` value, default value is 15s.
```shell
$ neofs-s3-gw --request_timeout 15s --connect_timeout 1m --rebalance_timer 1h
$ neofs-s3-gw --healthcheck_timeout 15s --connect_timeout 1m --rebalance_interval 1h
```
### Monitoring and metrics