Don’t see any benefits here, only harder to read for most of the users.
Before:
02024-01-16T13:11:36Z Dumped mempool: 8.165e-06s to copy, 0.00224268s to dump
After:
02024-01-16T13:11:36Z Dumped mempool: 0.000s to copy, 0.002s to dump
Don’t see any benefits here, only harder to read for most of the users.
Before:
02024-01-16T13:11:36Z Dumped mempool: 8.165e-06s to copy, 0.00224268s to dump
After:
02024-01-16T13:11:36Z Dumped mempool: 0.000s to copy, 0.002s to dump
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | glozow |
Concept ACK | epiccurious |
If your review is incorrectly listed, please react with ๐ to this comment and the bot will ignore it on the next update.
I don’t think nanosecond precision helps here. Might as well limit to %.2fs
?
Same here?
0src/policy/fees.cpp: LogPrint(BCLog::ESTIMATEFEE, "Recorded %u unconfirmed txs from mempool in %gs\n", num_entries, Ticks<SecondsDouble>(endclear - startclear));
I don’t think nanosecond precision helps here. Might as well limit to
%.2fs
?
Agree, such precision is not needed, but didn’t seem too important, message itself is relatively small anyway, so few extra characters doesn’t hurt.
I would prefer millisecond precision, but plain %.3f
will output 0.000 for 0.0009, don’t think that’s the right thing to do, should ceil or round before output then.
Same here?
0src/policy/fees.cpp: LogPrint(BCLog::ESTIMATEFEE, "Recorded %u unconfirmed txs from mempool in %gs\n", num_entries, Ticks<SecondsDouble>(endclear - startclear));
Will look at it.
plain
%.3f
will output 0.000 for 0.0009, don’t think that’s the right thing to do, should ceil or round before output then.
Why? “It took less than 1ms” should be pretty intuitive.
Tested ACK.
Before:
2024-01-31T16:34:07Z Dumped mempool: 2.007e-06s to copy, 0.00121729s to dump
With %f:
2024-01-31T16:36:03Z Dumped mempool: 0.000002s to copy, 0.001363s to dump
With %0.3f:
2024-01-31T16:38:05Z Dumped mempool: 0.000s to copy, 0.001s to dump
I would prefer millisecond precision, but plain %.3f will output 0.000 for 0.0009, don’t think that’s the right thing to do, should ceil or round before output then.
A ceiling function wouldn’t be right either, since it would report 1ms for my test when it actually took 2 ยตs.
Rounding to the nearest 1ms would be nice (1.99 ms would be logged as 2ms not 1ms), but might not be worth the added code complexity for little benefit.
lgtm ACK c819a83. can you update the PR description?
Updated.
Are you sure the ‘before" is accurate?
Yes,
%g
results in using%e
or%f
, depending on what results in shorter string.
Oh, wait, no, accidentally removed precision for “before” when editing, double checked debug.log, fixed.