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

Add Advanced Cache Upsell #43099

Merged
merged 4 commits into from
May 31, 2024
Merged

Add Advanced Cache Upsell #43099

merged 4 commits into from
May 31, 2024

Conversation

iethree
Copy link
Contributor

@iethree iethree commented May 23, 2024

closes #41119

see discussion

Description

  • Adds a useHasTokenFeature hook
  • Adds an upsell for advanced caching for admins that don't have it
  • Displays that upsell on the performance tab

Screen Shot 2024-05-24 at 7 50 39 AM

Checklist

  • Tests have been added/updated to cover changes in this PR

@iethree iethree added the backport Automatically create PR on current release branch on merge label May 23, 2024
@iethree iethree requested review from rafpaf, mazameli, luizarakaki and a team May 23, 2024 23:14
@iethree iethree self-assigned this May 23, 2024
@metabase-bot metabase-bot bot added the .Team/AdminWebapp Admin and Webapp team label May 23, 2024
Copy link

github-actions bot commented May 23, 2024

Codenotify: Notifying subscribers in CODENOTIFY files for diff 4c2d240...9048794.

Notify File(s)
@ranquild frontend/src/metabase/setup/selectors.ts

Copy link

replay-io bot commented May 23, 2024

Status In Progress ↗︎ 55 / 56
Commit 9048794
Results
⚠️ 2 Flaky
2572 Passed

Copy link
Contributor

@mazameli mazameli left a comment

Choose a reason for hiding this comment

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

The upsell card component should have a white bg.

@iethree
Copy link
Contributor Author

iethree commented May 24, 2024

The upsell card component should have a white bg.

thanks for catching that. fixed!
Screen Shot 2024-05-24 at 7 50 39 AM

@iethree iethree requested a review from mazameli May 24, 2024 13:51
@mazameli
Copy link
Contributor

Dunno if this is problematic, but /admin/performance exploded when I accidentally built the FE and ran the server via yarn dev-ee instead of via yarn dev:

