Skip to content

config: add HeartbeatUpdateInterval#4832

Merged
algorandskiy merged 7 commits intoalgorand:masterfrom
cce:config-add-heartbeatupdateinterval
Jan 10, 2023
Merged

config: add HeartbeatUpdateInterval#4832
algorandskiy merged 7 commits intoalgorand:masterfrom
cce:config-add-heartbeatupdateinterval

Conversation

@cce
Copy link
Copy Markdown
Contributor

@cce cce commented Nov 23, 2022

Summary

Adds a configurable HeartbeatUpdateInterval to control how often the heartbeat telemetry event is sent, when telemetry is enabled.

Test Plan

Existing tests should pass.

Comment thread config/localTemplate.go Outdated
winder
winder previously approved these changes Dec 5, 2022
Copy link
Copy Markdown
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the only harm would be if everyone changes this to 10s and we end up with a lot more data in the DB. But heartbeat events are probably a small fraction of the total data, so it probably wouldn't be a problem.

winder
winder previously approved these changes Dec 5, 2022
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 8, 2022

Codecov Report

Merging #4832 (60321f1) into master (787d386) will increase coverage by 0.38%.
The diff coverage is 0.00%.

❗ Current head 60321f1 differs from pull request most recent head 6991142. Consider uploading reports for the commit 6991142 to get more accurate results

@@            Coverage Diff             @@
##           master    #4832      +/-   ##
==========================================
+ Coverage   53.64%   54.02%   +0.38%     
==========================================
  Files         432      420      -12     
  Lines       54058    53803     -255     
==========================================
+ Hits        28997    29066      +69     
+ Misses      22813    22363     -450     
- Partials     2248     2374     +126     
Impacted Files Coverage Δ
cmd/algod/main.go 0.00% <0.00%> (ø)
config/localTemplate.go 40.00% <ø> (-3.75%) ⬇️
data/txHandler.go 32.55% <0.00%> (-39.52%) ⬇️
ledger/trackerdb.go 46.66% <0.00%> (-20.99%) ⬇️
ledger/store/catchpoint.go 0.00% <0.00%> (-17.63%) ⬇️
data/transactions/error.go 33.33% <0.00%> (-16.67%) ⬇️
logging/log.go 41.73% <0.00%> (-1.47%) ⬇️
daemon/algod/api/server/v2/test/helpers.go 73.94% <0.00%> (-1.39%) ⬇️
ledger/catchupaccessor.go 63.93% <0.00%> (-0.84%) ⬇️
... and 70 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

winder
winder previously approved these changes Dec 8, 2022
@cce cce force-pushed the config-add-heartbeatupdateinterval branch from 60321f1 to 23f0074 Compare January 9, 2023 15:32
@cce
Copy link
Copy Markdown
Contributor Author

cce commented Jan 10, 2023

@winder addressed your comment in #4832 (review)

Comment thread config/localTemplate.go Outdated
Comment thread cmd/algod/main.go
Comment on lines +352 to +353
case cfg.HeartbeatUpdateInterval < 60: // min frequency 1 minute
interval = time.Minute
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be an error instead? Might be easier than having to document / explain why the units change depending on how big the number is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, the units could be minutes, that way 1 is just the smallest non-disabled value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the units don't change ... they are still seconds..?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

being converted into a time.Duration

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes thats more reasonable. I read that as time.Minute * interval

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could still be confusing. I'm imagining a local test where I set it to 5 to get some more information, then have to switch tasks to figure out why the events aren't being sent out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am assuming no one wants to set it lower than a minute, that it is more valuable to prevent this type of usage, and that user would use the /metrics endpoint instead

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think changing units to minutes would be a slightly better option than changing the config at runtime

Copy link
Copy Markdown
Contributor Author

@cce cce Jan 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only chose it to match the telemetry update interval configuration units that were already being used:

	// PeerConnectionsUpdateInterval defines the interval at which the peer connections information is being sent to the
	// telemetry ( when enabled ). Defined in seconds.
	PeerConnectionsUpdateInterval int `version[5]:"3600"`

winder
winder previously approved these changes Jan 10, 2023
Co-authored-by: Will Winder <wwinder.unh@gmail.com>
@algorandskiy algorandskiy merged commit ecdcbf9 into algorand:master Jan 10, 2023
@cce cce deleted the config-add-heartbeatupdateinterval branch January 10, 2023 15:36
winder pushed a commit to winder/go-algorand that referenced this pull request Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants