Skip to content

Commit

Permalink
Update saptune discovery interval (#322)
Browse files Browse the repository at this point in the history
* Update saptune discovery interval to be 900s by default

* Include saptune discovery period setting in bundled config sample

* Adjust tests to match the 900 default for saptune
  • Loading branch information
rtorrero committed Feb 15, 2024
1 parent 6ca774e commit 9d901ab
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cmd/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (suite *AgentCmdTestSuite) SetupTest() {
Cloud: 10 * time.Second,
Host: 10 * time.Second,
Subscription: 900 * time.Second,
Saptune: 10 * time.Second,
Saptune: 900 * time.Second,
},
CollectorConfig: &collector.Config{
ServerURL: "http://serverurl",
Expand All @@ -80,7 +80,7 @@ func (suite *AgentCmdTestSuite) TestConfigFromFlags() {
"--sapsystem-discovery-period=10s",
"--host-discovery-period=10s",
"--subscription-discovery-period=900s",
"--saptune-discovery-period=10s",
"--saptune-discovery-period=900s",
"--server-url=http://serverurl",
"--api-key=some-api-key",
"--force-agent-id=some-agent-id",
Expand All @@ -102,7 +102,7 @@ func (suite *AgentCmdTestSuite) TestConfigFromEnv() {
os.Setenv("TRENTO_SAPSYSTEM_DISCOVERY_PERIOD", "10s")
os.Setenv("TRENTO_HOST_DISCOVERY_PERIOD", "10s")
os.Setenv("TRENTO_SUBSCRIPTION_DISCOVERY_PERIOD", "900s")
os.Setenv("TRENTO_SAPTUNE_DISCOVERY_PERIOD", "10s")
os.Setenv("TRENTO_SAPTUNE_DISCOVERY_PERIOD", "900s")
os.Setenv("TRENTO_SERVER_URL", "http://serverurl")
os.Setenv("TRENTO_API_KEY", "some-api-key")
os.Setenv("TRENTO_FORCE_AGENT_ID", "some-agent-id")
Expand Down
2 changes: 1 addition & 1 deletion cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func NewStartCmd() *cobra.Command {
&saptuneDiscoveryPeriod,
"saptune-discovery-period",
"",
10*time.Second,
900*time.Second,
"Saptune discovery mechanism loop period in seconds",
)

Expand Down
9 changes: 9 additions & 0 deletions packaging/config/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@

###############################################################################

## Saptune discovery period configures the tick interval for the saptune
## discovery loop.
## Time unit is seconds
## Defaults to 900.

# saptune-discovery-period: 900s

###############################################################################

## Application log level
## Allowed values: error, warn, info, debug
## defaults to info
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/config/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cluster-discovery-period: 10s
host-discovery-period: 10s
sapsystem-discovery-period: 10s
subscription-discovery-period: 900s
saptune-discovery-period: 10s
saptune-discovery-period: 900s
server-url: http://serverurl
api-key: some-api-key
force-agent-id: some-agent-id
Expand Down

0 comments on commit 9d901ab

Please sign in to comment.