chore(inputs.modbus): Deprecate aggressive optimization (#14030)

This commit is contained in:
Sven Rebhan 2023-10-02 18:39:21 +02:00 committed by GitHub
parent 65d0dc5b4a
commit a6858b8024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 9 deletions

View File

@ -157,10 +157,6 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
## |---rearrange -- Rearrange request boundaries within consecutive address ranges
## | to reduce the number of requested registers by keeping
## | the number of requests.
## |---aggressive -- Rearrange request boundaries similar to "rearrange" but
## | allow to request registers not specified by the user to
## | fill gaps. This usually reduces the number of requests at the
## | cost of more requested registers.
## |---max_insert -- Rearrange request keeping the number of extra fields below the value
## provided in "optimization_max_register_fill". It is not necessary to define 'omitted'
## fields as the optimisation will add such field only where needed.

View File

@ -7,6 +7,7 @@ import (
"hash/maphash"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/models"
)
//go:embed sample_request.conf
@ -67,7 +68,19 @@ func (c *ConfigurationPerRequest) Check() error {
}
// Check for valid optimization
switch def.Optimization {
case "", "none", "shrink", "rearrange", "aggressive":
case "", "none", "shrink", "rearrange":
case "aggressive":
models.PrintOptionValueDeprecationNotice(
telegraf.Warn,
"inputs.modbus",
"optimization",
"aggressive",
telegraf.DeprecationInfo{
Since: "1.28.2",
RemovalIn: "1.30.0",
Notice: `use "max_insert" instead`,
},
)
case "max_insert":
switch def.RegisterType {
case "coil":

View File

@ -32,10 +32,6 @@
## |---rearrange -- Rearrange request boundaries within consecutive address ranges
## | to reduce the number of requested registers by keeping
## | the number of requests.
## |---aggressive -- Rearrange request boundaries similar to "rearrange" but
## | allow to request registers not specified by the user to
## | fill gaps. This usually reduces the number of requests at the
## | cost of more requested registers.
## |---max_insert -- Rearrange request keeping the number of extra fields below the value
## provided in "optimization_max_register_fill". It is not necessary to define 'omitted'
## fields as the optimisation will add such field only where needed.