Skip to content

feat(Snaps): Change Snap export tracking approach #31553

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

david0xd
Copy link
Contributor

@david0xd david0xd commented Apr 3, 2025

Description

This PR is the next step in moving Snap export tracking away from the extension and transferring its functionality and responsibility to Snap Controller.

Notes

Open in GitHub Codespaces

Related issues

Fixes: MetaMask/snaps#3259

Manual testing steps

  1. Find a way to verify that events are tracked (test locally, add console log, etc.)

Screenshots/Recordings

Before

n/a

After

n/a

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@david0xd david0xd added the team-snaps-platform Snaps Platform team label Apr 3, 2025
@david0xd david0xd self-assigned this Apr 3, 2025
Copy link
Contributor

github-actions bot commented Apr 3, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot
Copy link
Collaborator

metamaskbot commented Apr 3, 2025

✨ Files requiring CODEOWNER review ✨

🫰 @MetaMask/snaps-devs

  • app/scripts/controller-init/snaps/snap-controller-init.test.ts
  • app/scripts/controller-init/snaps/snap-controller-init.ts

@david0xd david0xd force-pushed the dd/change-snap-export-tracking branch from 42a4287 to de35e5f Compare April 3, 2025 11:21
@metamaskbot
Copy link
Collaborator

Builds ready [0e305f4]
UI Startup Metrics (1225 ± 66 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1225111214216612651371
load10749631236601141992
domContentLoaded10689591229601157996
domInteractive16133451627
firstPaint7181261192419238973
backgroundConnect9633399
firstReactRender19144661934
getState10427668
initialActions001001
loadScripts82071798459861926
setupStore7516278
WebpackHomeuiStartup21531757270423723032641
load16741384222819618212043
domContentLoaded16681379222419418162021
domInteractive181277141455
firstPaint1986838564246385
backgroundConnect3215226273281
firstReactRender186553581148899
getState1332642689
initialActions316134
loadScripts16601369222019018101996
setupStore32729257258
FirefoxBrowserifyHomeuiStartup13711184201715314071744
load12321052187914912701588
domContentLoaded12321052187914912701588
domInteractive10140185298797
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23165962533
firstReactRender22194742228
getState6425278
initialActions001001
loadScripts12101035185714812521555
setupStore6459667
WebpackHomeuiStartup16031383217717616892049
load13841195194116614751830
domContentLoaded13841194194116614741829
domInteractive10637244279398
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25184552733
firstReactRender37305764052
getState8432589
initialActions102111
loadScripts13611176191416514511810
setupStore8533489
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -1.01 KiB (-0.02%)
  • ui: -7.63 KiB (-0.11%)
  • common: -870 Bytes (-0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [d9d1973]
UI Startup Metrics (1212 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1212109613906212511316
load10699701249571150992
domContentLoaded10639661230561162993
domInteractive16133441528
firstPaint7251311239428234986
backgroundConnect9628399
firstReactRender19154251932
getState10434667
initialActions001000
loadScripts81471695455839923
setupStore7413278
WebpackHomeuiStartup21181679254016922352308
load16471305203112917271828
domContentLoaded16411300202712917221824
domInteractive171258111451
firstPaint163683635924093
backgroundConnect3210247312962
firstReactRender178533531136090
getState9326479
initialActions512352335
loadScripts16321296201712817111821
setupStore256296492578
FirefoxBrowserifyHomeuiStartup13971221196313514531739
load12521069180013213011574
domContentLoaded12521069180013213011573
domInteractive9840191258995
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect24175372637
firstReactRender23196152329
getState7418279
initialActions001001
loadScripts12291048177213112831546
setupStore7423368
WebpackHomeuiStartup15641348224718816212086
load13431154192216313901729
domContentLoaded13431154192116313891729
domInteractive9538163259096
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect26189292745
firstReactRender36295153847
getState8431489
initialActions101011
loadScripts13201134189816213661700
setupStore951181289
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.27 KiB (0.04%)
  • ui: 8.79 KiB (0.13%)
  • common: 201 Bytes (0%)

@david0xd david0xd force-pushed the dd/change-snap-export-tracking branch from d9d1973 to 78ecd22 Compare April 4, 2025 13:14
@metamaskbot
Copy link
Collaborator

Builds ready [78ecd22]
UI Startup Metrics (1236 ± 65 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1236110014166512751351
load10859741248591144991
domContentLoaded10809671242601148988
domInteractive17137081630
firstPaint737911221438220987
backgroundConnect106284910
firstReactRender19154152033
getState12445868
initialActions001001
loadScripts82872198358871940
setupStore8429378
WebpackHomeuiStartup21271703259119822722459
load16521320199815417601910
domContentLoaded16461316197115217551882
domInteractive16126081442
firstPaint160643875923290
backgroundConnect291192153373
firstReactRender163543751146996
getState1231811889
initialActions712353235
loadScripts16371313194515117521857
setupStore626305982878
FirefoxBrowserifyHomeuiStartup14391244212217714751865
load12881088192517213301690
domContentLoaded12881087192517213301689
domInteractive10342165228796
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2716129152650
firstReactRender23203732428
getState7435489
initialActions001001
loadScripts12631068189516613041671
setupStore7487868
WebpackHomeuiStartup15471373206015815871948
load13311170180614513711709
domContentLoaded13311169180614513701709
domInteractive9534169239197
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25195162645
firstReactRender36287173949
getState8335589
initialActions102111
loadScripts13081144178614513441687
setupStore8529388
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -561 Bytes (-0.01%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)

@david0xd david0xd force-pushed the dd/change-snap-export-tracking branch 3 times, most recently from 7716eac to 7c83edf Compare April 24, 2025 11:00
Fix lint issues

Fix unit test

Return changes after conflict resolve (rebase)

Revert unwanted controller changes
@david0xd david0xd force-pushed the dd/change-snap-export-tracking branch from 7c83edf to 51025f3 Compare May 5, 2025 10:26
@metamaskbot
Copy link
Collaborator

Builds ready [51025f3]
UI Startup Metrics (1215 ± 70 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1215108014367012521369
load105695312746410891185
domContentLoaded105094812706310841179
domInteractive1813115121629
firstPaint71081120842310751167
backgroundConnect74293812
firstReactRender20164252129
getState1153261625
initialActions001001
loadScripts814716103160845935
setupStore75142710
WebpackHomeuiStartup21131748241516022322350
load16271271187112917321802
domContentLoaded16201267186712917291797
domInteractive15114881339
firstPaint195721618168206336
backgroundConnect261166123054
firstReactRender20755379123345362
getState154404401429
initialActions317135
loadScripts16151264186613017261794
setupStore227292362037
FirefoxBrowserifyHomeuiStartup13521184162710214401531
load12091027150610513061387
domContentLoaded12091027150610513061386
domInteractive1044322432117182
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect20128692040
firstReactRender22195152328
getState74273813
initialActions002001
loadScripts11901014149010412811367
setupStore841621668
WebpackHomeuiStartup15311373202912115881803
load13081189169610313521527
domContentLoaded13081189169610313521527
domInteractive77511301783119
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect251491112644
firstReactRender36296673950
getState1053161029
initialActions102111
loadScripts12881169167010313321510
setupStore11525625931
Benchmark value 1369 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 337 exceeds gate value 334 for chrome webpack home p95 firstPaint
Benchmark value 31 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 0ms | Sum of p95 exceeds: 10ms
Sum of all benchmark exceeds: 10ms

Bundle size diffs [🚀 Bundle size reduced!]
  • background: -561 Bytes (-0.01%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)

github-merge-queue bot pushed a commit to MetaMask/snaps that referenced this pull request May 5, 2025
This PR moves MetaMetrics tracking of Snap export usage to Snap
Controller.

Related issue: #3259

Extension integration PR:
MetaMask/metamask-extension#31553
Mobile integration PR:
MetaMask/metamask-mobile#14428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move Snap export metrics to SnapController
2 participants