image
[backend] 2024-05-29 10:21:36,101 INFO i18n.impl :: Reading available locales from locales.clj...
[backend] 2024-05-29 10:21:36,150 INFO util.fonts :: Reading available fonts from /Users/maz/workspace/metabase/resources/frontend_client/app/fonts
[backend] 2024-05-29 10:21:39,551 WARN metabase.public-settings :: 'uploads-enabled' has been removed; use 'uploads_enabled' on the database instead
[backend] 2024-05-29 10:21:39,807 DEBUG middleware.log :: GET /api/session/properties 200 651.7 ms (10 DB calls) App DB connections: 0/4 Jetty threads: 6/50 (1 idle, 0 queued) (45 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:39,934 DEBUG middleware.log :: GET /api/user/current 200 796.7 ms (13 DB calls) App DB connections: 0/4 Jetty threads: 6/50 (1 idle, 0 queued) (45 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:40,320 DEBUG middleware.log :: GET /api/database 200 255.8 ms (1 DB calls) App DB connections: 0/7 Jetty threads: 9/50 (1 idle, 0 queued) (48 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:40,478 DEBUG middleware.log :: GET /api/collection/root 200 413.1 ms (2 DB calls) App DB connections: 1/7 Jetty threads: 8/50 (1 idle, 0 queued) (41 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:40,515 DEBUG middleware.log :: GET /api/bookmark 200 308.2 ms (1 DB calls) App DB connections: 1/7 Jetty threads: 7/50 (1 idle, 0 queued) (41 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:40,676 DEBUG middleware.log :: GET /api/collection/tree 200 419.9 ms (6 DB calls) App DB connections: 2/7 Jetty threads: 10/50 (1 idle, 0 queued) (41 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:40,858 DEBUG middleware.log :: GET /api/util/bug_report_details 200 187.6 ms (1 DB calls) App DB connections: 4/7 Jetty threads: 10/50 (1 idle, 0 queued) (41 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:40,891 DEBUG middleware.log :: GET /api/collection/trash 200 218.0 ms (4 DB calls) App DB connections: 3/7 Jetty threads: 10/50 (1 idle, 0 queued) (41 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:41,187 ERROR models.recent-views :: Invalid recent view item: nil reason: ["invalid type" "invalid dispatch value"]
[backend] 2024-05-29 10:21:41,205 ERROR models.recent-views :: Invalid recent view item: nil reason: ["invalid type" "invalid dispatch value"]
[backend] 2024-05-29 10:21:41,215 ERROR models.recent-views :: Invalid recent view item: nil reason: ["invalid type" "invalid dispatch value"]
[backend] 2024-05-29 10:21:41,224 ERROR models.recent-views :: Invalid recent view item: nil reason: ["invalid type" "invalid dispatch value"]
[backend] 2024-05-29 10:21:41,227 ERROR models.recent-views :: Invalid recent view item: nil reason: ["invalid type" "invalid dispatch value"]
[backend] 2024-05-29 10:21:41,228 ERROR models.recent-views :: Invalid recent view item: nil reason: ["invalid type" "invalid dispatch value"]
[backend] 2024-05-29 10:21:41,229 ERROR models.recent-views :: Invalid recent view item: nil reason: ["invalid type" "invalid dispatch value"]
[backend] 2024-05-29 10:21:41,232 ERROR models.recent-views :: Invalid recent view item: nil reason: ["invalid type" "invalid dispatch value"]
[backend] 2024-05-29 10:21:41,238 DEBUG middleware.log :: GET /api/activity/recent_views 200 608.0 ms (7 DB calls) App DB connections: 2/7 Jetty threads: 8/50 (1 idle, 0 queued) (41 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:41,411 DEBUG middleware.log :: GET /api/activity/popular_items 200 780.3 ms (10 DB calls) App DB connections: 0/7 Jetty threads: 7/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:41,629 DEBUG middleware.log :: GET /api/search 200 1.4 s (6 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:21:42,251 DEBUG middleware.log :: GET /api/automagic-dashboards/database/2/candidates 200 1.2 s (7 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (4 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:00,443 WARN metabase.public-settings :: 'uploads-enabled' has been removed; use 'uploads_enabled' on the database instead
[backend] 2024-05-29 10:22:00,580 DEBUG middleware.log :: GET /api/session/properties 200 224.9 ms (10 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (5 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:00,694 WARN metabase.public-settings :: 'uploads-enabled' has been removed; use 'uploads_enabled' on the database instead
[backend] 2024-05-29 10:22:00,800 WARN metabase.public-settings :: 'uploads-enabled' has been removed; use 'uploads_enabled' on the database instead
[backend] 2024-05-29 10:22:00,828 DEBUG middleware.log :: GET /api/setting 200 469.5 ms (25 DB calls) App DB connections: 1/7 Jetty threads: 6/50 (5 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:00,855 DEBUG middleware.log :: GET /api/session/properties 200 221.3 ms (10 DB calls) App DB connections: 0/7 Jetty threads: 7/50 (5 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:01,150 WARN metabase.public-settings :: 'uploads-enabled' has been removed; use 'uploads_enabled' on the database instead
[backend] 2024-05-29 10:22:01,170 DEBUG middleware.log :: GET /api/setup/admin_checklist 200 186.7 ms (11 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (5 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:01,170 DEBUG middleware.log :: GET /api/setting 200 321.3 ms (25 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (5 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:01,408 DEBUG middleware.log :: GET /api/cache 200 33.0 ms (1 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (5 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:01,408 DEBUG middleware.log :: GET /api/cache 200 32.8 ms (1 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (5 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:04,967 WARN metabase.public-settings :: 'uploads-enabled' has been removed; use 'uploads_enabled' on the database instead
[backend] 2024-05-29 10:22:05,052 DEBUG middleware.log :: GET /api/user/current 200 129.4 ms (11 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (5 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:05,240 DEBUG middleware.log :: GET /api/session/properties 200 310.1 ms (10 DB calls) App DB connections: 3/7 Jetty threads: 10/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:05,294 DEBUG middleware.log :: GET /api/cache 200 49.5 ms (1 DB calls) App DB connections: 1/7 Jetty threads: 10/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:05,295 DEBUG middleware.log :: GET /api/cache 200 52.0 ms (1 DB calls) App DB connections: 1/7 Jetty threads: 10/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:05,348 DEBUG middleware.log :: GET /api/database 200 114.2 ms (1 DB calls) App DB connections: 0/7 Jetty threads: 9/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:05,553 WARN metabase.public-settings :: 'uploads-enabled' has been removed; use 'uploads_enabled' on the database instead
[backend] 2024-05-29 10:22:05,791 DEBUG middleware.log :: GET /api/session/properties 200 390.9 ms (10 DB calls) App DB connections: 0/7 Jetty threads: 7/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:05,933 WARN metabase.public-settings :: 'uploads-enabled' has been removed; use 'uploads_enabled' on the database instead
[backend] 2024-05-29 10:22:05,952 DEBUG middleware.log :: GET /api/setting 200 721.9 ms (25 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}
[backend] 2024-05-29 10:22:05,995 DEBUG middleware.log :: GET /api/search 200 628.7 ms (5 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 1}

@iethree
Copy link
Contributor Author

iethree commented May 29, 2024

Dunno if this is problematic, but /admin/performance exploded when I accidentally built the FE and ran the server via yarn dev-ee instead of via yarn dev:

👍 had a bad rebase. tests caught it too.

Copy link
Contributor

@sloansparger sloansparger left a comment

Choose a reason for hiding this comment

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

Nice! I like the addition of useHasTokenFeature.

@@ -64,4 +64,5 @@ export const UpsellCardComponent = styled.div`
border-radius: 0.5rem;
overflow: hidden;
border: 1px solid ${upsellColors.secondary};
background-color: ${color("white")};
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just "white"?

@iethree iethree merged commit 557e6ea into master May 31, 2024
109 checks passed
@iethree iethree deleted the cache-upsell branch May 31, 2024 16:30
iethree added a commit that referenced this pull request May 31, 2024
* add hook to check token features

* add cache upsell to performance page

* upsell cards are white

* fix rebase
# Conflicts:
#	frontend/src/metabase/admin/performance/components/StrategyEditorForDatabases.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Automatically create PR on current release branch on merge .Team/AdminWebapp Admin and Webapp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Put Cache Upsell component on OSS page
4 participants