Open ms-hujia opened 1 month ago
Attention: Patch coverage is 80.00000%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 91.54%. Comparing base (
fb9d80d
) to head (d6696fb
). Report is 83 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
otelcol/collector.go | 60.00% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I am curious if any performance gains are worth this extra complexity. Could you provide some benchmarks?
As I tested, the performance difference is very small (<0.05s) in benchmark. Unless I use a giant config file or emulate by a web server with delay, the improvement would be great.
As I explained in description, the point here is mainly avoiding a duplicate read operation in the same function of collector
.
Ping for review... @TylerHelmuth @mx-psi @atoulme
This PR was marked stale due to lack of activity. It will be closed in 14 days.
Description:
For the implementation of
ConfigProvider
, the result ofResolve
is memoized to avoid duplicate read operations to the config. The benefits include:Collector
, the existing code will perform another extra read operation to the config right after the first one.Watch()
in some rare corner case. This could happen after the watch is tear down and before new watch is setup in the second invocation toResolve()
.Link to tracking Issue:
N/A.
Testing:
No change to the interface and behavior, so all existing tests should be enough.
Documentation:
N/A.