Fix & enhance platform_throttled_error_log() which is ignoring input 'sec' arg. Throttling of messages is basically non-functional.
@gapisback is already working on this.
Since Mar 9, 2022.
- Dominant language
- C
- Stars
- 732
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Seems like platform_throttled_error_log() was written to emit progress messages periodically based on elapsed-time / timer, but its input arg sec is not being used.
This logging function is used in perf-tests, so it's not doing what it was supposed to do.
Grabbing a timer value from clock may itself be slow, affecting perf measurements.
An alternate solution would be to throttling of progress messages is done using a local counter variable. Each invocation of this macro will tick the counter.
We then print the message periodically as follows:
- For 0, 9 - for each value,
- Then, every 10th value
- Then, every 100th value
- Then, every 1000th value ... and so on
So for long-running code blocks, you will see progress reported, but the longer the thing runs, the less frequent the progress message will be.
Another option is to throttle and only print the message when the counter is at values which are (2**n); e.g. at 0, 2, 4, 8, 16, 32, 64, ... and so on.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.