sensein / etelemetry-client

Etelemetry client
Other
3 stars 9 forks source link

RF/OPT: delay import of requests until used/needed in _etrequest #30

Closed yarikoptic closed 3 years ago

yarikoptic commented 3 years ago

It is a partial workaround for https://github.com/sensein/etelemetry-client/issues/29 where ultimately requests is not a dependency at all, but rather built-in http is used for that minimal amount of interaction needed.

This minimal change should shave off about 60ms from etelemetry import/use runtime whenever no refresh _etrequest is needed to be sent

codecov[bot] commented 3 years ago

Codecov Report

Merging #30 (89d43cb) into master (e6e61d7) will increase coverage by 0.53%. The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
+ Coverage   81.15%   81.69%   +0.53%     
==========================================
  Files           3        3              
  Lines          69       71       +2     
==========================================
+ Hits           56       58       +2     
  Misses         13       13              
Flag Coverage Δ
unittests 81.69% <75.00%> (+0.53%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
etelemetry/client.py 80.95% <75.00%> (+0.62%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ca72400...82893a6. Read the comment docs.

yarikoptic commented 3 years ago

I guess it would be up to @satra to press the big green button now ;-)