Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add stats logging to thumbnail api #16133

Merged
merged 1 commit into from
Aug 9, 2021
Merged

chore: add stats logging to thumbnail api #16133

merged 1 commit into from
Aug 9, 2021

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Aug 7, 2021

SUMMARY

Adding a few events to related to thumbnail generation. The main driver here is to be able to compute a thumbnail_cache_hit_rate

  • DashboardRestApi.thumbnail.async: endpoint is hit, 202 is returned and async process is triggered
  • DashboardRestApi.thumbnail.redirect: thumbnail exists for dashboard, redirecting to the right hash (digest)
  • DashboardRestApi.thumbnail.from_cache: indicates the thumbnail was loaded from cache (following the redirect)

All equivalent events for ChartRestApi are also logged the same way.

Logically cache_hit_rate = from_cache/(async+from_cache)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2021-08-07 at 10 03 57 AM

TESTING INSTRUCTIONS

Tested thoroughly on docker-compose locally, made sure all the events logged through the dummy stats logger looked as expected

@codecov
Copy link

codecov bot commented Aug 7, 2021

Codecov Report

Merging #16133 (9a16605) into master (85ae8e3) will decrease coverage by 0.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16133      +/-   ##
==========================================
- Coverage   76.84%   76.63%   -0.21%     
==========================================
  Files         995      995              
  Lines       52884    52890       +6     
  Branches     6721     6721              
==========================================
- Hits        40638    40533     -105     
- Misses      12021    12133     +112     
+ Partials      225      224       -1     
Flag Coverage Δ
hive ?
javascript 71.23% <ø> (ø)
mysql 81.58% <100.00%> (+0.04%) ⬆️
postgres 81.61% <100.00%> (+<0.01%) ⬆️
presto ?
python 81.69% <100.00%> (-0.43%) ⬇️
sqlite 81.25% <100.00%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
superset/charts/api.py 85.82% <100.00%> (+0.11%) ⬆️
superset/dashboards/api.py 93.03% <100.00%> (+0.07%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 69.80% <0.00%> (-16.87%) ⬇️
superset/db_engine_specs/presto.py 83.47% <0.00%> (-6.91%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/connectors/sqla/models.py 88.08% <0.00%> (-1.67%) ⬇️
superset/db_engine_specs/base.py 87.98% <0.00%> (-0.39%) ⬇️
superset/models/core.py 89.61% <0.00%> (-0.26%) ⬇️
superset/utils/core.py 88.09% <0.00%> (-0.13%) ⬇️
... and 1 more

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 85ae8e3...9a16605. Read the comment docs.

Copy link
Member

@craig-rueda craig-rueda left a comment

Choose a reason for hiding this comment

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

LGTM

@mistercrunch mistercrunch merged commit df50a47 into master Aug 9, 2021
@mistercrunch mistercrunch deleted the log_thumb branch August 9, 2021 15:34
@rosemarie-chiu
Copy link
Contributor

🏷 2021.31

@villebro villebro added the v1.3 label Aug 9, 2021
villebro pushed a commit that referenced this pull request Aug 10, 2021
stevenuray pushed a commit to preset-io/superset that referenced this pull request Aug 11, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2021.31 preset-io size/XS v1.3 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants