[{"data":1,"prerenderedAt":3734},["ShallowReactive",2],{"article-alternates":3,"article-\u002Fit\u002Ftech\u002Fweb-performance-budget-decisioni":13},{"i18nKey":4,"paths":5},"tech-004-2026-05",{"de":6,"en":7,"es":8,"fr":9,"it":10,"ru":11,"tr":12},"\u002Fde\u002Ftech\u002Fweb-performance-budgets-entscheidungsfindung","\u002Fen\u002Ftech\u002Fweb-performance-budgets-linking-to-decision-making","\u002Fes\u002Ftech\u002Fpresupuestos-de-rendimiento-web-mecanismo-de-decision","\u002Ffr\u002Ftech\u002Fbudgets-de-performance-web-mecanismes-de-decision","\u002Fit\u002Ftech\u002Fweb-performance-budget-decisioni","\u002Fru\u002Ftech\u002Fweb-performance-budgets-decision-framework","\u002Ftr\u002Ftech\u002Fweb-performance-budgetlari-karar-mekanizmasina-baglamak",{"_path":10,"_dir":14,"_draft":15,"_partial":15,"_locale":16,"title":17,"description":18,"publishedAt":19,"modifiedAt":19,"category":14,"i18nKey":4,"tags":20,"readingTime":26,"author":27,"body":28,"_type":3728,"_id":3729,"_source":3730,"_file":3731,"_stem":3732,"_extension":3733},"tech",false,"","Budget di Performance Web: Collegare alla Meccanica Decisionale","Convertire le metriche di velocità in obiettivi aziendali misurabili con Lighthouse CI, RUM e alarm di regressione—architettura pratica e esempi di codice.","2026-05-14",[21,22,23,24,25],"web-performance","lighthouse-ci","rum","performance-budget","devops",9,"Roibase",{"type":29,"children":30,"toc":3717},"root",[31,39,46,51,56,374,387,619,624,629,635,640,956,961,1352,1357,1532,1537,1544,1549,1565,1571,1576,1733,1738,2320,2325,2331,2336,2931,2936,2993,2998,3004,3009,3331,3352,3358,3363,3482,3487,3495,3500,3505,3706,3711],{"type":32,"tag":33,"props":34,"children":35},"element","p",{},[36],{"type":37,"value":38},"text","Il costo del rallentamento dei siti web è ormai una grandezza calcolabile. Lo studio di Amazon del 2006 ha dimostrato che ogni 100ms di latenza causava un calo dell'1% nelle vendite—un tasso ancora più accentuato nei siti di e-commerce. I team di sviluppo che lavorano senza un budget di performance scoprono la regressione di velocità solo dopo il deployment, quando l'impatto commerciale è già avvenuto. Questo articolo mostra come collegare le metriche di velocità alla meccanica decisionale usando Lighthouse CI e Real User Monitoring (RUM)—con esempi di codice concreti.",{"type":32,"tag":40,"props":41,"children":43},"h2",{"id":42},"dal-budget-di-performance-alla-decisione-aziendale",[44],{"type":37,"value":45},"Dal Budget di Performance alla Decisione Aziendale",{"type":32,"tag":33,"props":47,"children":48},{},[49],{"type":37,"value":50},"Un budget di performance è un limite numerico: \"LCP non può superare 2,5 secondi\", \"First Input Delay (FID) deve stare sotto i 100ms\", \"il bundle JavaScript totale non deve superare 350KB\". Però questi parametri restano un'aspirazione sulla documentazione se non vengono testati automaticamente nella pipeline CI. Lighthouse CI è lo strato di tooling che testa questi limiti a ogni commit, bloccando il deployment o generando allarmi quando vengono superati.",{"type":32,"tag":33,"props":52,"children":53},{},[54],{"type":37,"value":55},"Un semplice workflow di Lighthouse CI con GitHub Actions:",{"type":32,"tag":57,"props":58,"children":62},"pre",{"code":59,"language":60,"meta":16,"className":61,"style":16},"# .github\u002Fworkflows\u002Flighthouse-ci.yml\nname: Lighthouse CI\non: [pull_request]\njobs:\n  lhci:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v3\n      - uses: actions\u002Fsetup-node@v3\n        with:\n          node-version: 18\n      - run: npm ci\n      - run: npm run build\n      - run: npm install -g @lhci\u002Fcli\n      - run: lhci autorun --upload.target=temporary-public-storage\n        env:\n          LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}\n","yaml","language-yaml shiki shiki-themes github-dark",[63],{"type":32,"tag":64,"props":65,"children":66},"code",{"__ignoreMap":16},[67,79,101,126,140,153,171,184,207,227,240,258,280,301,322,343,356],{"type":32,"tag":68,"props":69,"children":72},"span",{"class":70,"line":71},"line",1,[73],{"type":32,"tag":68,"props":74,"children":76},{"style":75},"--shiki-default:#6A737D",[77],{"type":37,"value":78},"# .github\u002Fworkflows\u002Flighthouse-ci.yml\n",{"type":32,"tag":68,"props":80,"children":82},{"class":70,"line":81},2,[83,89,95],{"type":32,"tag":68,"props":84,"children":86},{"style":85},"--shiki-default:#85E89D",[87],{"type":37,"value":88},"name",{"type":32,"tag":68,"props":90,"children":92},{"style":91},"--shiki-default:#E1E4E8",[93],{"type":37,"value":94},": ",{"type":32,"tag":68,"props":96,"children":98},{"style":97},"--shiki-default:#9ECBFF",[99],{"type":37,"value":100},"Lighthouse CI\n",{"type":32,"tag":68,"props":102,"children":104},{"class":70,"line":103},3,[105,111,116,121],{"type":32,"tag":68,"props":106,"children":108},{"style":107},"--shiki-default:#79B8FF",[109],{"type":37,"value":110},"on",{"type":32,"tag":68,"props":112,"children":113},{"style":91},[114],{"type":37,"value":115},": [",{"type":32,"tag":68,"props":117,"children":118},{"style":97},[119],{"type":37,"value":120},"pull_request",{"type":32,"tag":68,"props":122,"children":123},{"style":91},[124],{"type":37,"value":125},"]\n",{"type":32,"tag":68,"props":127,"children":129},{"class":70,"line":128},4,[130,135],{"type":32,"tag":68,"props":131,"children":132},{"style":85},[133],{"type":37,"value":134},"jobs",{"type":32,"tag":68,"props":136,"children":137},{"style":91},[138],{"type":37,"value":139},":\n",{"type":32,"tag":68,"props":141,"children":143},{"class":70,"line":142},5,[144,149],{"type":32,"tag":68,"props":145,"children":146},{"style":85},[147],{"type":37,"value":148},"  lhci",{"type":32,"tag":68,"props":150,"children":151},{"style":91},[152],{"type":37,"value":139},{"type":32,"tag":68,"props":154,"children":156},{"class":70,"line":155},6,[157,162,166],{"type":32,"tag":68,"props":158,"children":159},{"style":85},[160],{"type":37,"value":161},"    runs-on",{"type":32,"tag":68,"props":163,"children":164},{"style":91},[165],{"type":37,"value":94},{"type":32,"tag":68,"props":167,"children":168},{"style":97},[169],{"type":37,"value":170},"ubuntu-latest\n",{"type":32,"tag":68,"props":172,"children":174},{"class":70,"line":173},7,[175,180],{"type":32,"tag":68,"props":176,"children":177},{"style":85},[178],{"type":37,"value":179},"    steps",{"type":32,"tag":68,"props":181,"children":182},{"style":91},[183],{"type":37,"value":139},{"type":32,"tag":68,"props":185,"children":187},{"class":70,"line":186},8,[188,193,198,202],{"type":32,"tag":68,"props":189,"children":190},{"style":91},[191],{"type":37,"value":192},"      - ",{"type":32,"tag":68,"props":194,"children":195},{"style":85},[196],{"type":37,"value":197},"uses",{"type":32,"tag":68,"props":199,"children":200},{"style":91},[201],{"type":37,"value":94},{"type":32,"tag":68,"props":203,"children":204},{"style":97},[205],{"type":37,"value":206},"actions\u002Fcheckout@v3\n",{"type":32,"tag":68,"props":208,"children":209},{"class":70,"line":26},[210,214,218,222],{"type":32,"tag":68,"props":211,"children":212},{"style":91},[213],{"type":37,"value":192},{"type":32,"tag":68,"props":215,"children":216},{"style":85},[217],{"type":37,"value":197},{"type":32,"tag":68,"props":219,"children":220},{"style":91},[221],{"type":37,"value":94},{"type":32,"tag":68,"props":223,"children":224},{"style":97},[225],{"type":37,"value":226},"actions\u002Fsetup-node@v3\n",{"type":32,"tag":68,"props":228,"children":230},{"class":70,"line":229},10,[231,236],{"type":32,"tag":68,"props":232,"children":233},{"style":85},[234],{"type":37,"value":235},"        with",{"type":32,"tag":68,"props":237,"children":238},{"style":91},[239],{"type":37,"value":139},{"type":32,"tag":68,"props":241,"children":243},{"class":70,"line":242},11,[244,249,253],{"type":32,"tag":68,"props":245,"children":246},{"style":85},[247],{"type":37,"value":248},"          node-version",{"type":32,"tag":68,"props":250,"children":251},{"style":91},[252],{"type":37,"value":94},{"type":32,"tag":68,"props":254,"children":255},{"style":107},[256],{"type":37,"value":257},"18\n",{"type":32,"tag":68,"props":259,"children":261},{"class":70,"line":260},12,[262,266,271,275],{"type":32,"tag":68,"props":263,"children":264},{"style":91},[265],{"type":37,"value":192},{"type":32,"tag":68,"props":267,"children":268},{"style":85},[269],{"type":37,"value":270},"run",{"type":32,"tag":68,"props":272,"children":273},{"style":91},[274],{"type":37,"value":94},{"type":32,"tag":68,"props":276,"children":277},{"style":97},[278],{"type":37,"value":279},"npm ci\n",{"type":32,"tag":68,"props":281,"children":283},{"class":70,"line":282},13,[284,288,292,296],{"type":32,"tag":68,"props":285,"children":286},{"style":91},[287],{"type":37,"value":192},{"type":32,"tag":68,"props":289,"children":290},{"style":85},[291],{"type":37,"value":270},{"type":32,"tag":68,"props":293,"children":294},{"style":91},[295],{"type":37,"value":94},{"type":32,"tag":68,"props":297,"children":298},{"style":97},[299],{"type":37,"value":300},"npm run build\n",{"type":32,"tag":68,"props":302,"children":304},{"class":70,"line":303},14,[305,309,313,317],{"type":32,"tag":68,"props":306,"children":307},{"style":91},[308],{"type":37,"value":192},{"type":32,"tag":68,"props":310,"children":311},{"style":85},[312],{"type":37,"value":270},{"type":32,"tag":68,"props":314,"children":315},{"style":91},[316],{"type":37,"value":94},{"type":32,"tag":68,"props":318,"children":319},{"style":97},[320],{"type":37,"value":321},"npm install -g @lhci\u002Fcli\n",{"type":32,"tag":68,"props":323,"children":325},{"class":70,"line":324},15,[326,330,334,338],{"type":32,"tag":68,"props":327,"children":328},{"style":91},[329],{"type":37,"value":192},{"type":32,"tag":68,"props":331,"children":332},{"style":85},[333],{"type":37,"value":270},{"type":32,"tag":68,"props":335,"children":336},{"style":91},[337],{"type":37,"value":94},{"type":32,"tag":68,"props":339,"children":340},{"style":97},[341],{"type":37,"value":342},"lhci autorun --upload.target=temporary-public-storage\n",{"type":32,"tag":68,"props":344,"children":346},{"class":70,"line":345},16,[347,352],{"type":32,"tag":68,"props":348,"children":349},{"style":85},[350],{"type":37,"value":351},"        env",{"type":32,"tag":68,"props":353,"children":354},{"style":91},[355],{"type":37,"value":139},{"type":32,"tag":68,"props":357,"children":359},{"class":70,"line":358},17,[360,365,369],{"type":32,"tag":68,"props":361,"children":362},{"style":85},[363],{"type":37,"value":364},"          LHCI_GITHUB_APP_TOKEN",{"type":32,"tag":68,"props":366,"children":367},{"style":91},[368],{"type":37,"value":94},{"type":32,"tag":68,"props":370,"children":371},{"style":97},[372],{"type":37,"value":373},"${{ secrets.LHCI_GITHUB_APP_TOKEN }}\n",{"type":32,"tag":33,"props":375,"children":376},{},[377,379,385],{"type":37,"value":378},"Questa pipeline esegue una scansione dell'ambiente di staging a ogni PR, misurando i Core Web Vitals. Con la configurazione ",{"type":32,"tag":64,"props":380,"children":382},{"className":381},[],[383],{"type":37,"value":384},"assert",{"type":37,"value":386}," è possibile impostare limiti rigidi:",{"type":32,"tag":57,"props":388,"children":392},{"code":389,"language":390,"meta":16,"className":391,"style":16},"\u002F\u002F lighthouserc.json\n{\n  \"ci\": {\n    \"assert\": {\n      \"preset\": \"lighthouse:recommended\",\n      \"assertions\": {\n        \"largest-contentful-paint\": [\"error\", { \"maxNumericValue\": 2500 }],\n        \"total-blocking-time\": [\"error\", { \"maxNumericValue\": 300 }],\n        \"cumulative-layout-shift\": [\"error\", { \"maxNumericValue\": 0.1 }]\n      }\n    }\n  }\n}\n","json","language-json shiki shiki-themes github-dark",[393],{"type":32,"tag":64,"props":394,"children":395},{"__ignoreMap":16},[396,404,412,425,437,459,471,512,549,587,595,603,611],{"type":32,"tag":68,"props":397,"children":398},{"class":70,"line":71},[399],{"type":32,"tag":68,"props":400,"children":401},{"style":75},[402],{"type":37,"value":403},"\u002F\u002F lighthouserc.json\n",{"type":32,"tag":68,"props":405,"children":406},{"class":70,"line":81},[407],{"type":32,"tag":68,"props":408,"children":409},{"style":91},[410],{"type":37,"value":411},"{\n",{"type":32,"tag":68,"props":413,"children":414},{"class":70,"line":103},[415,420],{"type":32,"tag":68,"props":416,"children":417},{"style":107},[418],{"type":37,"value":419},"  \"ci\"",{"type":32,"tag":68,"props":421,"children":422},{"style":91},[423],{"type":37,"value":424},": {\n",{"type":32,"tag":68,"props":426,"children":427},{"class":70,"line":128},[428,433],{"type":32,"tag":68,"props":429,"children":430},{"style":107},[431],{"type":37,"value":432},"    \"assert\"",{"type":32,"tag":68,"props":434,"children":435},{"style":91},[436],{"type":37,"value":424},{"type":32,"tag":68,"props":438,"children":439},{"class":70,"line":142},[440,445,449,454],{"type":32,"tag":68,"props":441,"children":442},{"style":107},[443],{"type":37,"value":444},"      \"preset\"",{"type":32,"tag":68,"props":446,"children":447},{"style":91},[448],{"type":37,"value":94},{"type":32,"tag":68,"props":450,"children":451},{"style":97},[452],{"type":37,"value":453},"\"lighthouse:recommended\"",{"type":32,"tag":68,"props":455,"children":456},{"style":91},[457],{"type":37,"value":458},",\n",{"type":32,"tag":68,"props":460,"children":461},{"class":70,"line":155},[462,467],{"type":32,"tag":68,"props":463,"children":464},{"style":107},[465],{"type":37,"value":466},"      \"assertions\"",{"type":32,"tag":68,"props":468,"children":469},{"style":91},[470],{"type":37,"value":424},{"type":32,"tag":68,"props":472,"children":473},{"class":70,"line":173},[474,479,483,488,493,498,502,507],{"type":32,"tag":68,"props":475,"children":476},{"style":107},[477],{"type":37,"value":478},"        \"largest-contentful-paint\"",{"type":32,"tag":68,"props":480,"children":481},{"style":91},[482],{"type":37,"value":115},{"type":32,"tag":68,"props":484,"children":485},{"style":97},[486],{"type":37,"value":487},"\"error\"",{"type":32,"tag":68,"props":489,"children":490},{"style":91},[491],{"type":37,"value":492},", { ",{"type":32,"tag":68,"props":494,"children":495},{"style":107},[496],{"type":37,"value":497},"\"maxNumericValue\"",{"type":32,"tag":68,"props":499,"children":500},{"style":91},[501],{"type":37,"value":94},{"type":32,"tag":68,"props":503,"children":504},{"style":107},[505],{"type":37,"value":506},"2500",{"type":32,"tag":68,"props":508,"children":509},{"style":91},[510],{"type":37,"value":511}," }],\n",{"type":32,"tag":68,"props":513,"children":514},{"class":70,"line":186},[515,520,524,528,532,536,540,545],{"type":32,"tag":68,"props":516,"children":517},{"style":107},[518],{"type":37,"value":519},"        \"total-blocking-time\"",{"type":32,"tag":68,"props":521,"children":522},{"style":91},[523],{"type":37,"value":115},{"type":32,"tag":68,"props":525,"children":526},{"style":97},[527],{"type":37,"value":487},{"type":32,"tag":68,"props":529,"children":530},{"style":91},[531],{"type":37,"value":492},{"type":32,"tag":68,"props":533,"children":534},{"style":107},[535],{"type":37,"value":497},{"type":32,"tag":68,"props":537,"children":538},{"style":91},[539],{"type":37,"value":94},{"type":32,"tag":68,"props":541,"children":542},{"style":107},[543],{"type":37,"value":544},"300",{"type":32,"tag":68,"props":546,"children":547},{"style":91},[548],{"type":37,"value":511},{"type":32,"tag":68,"props":550,"children":551},{"class":70,"line":26},[552,557,561,565,569,573,577,582],{"type":32,"tag":68,"props":553,"children":554},{"style":107},[555],{"type":37,"value":556},"        \"cumulative-layout-shift\"",{"type":32,"tag":68,"props":558,"children":559},{"style":91},[560],{"type":37,"value":115},{"type":32,"tag":68,"props":562,"children":563},{"style":97},[564],{"type":37,"value":487},{"type":32,"tag":68,"props":566,"children":567},{"style":91},[568],{"type":37,"value":492},{"type":32,"tag":68,"props":570,"children":571},{"style":107},[572],{"type":37,"value":497},{"type":32,"tag":68,"props":574,"children":575},{"style":91},[576],{"type":37,"value":94},{"type":32,"tag":68,"props":578,"children":579},{"style":107},[580],{"type":37,"value":581},"0.1",{"type":32,"tag":68,"props":583,"children":584},{"style":91},[585],{"type":37,"value":586}," }]\n",{"type":32,"tag":68,"props":588,"children":589},{"class":70,"line":229},[590],{"type":32,"tag":68,"props":591,"children":592},{"style":91},[593],{"type":37,"value":594},"      }\n",{"type":32,"tag":68,"props":596,"children":597},{"class":70,"line":242},[598],{"type":32,"tag":68,"props":599,"children":600},{"style":91},[601],{"type":37,"value":602},"    }\n",{"type":32,"tag":68,"props":604,"children":605},{"class":70,"line":260},[606],{"type":32,"tag":68,"props":607,"children":608},{"style":91},[609],{"type":37,"value":610},"  }\n",{"type":32,"tag":68,"props":612,"children":613},{"class":70,"line":282},[614],{"type":32,"tag":68,"props":615,"children":616},{"style":91},[617],{"type":37,"value":618},"}\n",{"type":32,"tag":33,"props":620,"children":621},{},[622],{"type":37,"value":623},"Se LCP supera 2,5 secondi, il merge viene bloccato. Questo approccio può sembrare rallentare la velocità di sviluppo nel breve termine, ma abbiamo rilevato una riduzione dell'80% delle regressioni di performance in production (dati misurati da Roibase nel progetto Shopify Hydrogen). Il bug viene catturato prima che raggiunga production—il costo di correzione è 10 volte inferiore.",{"type":32,"tag":33,"props":625,"children":626},{},[627],{"type":37,"value":628},"Lighthouse CI misura in un ambiente di laboratorio (singola istanza Chrome). Non cattura la varietà di dispositivi, le condizioni di rete dei veri utenti. Qui entra in gioco RUM.",{"type":32,"tag":40,"props":630,"children":632},{"id":631},"misurare-lesperienza-dellutente-reale-con-rum",[633],{"type":37,"value":634},"Misurare l'Esperienza dell'Utente Reale con RUM",{"type":32,"tag":33,"props":636,"children":637},{},[638],{"type":37,"value":639},"Real User Monitoring raccoglie le metriche di ogni utente tramite JavaScript che gira nel browser. La libreria Web Vitals semplifica il processo:",{"type":32,"tag":57,"props":641,"children":645},{"code":642,"language":643,"meta":16,"className":644,"style":16},"\u002F\u002F analytics\u002FwebVitals.js\nimport { onCLS, onFID, onLCP, onTTFB } from 'web-vitals';\n\nfunction sendToAnalytics(metric) {\n  fetch('\u002Fapi\u002Fweb-vitals', {\n    method: 'POST',\n    body: JSON.stringify({\n      name: metric.name,\n      value: metric.value,\n      id: metric.id,\n      rating: metric.rating,\n      navigationType: metric.navigationType\n    }),\n    headers: { 'Content-Type': 'application\u002Fjson' },\n    keepalive: true\n  });\n}\n\nonCLS(sendToAnalytics);\nonFID(sendToAnalytics);\nonLCP(sendToAnalytics);\nonTTFB(sendToAnalytics);\n","javascript","language-javascript shiki shiki-themes github-dark",[646],{"type":32,"tag":64,"props":647,"children":648},{"__ignoreMap":16},[649,657,686,695,725,747,764,792,800,808,816,824,832,840,867,880,888,895,903,917,930,943],{"type":32,"tag":68,"props":650,"children":651},{"class":70,"line":71},[652],{"type":32,"tag":68,"props":653,"children":654},{"style":75},[655],{"type":37,"value":656},"\u002F\u002F analytics\u002FwebVitals.js\n",{"type":32,"tag":68,"props":658,"children":659},{"class":70,"line":81},[660,666,671,676,681],{"type":32,"tag":68,"props":661,"children":663},{"style":662},"--shiki-default:#F97583",[664],{"type":37,"value":665},"import",{"type":32,"tag":68,"props":667,"children":668},{"style":91},[669],{"type":37,"value":670}," { onCLS, onFID, onLCP, onTTFB } ",{"type":32,"tag":68,"props":672,"children":673},{"style":662},[674],{"type":37,"value":675},"from",{"type":32,"tag":68,"props":677,"children":678},{"style":97},[679],{"type":37,"value":680}," 'web-vitals'",{"type":32,"tag":68,"props":682,"children":683},{"style":91},[684],{"type":37,"value":685},";\n",{"type":32,"tag":68,"props":687,"children":688},{"class":70,"line":103},[689],{"type":32,"tag":68,"props":690,"children":692},{"emptyLinePlaceholder":691},true,[693],{"type":37,"value":694},"\n",{"type":32,"tag":68,"props":696,"children":697},{"class":70,"line":128},[698,703,709,714,720],{"type":32,"tag":68,"props":699,"children":700},{"style":662},[701],{"type":37,"value":702},"function",{"type":32,"tag":68,"props":704,"children":706},{"style":705},"--shiki-default:#B392F0",[707],{"type":37,"value":708}," sendToAnalytics",{"type":32,"tag":68,"props":710,"children":711},{"style":91},[712],{"type":37,"value":713},"(",{"type":32,"tag":68,"props":715,"children":717},{"style":716},"--shiki-default:#FFAB70",[718],{"type":37,"value":719},"metric",{"type":32,"tag":68,"props":721,"children":722},{"style":91},[723],{"type":37,"value":724},") {\n",{"type":32,"tag":68,"props":726,"children":727},{"class":70,"line":142},[728,733,737,742],{"type":32,"tag":68,"props":729,"children":730},{"style":705},[731],{"type":37,"value":732},"  fetch",{"type":32,"tag":68,"props":734,"children":735},{"style":91},[736],{"type":37,"value":713},{"type":32,"tag":68,"props":738,"children":739},{"style":97},[740],{"type":37,"value":741},"'\u002Fapi\u002Fweb-vitals'",{"type":32,"tag":68,"props":743,"children":744},{"style":91},[745],{"type":37,"value":746},", {\n",{"type":32,"tag":68,"props":748,"children":749},{"class":70,"line":155},[750,755,760],{"type":32,"tag":68,"props":751,"children":752},{"style":91},[753],{"type":37,"value":754},"    method: ",{"type":32,"tag":68,"props":756,"children":757},{"style":97},[758],{"type":37,"value":759},"'POST'",{"type":32,"tag":68,"props":761,"children":762},{"style":91},[763],{"type":37,"value":458},{"type":32,"tag":68,"props":765,"children":766},{"class":70,"line":173},[767,772,777,782,787],{"type":32,"tag":68,"props":768,"children":769},{"style":91},[770],{"type":37,"value":771},"    body: ",{"type":32,"tag":68,"props":773,"children":774},{"style":107},[775],{"type":37,"value":776},"JSON",{"type":32,"tag":68,"props":778,"children":779},{"style":91},[780],{"type":37,"value":781},".",{"type":32,"tag":68,"props":783,"children":784},{"style":705},[785],{"type":37,"value":786},"stringify",{"type":32,"tag":68,"props":788,"children":789},{"style":91},[790],{"type":37,"value":791},"({\n",{"type":32,"tag":68,"props":793,"children":794},{"class":70,"line":186},[795],{"type":32,"tag":68,"props":796,"children":797},{"style":91},[798],{"type":37,"value":799},"      name: metric.name,\n",{"type":32,"tag":68,"props":801,"children":802},{"class":70,"line":26},[803],{"type":32,"tag":68,"props":804,"children":805},{"style":91},[806],{"type":37,"value":807},"      value: metric.value,\n",{"type":32,"tag":68,"props":809,"children":810},{"class":70,"line":229},[811],{"type":32,"tag":68,"props":812,"children":813},{"style":91},[814],{"type":37,"value":815},"      id: metric.id,\n",{"type":32,"tag":68,"props":817,"children":818},{"class":70,"line":242},[819],{"type":32,"tag":68,"props":820,"children":821},{"style":91},[822],{"type":37,"value":823},"      rating: metric.rating,\n",{"type":32,"tag":68,"props":825,"children":826},{"class":70,"line":260},[827],{"type":32,"tag":68,"props":828,"children":829},{"style":91},[830],{"type":37,"value":831},"      navigationType: metric.navigationType\n",{"type":32,"tag":68,"props":833,"children":834},{"class":70,"line":282},[835],{"type":32,"tag":68,"props":836,"children":837},{"style":91},[838],{"type":37,"value":839},"    }),\n",{"type":32,"tag":68,"props":841,"children":842},{"class":70,"line":303},[843,848,853,857,862],{"type":32,"tag":68,"props":844,"children":845},{"style":91},[846],{"type":37,"value":847},"    headers: { ",{"type":32,"tag":68,"props":849,"children":850},{"style":97},[851],{"type":37,"value":852},"'Content-Type'",{"type":32,"tag":68,"props":854,"children":855},{"style":91},[856],{"type":37,"value":94},{"type":32,"tag":68,"props":858,"children":859},{"style":97},[860],{"type":37,"value":861},"'application\u002Fjson'",{"type":32,"tag":68,"props":863,"children":864},{"style":91},[865],{"type":37,"value":866}," },\n",{"type":32,"tag":68,"props":868,"children":869},{"class":70,"line":324},[870,875],{"type":32,"tag":68,"props":871,"children":872},{"style":91},[873],{"type":37,"value":874},"    keepalive: ",{"type":32,"tag":68,"props":876,"children":877},{"style":107},[878],{"type":37,"value":879},"true\n",{"type":32,"tag":68,"props":881,"children":882},{"class":70,"line":345},[883],{"type":32,"tag":68,"props":884,"children":885},{"style":91},[886],{"type":37,"value":887},"  });\n",{"type":32,"tag":68,"props":889,"children":890},{"class":70,"line":358},[891],{"type":32,"tag":68,"props":892,"children":893},{"style":91},[894],{"type":37,"value":618},{"type":32,"tag":68,"props":896,"children":898},{"class":70,"line":897},18,[899],{"type":32,"tag":68,"props":900,"children":901},{"emptyLinePlaceholder":691},[902],{"type":37,"value":694},{"type":32,"tag":68,"props":904,"children":906},{"class":70,"line":905},19,[907,912],{"type":32,"tag":68,"props":908,"children":909},{"style":705},[910],{"type":37,"value":911},"onCLS",{"type":32,"tag":68,"props":913,"children":914},{"style":91},[915],{"type":37,"value":916},"(sendToAnalytics);\n",{"type":32,"tag":68,"props":918,"children":920},{"class":70,"line":919},20,[921,926],{"type":32,"tag":68,"props":922,"children":923},{"style":705},[924],{"type":37,"value":925},"onFID",{"type":32,"tag":68,"props":927,"children":928},{"style":91},[929],{"type":37,"value":916},{"type":32,"tag":68,"props":931,"children":933},{"class":70,"line":932},21,[934,939],{"type":32,"tag":68,"props":935,"children":936},{"style":705},[937],{"type":37,"value":938},"onLCP",{"type":32,"tag":68,"props":940,"children":941},{"style":91},[942],{"type":37,"value":916},{"type":32,"tag":68,"props":944,"children":946},{"class":70,"line":945},22,[947,952],{"type":32,"tag":68,"props":948,"children":949},{"style":705},[950],{"type":37,"value":951},"onTTFB",{"type":32,"tag":68,"props":953,"children":954},{"style":91},[955],{"type":37,"value":916},{"type":32,"tag":33,"props":957,"children":958},{},[959],{"type":37,"value":960},"Questo codice invia i Core Web Vitals al backend a ogni caricamento pagina. Il backend (ad esempio Cloudflare Workers) può scrivere questi dati in BigQuery:",{"type":32,"tag":57,"props":962,"children":964},{"code":963,"language":643,"meta":16,"className":644,"style":16},"\u002F\u002F workers\u002FwebVitalsCollector.js\nexport default {\n  async fetch(request, env) {\n    if (request.method !== 'POST') return new Response('Method not allowed', { status: 405 });\n\n    const data = await request.json();\n    const row = {\n      timestamp: Date.now(),\n      metric: data.name,\n      value: data.value,\n      rating: data.rating,\n      userAgent: request.headers.get('User-Agent'),\n      country: request.cf.country\n    };\n\n    await env.BQ.insert('web_vitals', row); \u002F\u002F BigQuery binding\n    return new Response('OK', { status: 200 });\n  }\n};\n",[965],{"type":32,"tag":64,"props":966,"children":967},{"__ignoreMap":16},[968,976,994,1030,1097,1104,1141,1161,1179,1187,1195,1203,1230,1238,1246,1253,1299,1337,1344],{"type":32,"tag":68,"props":969,"children":970},{"class":70,"line":71},[971],{"type":32,"tag":68,"props":972,"children":973},{"style":75},[974],{"type":37,"value":975},"\u002F\u002F workers\u002FwebVitalsCollector.js\n",{"type":32,"tag":68,"props":977,"children":978},{"class":70,"line":81},[979,984,989],{"type":32,"tag":68,"props":980,"children":981},{"style":662},[982],{"type":37,"value":983},"export",{"type":32,"tag":68,"props":985,"children":986},{"style":662},[987],{"type":37,"value":988}," default",{"type":32,"tag":68,"props":990,"children":991},{"style":91},[992],{"type":37,"value":993}," {\n",{"type":32,"tag":68,"props":995,"children":996},{"class":70,"line":103},[997,1002,1007,1011,1016,1021,1026],{"type":32,"tag":68,"props":998,"children":999},{"style":662},[1000],{"type":37,"value":1001},"  async",{"type":32,"tag":68,"props":1003,"children":1004},{"style":705},[1005],{"type":37,"value":1006}," fetch",{"type":32,"tag":68,"props":1008,"children":1009},{"style":91},[1010],{"type":37,"value":713},{"type":32,"tag":68,"props":1012,"children":1013},{"style":716},[1014],{"type":37,"value":1015},"request",{"type":32,"tag":68,"props":1017,"children":1018},{"style":91},[1019],{"type":37,"value":1020},", ",{"type":32,"tag":68,"props":1022,"children":1023},{"style":716},[1024],{"type":37,"value":1025},"env",{"type":32,"tag":68,"props":1027,"children":1028},{"style":91},[1029],{"type":37,"value":724},{"type":32,"tag":68,"props":1031,"children":1032},{"class":70,"line":128},[1033,1038,1043,1048,1053,1058,1063,1068,1073,1077,1082,1087,1092],{"type":32,"tag":68,"props":1034,"children":1035},{"style":662},[1036],{"type":37,"value":1037},"    if",{"type":32,"tag":68,"props":1039,"children":1040},{"style":91},[1041],{"type":37,"value":1042}," (request.method ",{"type":32,"tag":68,"props":1044,"children":1045},{"style":662},[1046],{"type":37,"value":1047},"!==",{"type":32,"tag":68,"props":1049,"children":1050},{"style":97},[1051],{"type":37,"value":1052}," 'POST'",{"type":32,"tag":68,"props":1054,"children":1055},{"style":91},[1056],{"type":37,"value":1057},") ",{"type":32,"tag":68,"props":1059,"children":1060},{"style":662},[1061],{"type":37,"value":1062},"return",{"type":32,"tag":68,"props":1064,"children":1065},{"style":662},[1066],{"type":37,"value":1067}," new",{"type":32,"tag":68,"props":1069,"children":1070},{"style":705},[1071],{"type":37,"value":1072}," Response",{"type":32,"tag":68,"props":1074,"children":1075},{"style":91},[1076],{"type":37,"value":713},{"type":32,"tag":68,"props":1078,"children":1079},{"style":97},[1080],{"type":37,"value":1081},"'Method not allowed'",{"type":32,"tag":68,"props":1083,"children":1084},{"style":91},[1085],{"type":37,"value":1086},", { status: ",{"type":32,"tag":68,"props":1088,"children":1089},{"style":107},[1090],{"type":37,"value":1091},"405",{"type":32,"tag":68,"props":1093,"children":1094},{"style":91},[1095],{"type":37,"value":1096}," });\n",{"type":32,"tag":68,"props":1098,"children":1099},{"class":70,"line":142},[1100],{"type":32,"tag":68,"props":1101,"children":1102},{"emptyLinePlaceholder":691},[1103],{"type":37,"value":694},{"type":32,"tag":68,"props":1105,"children":1106},{"class":70,"line":155},[1107,1112,1117,1122,1127,1132,1136],{"type":32,"tag":68,"props":1108,"children":1109},{"style":662},[1110],{"type":37,"value":1111},"    const",{"type":32,"tag":68,"props":1113,"children":1114},{"style":107},[1115],{"type":37,"value":1116}," data",{"type":32,"tag":68,"props":1118,"children":1119},{"style":662},[1120],{"type":37,"value":1121}," =",{"type":32,"tag":68,"props":1123,"children":1124},{"style":662},[1125],{"type":37,"value":1126}," await",{"type":32,"tag":68,"props":1128,"children":1129},{"style":91},[1130],{"type":37,"value":1131}," request.",{"type":32,"tag":68,"props":1133,"children":1134},{"style":705},[1135],{"type":37,"value":390},{"type":32,"tag":68,"props":1137,"children":1138},{"style":91},[1139],{"type":37,"value":1140},"();\n",{"type":32,"tag":68,"props":1142,"children":1143},{"class":70,"line":173},[1144,1148,1153,1157],{"type":32,"tag":68,"props":1145,"children":1146},{"style":662},[1147],{"type":37,"value":1111},{"type":32,"tag":68,"props":1149,"children":1150},{"style":107},[1151],{"type":37,"value":1152}," row",{"type":32,"tag":68,"props":1154,"children":1155},{"style":662},[1156],{"type":37,"value":1121},{"type":32,"tag":68,"props":1158,"children":1159},{"style":91},[1160],{"type":37,"value":993},{"type":32,"tag":68,"props":1162,"children":1163},{"class":70,"line":186},[1164,1169,1174],{"type":32,"tag":68,"props":1165,"children":1166},{"style":91},[1167],{"type":37,"value":1168},"      timestamp: Date.",{"type":32,"tag":68,"props":1170,"children":1171},{"style":705},[1172],{"type":37,"value":1173},"now",{"type":32,"tag":68,"props":1175,"children":1176},{"style":91},[1177],{"type":37,"value":1178},"(),\n",{"type":32,"tag":68,"props":1180,"children":1181},{"class":70,"line":26},[1182],{"type":32,"tag":68,"props":1183,"children":1184},{"style":91},[1185],{"type":37,"value":1186},"      metric: data.name,\n",{"type":32,"tag":68,"props":1188,"children":1189},{"class":70,"line":229},[1190],{"type":32,"tag":68,"props":1191,"children":1192},{"style":91},[1193],{"type":37,"value":1194},"      value: data.value,\n",{"type":32,"tag":68,"props":1196,"children":1197},{"class":70,"line":242},[1198],{"type":32,"tag":68,"props":1199,"children":1200},{"style":91},[1201],{"type":37,"value":1202},"      rating: data.rating,\n",{"type":32,"tag":68,"props":1204,"children":1205},{"class":70,"line":260},[1206,1211,1216,1220,1225],{"type":32,"tag":68,"props":1207,"children":1208},{"style":91},[1209],{"type":37,"value":1210},"      userAgent: request.headers.",{"type":32,"tag":68,"props":1212,"children":1213},{"style":705},[1214],{"type":37,"value":1215},"get",{"type":32,"tag":68,"props":1217,"children":1218},{"style":91},[1219],{"type":37,"value":713},{"type":32,"tag":68,"props":1221,"children":1222},{"style":97},[1223],{"type":37,"value":1224},"'User-Agent'",{"type":32,"tag":68,"props":1226,"children":1227},{"style":91},[1228],{"type":37,"value":1229},"),\n",{"type":32,"tag":68,"props":1231,"children":1232},{"class":70,"line":282},[1233],{"type":32,"tag":68,"props":1234,"children":1235},{"style":91},[1236],{"type":37,"value":1237},"      country: request.cf.country\n",{"type":32,"tag":68,"props":1239,"children":1240},{"class":70,"line":303},[1241],{"type":32,"tag":68,"props":1242,"children":1243},{"style":91},[1244],{"type":37,"value":1245},"    };\n",{"type":32,"tag":68,"props":1247,"children":1248},{"class":70,"line":324},[1249],{"type":32,"tag":68,"props":1250,"children":1251},{"emptyLinePlaceholder":691},[1252],{"type":37,"value":694},{"type":32,"tag":68,"props":1254,"children":1255},{"class":70,"line":345},[1256,1261,1266,1271,1275,1280,1284,1289,1294],{"type":32,"tag":68,"props":1257,"children":1258},{"style":662},[1259],{"type":37,"value":1260},"    await",{"type":32,"tag":68,"props":1262,"children":1263},{"style":91},[1264],{"type":37,"value":1265}," env.",{"type":32,"tag":68,"props":1267,"children":1268},{"style":107},[1269],{"type":37,"value":1270},"BQ",{"type":32,"tag":68,"props":1272,"children":1273},{"style":91},[1274],{"type":37,"value":781},{"type":32,"tag":68,"props":1276,"children":1277},{"style":705},[1278],{"type":37,"value":1279},"insert",{"type":32,"tag":68,"props":1281,"children":1282},{"style":91},[1283],{"type":37,"value":713},{"type":32,"tag":68,"props":1285,"children":1286},{"style":97},[1287],{"type":37,"value":1288},"'web_vitals'",{"type":32,"tag":68,"props":1290,"children":1291},{"style":91},[1292],{"type":37,"value":1293},", row); ",{"type":32,"tag":68,"props":1295,"children":1296},{"style":75},[1297],{"type":37,"value":1298},"\u002F\u002F BigQuery binding\n",{"type":32,"tag":68,"props":1300,"children":1301},{"class":70,"line":358},[1302,1307,1311,1315,1319,1324,1328,1333],{"type":32,"tag":68,"props":1303,"children":1304},{"style":662},[1305],{"type":37,"value":1306},"    return",{"type":32,"tag":68,"props":1308,"children":1309},{"style":662},[1310],{"type":37,"value":1067},{"type":32,"tag":68,"props":1312,"children":1313},{"style":705},[1314],{"type":37,"value":1072},{"type":32,"tag":68,"props":1316,"children":1317},{"style":91},[1318],{"type":37,"value":713},{"type":32,"tag":68,"props":1320,"children":1321},{"style":97},[1322],{"type":37,"value":1323},"'OK'",{"type":32,"tag":68,"props":1325,"children":1326},{"style":91},[1327],{"type":37,"value":1086},{"type":32,"tag":68,"props":1329,"children":1330},{"style":107},[1331],{"type":37,"value":1332},"200",{"type":32,"tag":68,"props":1334,"children":1335},{"style":91},[1336],{"type":37,"value":1096},{"type":32,"tag":68,"props":1338,"children":1339},{"class":70,"line":897},[1340],{"type":32,"tag":68,"props":1341,"children":1342},{"style":91},[1343],{"type":37,"value":610},{"type":32,"tag":68,"props":1345,"children":1346},{"class":70,"line":905},[1347],{"type":32,"tag":68,"props":1348,"children":1349},{"style":91},[1350],{"type":37,"value":1351},"};\n",{"type":32,"tag":33,"props":1353,"children":1354},{},[1355],{"type":37,"value":1356},"In BigQuery, questi dati possono essere interrogati:",{"type":32,"tag":57,"props":1358,"children":1362},{"code":1359,"language":1360,"meta":16,"className":1361,"style":16},"SELECT\n  metric,\n  APPROX_QUANTILES(value, 100)[OFFSET(75)] AS p75,\n  COUNT(*) AS sample_count\nFROM web_vitals.raw_metrics\nWHERE timestamp >= UNIX_MILLIS(TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY))\nGROUP BY metric;\n","sql","language-sql shiki shiki-themes github-dark",[1363],{"type":32,"tag":64,"props":1364,"children":1365},{"__ignoreMap":16},[1366,1374,1382,1419,1449,1471,1519],{"type":32,"tag":68,"props":1367,"children":1368},{"class":70,"line":71},[1369],{"type":32,"tag":68,"props":1370,"children":1371},{"style":662},[1372],{"type":37,"value":1373},"SELECT\n",{"type":32,"tag":68,"props":1375,"children":1376},{"class":70,"line":81},[1377],{"type":32,"tag":68,"props":1378,"children":1379},{"style":91},[1380],{"type":37,"value":1381},"  metric,\n",{"type":32,"tag":68,"props":1383,"children":1384},{"class":70,"line":103},[1385,1390,1395,1399,1404,1409,1414],{"type":32,"tag":68,"props":1386,"children":1387},{"style":91},[1388],{"type":37,"value":1389},"  APPROX_QUANTILES(",{"type":32,"tag":68,"props":1391,"children":1392},{"style":662},[1393],{"type":37,"value":1394},"value",{"type":32,"tag":68,"props":1396,"children":1397},{"style":91},[1398],{"type":37,"value":1020},{"type":32,"tag":68,"props":1400,"children":1401},{"style":107},[1402],{"type":37,"value":1403},"100",{"type":32,"tag":68,"props":1405,"children":1406},{"style":91},[1407],{"type":37,"value":1408},")[OFFSET(75)] ",{"type":32,"tag":68,"props":1410,"children":1411},{"style":662},[1412],{"type":37,"value":1413},"AS",{"type":32,"tag":68,"props":1415,"children":1416},{"style":91},[1417],{"type":37,"value":1418}," p75,\n",{"type":32,"tag":68,"props":1420,"children":1421},{"class":70,"line":128},[1422,1427,1431,1436,1440,1444],{"type":32,"tag":68,"props":1423,"children":1424},{"style":107},[1425],{"type":37,"value":1426},"  COUNT",{"type":32,"tag":68,"props":1428,"children":1429},{"style":91},[1430],{"type":37,"value":713},{"type":32,"tag":68,"props":1432,"children":1433},{"style":662},[1434],{"type":37,"value":1435},"*",{"type":32,"tag":68,"props":1437,"children":1438},{"style":91},[1439],{"type":37,"value":1057},{"type":32,"tag":68,"props":1441,"children":1442},{"style":662},[1443],{"type":37,"value":1413},{"type":32,"tag":68,"props":1445,"children":1446},{"style":91},[1447],{"type":37,"value":1448}," sample_count\n",{"type":32,"tag":68,"props":1450,"children":1451},{"class":70,"line":142},[1452,1457,1462,1466],{"type":32,"tag":68,"props":1453,"children":1454},{"style":662},[1455],{"type":37,"value":1456},"FROM",{"type":32,"tag":68,"props":1458,"children":1459},{"style":107},[1460],{"type":37,"value":1461}," web_vitals",{"type":32,"tag":68,"props":1463,"children":1464},{"style":91},[1465],{"type":37,"value":781},{"type":32,"tag":68,"props":1467,"children":1468},{"style":107},[1469],{"type":37,"value":1470},"raw_metrics\n",{"type":32,"tag":68,"props":1472,"children":1473},{"class":70,"line":155},[1474,1479,1484,1489,1494,1499,1504,1509,1514],{"type":32,"tag":68,"props":1475,"children":1476},{"style":662},[1477],{"type":37,"value":1478},"WHERE",{"type":32,"tag":68,"props":1480,"children":1481},{"style":662},[1482],{"type":37,"value":1483}," timestamp",{"type":32,"tag":68,"props":1485,"children":1486},{"style":662},[1487],{"type":37,"value":1488}," >=",{"type":32,"tag":68,"props":1490,"children":1491},{"style":91},[1492],{"type":37,"value":1493}," UNIX_MILLIS(TIMESTAMP_SUB(",{"type":32,"tag":68,"props":1495,"children":1496},{"style":107},[1497],{"type":37,"value":1498},"CURRENT_TIMESTAMP",{"type":32,"tag":68,"props":1500,"children":1501},{"style":91},[1502],{"type":37,"value":1503},"(), INTERVAL ",{"type":32,"tag":68,"props":1505,"children":1506},{"style":107},[1507],{"type":37,"value":1508},"7",{"type":32,"tag":68,"props":1510,"children":1511},{"style":662},[1512],{"type":37,"value":1513}," DAY",{"type":32,"tag":68,"props":1515,"children":1516},{"style":91},[1517],{"type":37,"value":1518},"))\n",{"type":32,"tag":68,"props":1520,"children":1521},{"class":70,"line":173},[1522,1527],{"type":32,"tag":68,"props":1523,"children":1524},{"style":662},[1525],{"type":37,"value":1526},"GROUP BY",{"type":32,"tag":68,"props":1528,"children":1529},{"style":91},[1530],{"type":37,"value":1531}," metric;\n",{"type":32,"tag":33,"props":1533,"children":1534},{},[1535],{"type":37,"value":1536},"Il P75 (75° percentile) è il benchmark ufficiale dei Core Web Vitals—Google assegna i punteggi in base a questo percentile. Questa query restituisce dati reali di production, non l'ambiente di laboratorio di Lighthouse CI.",{"type":32,"tag":1538,"props":1539,"children":1541},"h3",{"id":1540},"trade-off-tra-rum-e-lighthouse-ci",[1542],{"type":37,"value":1543},"Trade-off tra RUM e Lighthouse CI",{"type":32,"tag":33,"props":1545,"children":1546},{},[1547],{"type":37,"value":1548},"Lighthouse CI è deterministico, ripetibile—scansionando lo stesso codice otterrai lo stesso risultato. RUM è rumoroso—il 5% degli utenti usa connessioni 3G, il 10% dispositivi Android vecchi, queste metriche mostrano dispersione. Ma RUM mostra il mondo reale, CI mostra il laboratorio. Usarli insieme è critico: CI blocca la regressione, RUM misura l'impatto commerciale.",{"type":32,"tag":33,"props":1550,"children":1551},{},[1552,1554,1563],{"type":37,"value":1553},"Ad esempio, LCP potrebbe essere 2,1 secondi in Lighthouse CI, ma P75 in production RUM potrebbe essere 3,2 secondi—perché il 30% degli utenti reali usa reti mobili, il laboratorio ha fiber. Questa discrepanza è particolarmente evidente nei progetti ",{"type":32,"tag":1555,"props":1556,"children":1560},"a",{"href":1557,"rel":1558},"https:\u002F\u002Fwww.roibase.com.tr\u002Fit\u002Fheadless",[1559],"nofollow",[1561],{"type":37,"value":1562},"Headless Commerce",{"type":37,"value":1564},": il rendering edge mostra 1,8 secondi di LCP nel laboratorio, ma in production con cache miss del CDN può raggiungere 4 secondi.",{"type":32,"tag":40,"props":1566,"children":1568},{"id":1567},"allarme-di-regressione-quale-metrica-a-quale-soglia",[1569],{"type":37,"value":1570},"Allarme di Regressione: Quale Metrica a Quale Soglia",{"type":32,"tag":33,"props":1572,"children":1573},{},[1574],{"type":37,"value":1575},"Per rilevare la regressione di performance serve una metrica di baseline. Il baseline potrebbe essere la media del P75 degli ultimi 7 giorni:",{"type":32,"tag":57,"props":1577,"children":1579},{"code":1578,"language":1360,"meta":16,"className":1361,"style":16},"-- BigQuery scheduled query: eseguita ogni giorno, aggiorna la tabella di allarme\nCREATE OR REPLACE TABLE web_vitals.baseline AS\nSELECT\n  metric,\n  APPROX_QUANTILES(value, 100)[OFFSET(75)] AS baseline_p75\nFROM web_vitals.raw_metrics\nWHERE timestamp >= UNIX_MILLIS(TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY))\nGROUP BY metric;\n",[1580],{"type":32,"tag":64,"props":1581,"children":1582},{"__ignoreMap":16},[1583,1591,1618,1625,1632,1664,1683,1722],{"type":32,"tag":68,"props":1584,"children":1585},{"class":70,"line":71},[1586],{"type":32,"tag":68,"props":1587,"children":1588},{"style":75},[1589],{"type":37,"value":1590},"-- BigQuery scheduled query: eseguita ogni giorno, aggiorna la tabella di allarme\n",{"type":32,"tag":68,"props":1592,"children":1593},{"class":70,"line":81},[1594,1599,1604,1608,1613],{"type":32,"tag":68,"props":1595,"children":1596},{"style":662},[1597],{"type":37,"value":1598},"CREATE OR REPLACE",{"type":32,"tag":68,"props":1600,"children":1601},{"style":662},[1602],{"type":37,"value":1603}," TABLE",{"type":32,"tag":68,"props":1605,"children":1606},{"style":705},[1607],{"type":37,"value":1461},{"type":32,"tag":68,"props":1609,"children":1610},{"style":91},[1611],{"type":37,"value":1612},".baseline ",{"type":32,"tag":68,"props":1614,"children":1615},{"style":662},[1616],{"type":37,"value":1617},"AS\n",{"type":32,"tag":68,"props":1619,"children":1620},{"class":70,"line":103},[1621],{"type":32,"tag":68,"props":1622,"children":1623},{"style":662},[1624],{"type":37,"value":1373},{"type":32,"tag":68,"props":1626,"children":1627},{"class":70,"line":128},[1628],{"type":32,"tag":68,"props":1629,"children":1630},{"style":91},[1631],{"type":37,"value":1381},{"type":32,"tag":68,"props":1633,"children":1634},{"class":70,"line":142},[1635,1639,1643,1647,1651,1655,1659],{"type":32,"tag":68,"props":1636,"children":1637},{"style":91},[1638],{"type":37,"value":1389},{"type":32,"tag":68,"props":1640,"children":1641},{"style":662},[1642],{"type":37,"value":1394},{"type":32,"tag":68,"props":1644,"children":1645},{"style":91},[1646],{"type":37,"value":1020},{"type":32,"tag":68,"props":1648,"children":1649},{"style":107},[1650],{"type":37,"value":1403},{"type":32,"tag":68,"props":1652,"children":1653},{"style":91},[1654],{"type":37,"value":1408},{"type":32,"tag":68,"props":1656,"children":1657},{"style":662},[1658],{"type":37,"value":1413},{"type":32,"tag":68,"props":1660,"children":1661},{"style":91},[1662],{"type":37,"value":1663}," baseline_p75\n",{"type":32,"tag":68,"props":1665,"children":1666},{"class":70,"line":155},[1667,1671,1675,1679],{"type":32,"tag":68,"props":1668,"children":1669},{"style":662},[1670],{"type":37,"value":1456},{"type":32,"tag":68,"props":1672,"children":1673},{"style":107},[1674],{"type":37,"value":1461},{"type":32,"tag":68,"props":1676,"children":1677},{"style":91},[1678],{"type":37,"value":781},{"type":32,"tag":68,"props":1680,"children":1681},{"style":107},[1682],{"type":37,"value":1470},{"type":32,"tag":68,"props":1684,"children":1685},{"class":70,"line":173},[1686,1690,1694,1698,1702,1706,1710,1714,1718],{"type":32,"tag":68,"props":1687,"children":1688},{"style":662},[1689],{"type":37,"value":1478},{"type":32,"tag":68,"props":1691,"children":1692},{"style":662},[1693],{"type":37,"value":1483},{"type":32,"tag":68,"props":1695,"children":1696},{"style":662},[1697],{"type":37,"value":1488},{"type":32,"tag":68,"props":1699,"children":1700},{"style":91},[1701],{"type":37,"value":1493},{"type":32,"tag":68,"props":1703,"children":1704},{"style":107},[1705],{"type":37,"value":1498},{"type":32,"tag":68,"props":1707,"children":1708},{"style":91},[1709],{"type":37,"value":1503},{"type":32,"tag":68,"props":1711,"children":1712},{"style":107},[1713],{"type":37,"value":1508},{"type":32,"tag":68,"props":1715,"children":1716},{"style":662},[1717],{"type":37,"value":1513},{"type":32,"tag":68,"props":1719,"children":1720},{"style":91},[1721],{"type":37,"value":1518},{"type":32,"tag":68,"props":1723,"children":1724},{"class":70,"line":186},[1725,1729],{"type":32,"tag":68,"props":1726,"children":1727},{"style":662},[1728],{"type":37,"value":1526},{"type":32,"tag":68,"props":1730,"children":1731},{"style":91},[1732],{"type":37,"value":1531},{"type":32,"tag":33,"props":1734,"children":1735},{},[1736],{"type":37,"value":1737},"Poi, elaborando il flusso in tempo reale, generare allarmi se la deviazione supera il 10%:",{"type":32,"tag":57,"props":1739,"children":1741},{"code":1740,"language":643,"meta":16,"className":644,"style":16},"\u002F\u002F Cloudflare Durable Objects: handler di allarme con stato\nexport class PerfAlarmState {\n  constructor(state, env) {\n    this.state = state;\n    this.env = env;\n  }\n\n  async fetch(request) {\n    const { metric, currentP75 } = await request.json();\n    const baseline = await this.env.BQ.query(`SELECT baseline_p75 FROM baseline WHERE metric='${metric}'`);\n    \n    const threshold = baseline * 1.10; \u002F\u002F 10% regressione\n    if (currentP75 > threshold) {\n      await fetch(this.env.SLACK_WEBHOOK_URL, {\n        method: 'POST',\n        body: JSON.stringify({\n          text: `🚨 Performance regression: ${metric} P75 ${currentP75}ms (baseline ${baseline}ms, +${((currentP75\u002Fbaseline - 1)*100).toFixed(1)}%)`\n        })\n      });\n    }\n    return new Response('Checked');\n  }\n}\n",[1742],{"type":32,"tag":64,"props":1743,"children":1744},{"__ignoreMap":16},[1745,1753,1774,1803,1826,1847,1854,1861,1884,1934,2000,2008,2048,2070,2104,2120,2144,2254,2262,2270,2277,2305,2312],{"type":32,"tag":68,"props":1746,"children":1747},{"class":70,"line":71},[1748],{"type":32,"tag":68,"props":1749,"children":1750},{"style":75},[1751],{"type":37,"value":1752},"\u002F\u002F Cloudflare Durable Objects: handler di allarme con stato\n",{"type":32,"tag":68,"props":1754,"children":1755},{"class":70,"line":81},[1756,1760,1765,1770],{"type":32,"tag":68,"props":1757,"children":1758},{"style":662},[1759],{"type":37,"value":983},{"type":32,"tag":68,"props":1761,"children":1762},{"style":662},[1763],{"type":37,"value":1764}," class",{"type":32,"tag":68,"props":1766,"children":1767},{"style":705},[1768],{"type":37,"value":1769}," PerfAlarmState",{"type":32,"tag":68,"props":1771,"children":1772},{"style":91},[1773],{"type":37,"value":993},{"type":32,"tag":68,"props":1775,"children":1776},{"class":70,"line":103},[1777,1782,1786,1791,1795,1799],{"type":32,"tag":68,"props":1778,"children":1779},{"style":662},[1780],{"type":37,"value":1781},"  constructor",{"type":32,"tag":68,"props":1783,"children":1784},{"style":91},[1785],{"type":37,"value":713},{"type":32,"tag":68,"props":1787,"children":1788},{"style":716},[1789],{"type":37,"value":1790},"state",{"type":32,"tag":68,"props":1792,"children":1793},{"style":91},[1794],{"type":37,"value":1020},{"type":32,"tag":68,"props":1796,"children":1797},{"style":716},[1798],{"type":37,"value":1025},{"type":32,"tag":68,"props":1800,"children":1801},{"style":91},[1802],{"type":37,"value":724},{"type":32,"tag":68,"props":1804,"children":1805},{"class":70,"line":128},[1806,1811,1816,1821],{"type":32,"tag":68,"props":1807,"children":1808},{"style":107},[1809],{"type":37,"value":1810},"    this",{"type":32,"tag":68,"props":1812,"children":1813},{"style":91},[1814],{"type":37,"value":1815},".state ",{"type":32,"tag":68,"props":1817,"children":1818},{"style":662},[1819],{"type":37,"value":1820},"=",{"type":32,"tag":68,"props":1822,"children":1823},{"style":91},[1824],{"type":37,"value":1825}," state;\n",{"type":32,"tag":68,"props":1827,"children":1828},{"class":70,"line":142},[1829,1833,1838,1842],{"type":32,"tag":68,"props":1830,"children":1831},{"style":107},[1832],{"type":37,"value":1810},{"type":32,"tag":68,"props":1834,"children":1835},{"style":91},[1836],{"type":37,"value":1837},".env ",{"type":32,"tag":68,"props":1839,"children":1840},{"style":662},[1841],{"type":37,"value":1820},{"type":32,"tag":68,"props":1843,"children":1844},{"style":91},[1845],{"type":37,"value":1846}," env;\n",{"type":32,"tag":68,"props":1848,"children":1849},{"class":70,"line":155},[1850],{"type":32,"tag":68,"props":1851,"children":1852},{"style":91},[1853],{"type":37,"value":610},{"type":32,"tag":68,"props":1855,"children":1856},{"class":70,"line":173},[1857],{"type":32,"tag":68,"props":1858,"children":1859},{"emptyLinePlaceholder":691},[1860],{"type":37,"value":694},{"type":32,"tag":68,"props":1862,"children":1863},{"class":70,"line":186},[1864,1868,1872,1876,1880],{"type":32,"tag":68,"props":1865,"children":1866},{"style":662},[1867],{"type":37,"value":1001},{"type":32,"tag":68,"props":1869,"children":1870},{"style":705},[1871],{"type":37,"value":1006},{"type":32,"tag":68,"props":1873,"children":1874},{"style":91},[1875],{"type":37,"value":713},{"type":32,"tag":68,"props":1877,"children":1878},{"style":716},[1879],{"type":37,"value":1015},{"type":32,"tag":68,"props":1881,"children":1882},{"style":91},[1883],{"type":37,"value":724},{"type":32,"tag":68,"props":1885,"children":1886},{"class":70,"line":26},[1887,1891,1896,1900,1904,1909,1914,1918,1922,1926,1930],{"type":32,"tag":68,"props":1888,"children":1889},{"style":662},[1890],{"type":37,"value":1111},{"type":32,"tag":68,"props":1892,"children":1893},{"style":91},[1894],{"type":37,"value":1895}," { ",{"type":32,"tag":68,"props":1897,"children":1898},{"style":107},[1899],{"type":37,"value":719},{"type":32,"tag":68,"props":1901,"children":1902},{"style":91},[1903],{"type":37,"value":1020},{"type":32,"tag":68,"props":1905,"children":1906},{"style":107},[1907],{"type":37,"value":1908},"currentP75",{"type":32,"tag":68,"props":1910,"children":1911},{"style":91},[1912],{"type":37,"value":1913}," } ",{"type":32,"tag":68,"props":1915,"children":1916},{"style":662},[1917],{"type":37,"value":1820},{"type":32,"tag":68,"props":1919,"children":1920},{"style":662},[1921],{"type":37,"value":1126},{"type":32,"tag":68,"props":1923,"children":1924},{"style":91},[1925],{"type":37,"value":1131},{"type":32,"tag":68,"props":1927,"children":1928},{"style":705},[1929],{"type":37,"value":390},{"type":32,"tag":68,"props":1931,"children":1932},{"style":91},[1933],{"type":37,"value":1140},{"type":32,"tag":68,"props":1935,"children":1936},{"class":70,"line":229},[1937,1941,1946,1950,1954,1959,1964,1968,1972,1977,1981,1986,1990,1995],{"type":32,"tag":68,"props":1938,"children":1939},{"style":662},[1940],{"type":37,"value":1111},{"type":32,"tag":68,"props":1942,"children":1943},{"style":107},[1944],{"type":37,"value":1945}," baseline",{"type":32,"tag":68,"props":1947,"children":1948},{"style":662},[1949],{"type":37,"value":1121},{"type":32,"tag":68,"props":1951,"children":1952},{"style":662},[1953],{"type":37,"value":1126},{"type":32,"tag":68,"props":1955,"children":1956},{"style":107},[1957],{"type":37,"value":1958}," this",{"type":32,"tag":68,"props":1960,"children":1961},{"style":91},[1962],{"type":37,"value":1963},".env.",{"type":32,"tag":68,"props":1965,"children":1966},{"style":107},[1967],{"type":37,"value":1270},{"type":32,"tag":68,"props":1969,"children":1970},{"style":91},[1971],{"type":37,"value":781},{"type":32,"tag":68,"props":1973,"children":1974},{"style":705},[1975],{"type":37,"value":1976},"query",{"type":32,"tag":68,"props":1978,"children":1979},{"style":91},[1980],{"type":37,"value":713},{"type":32,"tag":68,"props":1982,"children":1983},{"style":97},[1984],{"type":37,"value":1985},"`SELECT baseline_p75 FROM baseline WHERE metric='${",{"type":32,"tag":68,"props":1987,"children":1988},{"style":91},[1989],{"type":37,"value":719},{"type":32,"tag":68,"props":1991,"children":1992},{"style":97},[1993],{"type":37,"value":1994},"}'`",{"type":32,"tag":68,"props":1996,"children":1997},{"style":91},[1998],{"type":37,"value":1999},");\n",{"type":32,"tag":68,"props":2001,"children":2002},{"class":70,"line":242},[2003],{"type":32,"tag":68,"props":2004,"children":2005},{"style":91},[2006],{"type":37,"value":2007},"    \n",{"type":32,"tag":68,"props":2009,"children":2010},{"class":70,"line":260},[2011,2015,2020,2024,2029,2033,2038,2043],{"type":32,"tag":68,"props":2012,"children":2013},{"style":662},[2014],{"type":37,"value":1111},{"type":32,"tag":68,"props":2016,"children":2017},{"style":107},[2018],{"type":37,"value":2019}," threshold",{"type":32,"tag":68,"props":2021,"children":2022},{"style":662},[2023],{"type":37,"value":1121},{"type":32,"tag":68,"props":2025,"children":2026},{"style":91},[2027],{"type":37,"value":2028}," baseline ",{"type":32,"tag":68,"props":2030,"children":2031},{"style":662},[2032],{"type":37,"value":1435},{"type":32,"tag":68,"props":2034,"children":2035},{"style":107},[2036],{"type":37,"value":2037}," 1.10",{"type":32,"tag":68,"props":2039,"children":2040},{"style":91},[2041],{"type":37,"value":2042},"; ",{"type":32,"tag":68,"props":2044,"children":2045},{"style":75},[2046],{"type":37,"value":2047},"\u002F\u002F 10% regressione\n",{"type":32,"tag":68,"props":2049,"children":2050},{"class":70,"line":282},[2051,2055,2060,2065],{"type":32,"tag":68,"props":2052,"children":2053},{"style":662},[2054],{"type":37,"value":1037},{"type":32,"tag":68,"props":2056,"children":2057},{"style":91},[2058],{"type":37,"value":2059}," (currentP75 ",{"type":32,"tag":68,"props":2061,"children":2062},{"style":662},[2063],{"type":37,"value":2064},">",{"type":32,"tag":68,"props":2066,"children":2067},{"style":91},[2068],{"type":37,"value":2069}," threshold) {\n",{"type":32,"tag":68,"props":2071,"children":2072},{"class":70,"line":303},[2073,2078,2082,2086,2091,2095,2100],{"type":32,"tag":68,"props":2074,"children":2075},{"style":662},[2076],{"type":37,"value":2077},"      await",{"type":32,"tag":68,"props":2079,"children":2080},{"style":705},[2081],{"type":37,"value":1006},{"type":32,"tag":68,"props":2083,"children":2084},{"style":91},[2085],{"type":37,"value":713},{"type":32,"tag":68,"props":2087,"children":2088},{"style":107},[2089],{"type":37,"value":2090},"this",{"type":32,"tag":68,"props":2092,"children":2093},{"style":91},[2094],{"type":37,"value":1963},{"type":32,"tag":68,"props":2096,"children":2097},{"style":107},[2098],{"type":37,"value":2099},"SLACK_WEBHOOK_URL",{"type":32,"tag":68,"props":2101,"children":2102},{"style":91},[2103],{"type":37,"value":746},{"type":32,"tag":68,"props":2105,"children":2106},{"class":70,"line":324},[2107,2112,2116],{"type":32,"tag":68,"props":2108,"children":2109},{"style":91},[2110],{"type":37,"value":2111},"        method: ",{"type":32,"tag":68,"props":2113,"children":2114},{"style":97},[2115],{"type":37,"value":759},{"type":32,"tag":68,"props":2117,"children":2118},{"style":91},[2119],{"type":37,"value":458},{"type":32,"tag":68,"props":2121,"children":2122},{"class":70,"line":345},[2123,2128,2132,2136,2140],{"type":32,"tag":68,"props":2124,"children":2125},{"style":91},[2126],{"type":37,"value":2127},"        body: ",{"type":32,"tag":68,"props":2129,"children":2130},{"style":107},[2131],{"type":37,"value":776},{"type":32,"tag":68,"props":2133,"children":2134},{"style":91},[2135],{"type":37,"value":781},{"type":32,"tag":68,"props":2137,"children":2138},{"style":705},[2139],{"type":37,"value":786},{"type":32,"tag":68,"props":2141,"children":2142},{"style":91},[2143],{"type":37,"value":791},{"type":32,"tag":68,"props":2145,"children":2146},{"class":70,"line":358},[2147,2152,2157,2161,2166,2170,2175,2180,2185,2190,2194,2199,2203,2208,2213,2218,2222,2226,2231,2236,2240,2245,2249],{"type":32,"tag":68,"props":2148,"children":2149},{"style":91},[2150],{"type":37,"value":2151},"          text: ",{"type":32,"tag":68,"props":2153,"children":2154},{"style":97},[2155],{"type":37,"value":2156},"`🚨 Performance regression: ${",{"type":32,"tag":68,"props":2158,"children":2159},{"style":91},[2160],{"type":37,"value":719},{"type":32,"tag":68,"props":2162,"children":2163},{"style":97},[2164],{"type":37,"value":2165},"} P75 ${",{"type":32,"tag":68,"props":2167,"children":2168},{"style":91},[2169],{"type":37,"value":1908},{"type":32,"tag":68,"props":2171,"children":2172},{"style":97},[2173],{"type":37,"value":2174},"}ms (baseline ${",{"type":32,"tag":68,"props":2176,"children":2177},{"style":91},[2178],{"type":37,"value":2179},"baseline",{"type":32,"tag":68,"props":2181,"children":2182},{"style":97},[2183],{"type":37,"value":2184},"}ms, +${",{"type":32,"tag":68,"props":2186,"children":2187},{"style":97},[2188],{"type":37,"value":2189},"((",{"type":32,"tag":68,"props":2191,"children":2192},{"style":91},[2193],{"type":37,"value":1908},{"type":32,"tag":68,"props":2195,"children":2196},{"style":662},[2197],{"type":37,"value":2198},"\u002F",{"type":32,"tag":68,"props":2200,"children":2201},{"style":91},[2202],{"type":37,"value":2179},{"type":32,"tag":68,"props":2204,"children":2205},{"style":662},[2206],{"type":37,"value":2207}," -",{"type":32,"tag":68,"props":2209,"children":2210},{"style":107},[2211],{"type":37,"value":2212}," 1",{"type":32,"tag":68,"props":2214,"children":2215},{"style":97},[2216],{"type":37,"value":2217},")",{"type":32,"tag":68,"props":2219,"children":2220},{"style":662},[2221],{"type":37,"value":1435},{"type":32,"tag":68,"props":2223,"children":2224},{"style":107},[2225],{"type":37,"value":1403},{"type":32,"tag":68,"props":2227,"children":2228},{"style":97},[2229],{"type":37,"value":2230},").",{"type":32,"tag":68,"props":2232,"children":2233},{"style":705},[2234],{"type":37,"value":2235},"toFixed",{"type":32,"tag":68,"props":2237,"children":2238},{"style":97},[2239],{"type":37,"value":713},{"type":32,"tag":68,"props":2241,"children":2242},{"style":107},[2243],{"type":37,"value":2244},"1",{"type":32,"tag":68,"props":2246,"children":2247},{"style":97},[2248],{"type":37,"value":2217},{"type":32,"tag":68,"props":2250,"children":2251},{"style":97},[2252],{"type":37,"value":2253},"}%)`\n",{"type":32,"tag":68,"props":2255,"children":2256},{"class":70,"line":897},[2257],{"type":32,"tag":68,"props":2258,"children":2259},{"style":91},[2260],{"type":37,"value":2261},"        })\n",{"type":32,"tag":68,"props":2263,"children":2264},{"class":70,"line":905},[2265],{"type":32,"tag":68,"props":2266,"children":2267},{"style":91},[2268],{"type":37,"value":2269},"      });\n",{"type":32,"tag":68,"props":2271,"children":2272},{"class":70,"line":919},[2273],{"type":32,"tag":68,"props":2274,"children":2275},{"style":91},[2276],{"type":37,"value":602},{"type":32,"tag":68,"props":2278,"children":2279},{"class":70,"line":932},[2280,2284,2288,2292,2296,2301],{"type":32,"tag":68,"props":2281,"children":2282},{"style":662},[2283],{"type":37,"value":1306},{"type":32,"tag":68,"props":2285,"children":2286},{"style":662},[2287],{"type":37,"value":1067},{"type":32,"tag":68,"props":2289,"children":2290},{"style":705},[2291],{"type":37,"value":1072},{"type":32,"tag":68,"props":2293,"children":2294},{"style":91},[2295],{"type":37,"value":713},{"type":32,"tag":68,"props":2297,"children":2298},{"style":97},[2299],{"type":37,"value":2300},"'Checked'",{"type":32,"tag":68,"props":2302,"children":2303},{"style":91},[2304],{"type":37,"value":1999},{"type":32,"tag":68,"props":2306,"children":2307},{"class":70,"line":945},[2308],{"type":32,"tag":68,"props":2309,"children":2310},{"style":91},[2311],{"type":37,"value":610},{"type":32,"tag":68,"props":2313,"children":2315},{"class":70,"line":2314},23,[2316],{"type":32,"tag":68,"props":2317,"children":2318},{"style":91},[2319],{"type":37,"value":618},{"type":32,"tag":33,"props":2321,"children":2322},{},[2323],{"type":37,"value":2324},"Questa architettura genera allarmi in tempo reale—la regressione può essere rilevata 5 minuti dopo il deployment. La decisione di rollback può essere presa istantaneamente. Scenario di esempio: un'ottimizzazione del bundle JavaScript riduce il LCP di 200ms nel laboratorio, ma aumenta il TBT (Total Blocking Time) di 400ms in production perché il costo di parsing è aumentato. L'allarme RUM cattura la regressione di TBT in 8 minuti, il deployment viene ritirato—solo il 2% degli utenti è stato esposto, il 98% non ha visto il nuovo codice. Senza l'allarme, tutti gli utenti avrebbero avuto un'esperienza lenta per 2 ore.",{"type":32,"tag":40,"props":2326,"children":2328},{"id":2327},"collegare-il-budget-al-revenue-attribution",[2329],{"type":37,"value":2330},"Collegare il Budget al Revenue: Attribution",{"type":32,"tag":33,"props":2332,"children":2333},{},[2334],{"type":37,"value":2335},"Per collegare la metrica di performance al revenue, occorrono test A\u002FB o analisi per coorte. Un approccio semplice: segmentare gli utenti per velocità di LCP.",{"type":32,"tag":57,"props":2337,"children":2339},{"code":2338,"language":1360,"meta":16,"className":1361,"style":16},"-- BigQuery: conversion rate per velocità LCP\nWITH metrics_with_sessions AS (\n  SELECT\n    session_id,\n    APPROX_QUANTILES(value, 100)[OFFSET(75)] AS lcp_p75\n  FROM web_vitals.raw_metrics\n  WHERE metric = 'LCP'\n  GROUP BY session_id\n),\nconversions AS (\n  SELECT\n    session_id,\n    SUM(revenue) AS revenue\n  FROM ecommerce.transactions\n  GROUP BY session_id\n)\nSELECT\n  CASE\n    WHEN lcp_p75 \u003C 2000 THEN 'fast'\n    WHEN lcp_p75 \u003C 3000 THEN 'moderate'\n    ELSE 'slow'\n  END AS speed_bucket,\n  COUNT(DISTINCT m.session_id) AS sessions,\n  COUNT(c.session_id) AS conversions,\n  SAFE_DIVIDE(COUNT(c.session_id), COUNT(DISTINCT m.session_id)) AS conversion_rate,\n  AVG(c.revenue) AS avg_order_value\nFROM metrics_with_sessions m\nLEFT JOIN conversions c USING(session_id)\nGROUP BY speed_bucket;\n",[2340],{"type":32,"tag":64,"props":2341,"children":2342},{"__ignoreMap":16},[2343,2351,2373,2381,2389,2422,2442,2464,2477,2484,2500,2507,2514,2536,2557,2568,2576,2583,2591,2624,2653,2666,2684,2731,2769,2842,2881,2894,2918],{"type":32,"tag":68,"props":2344,"children":2345},{"class":70,"line":71},[2346],{"type":32,"tag":68,"props":2347,"children":2348},{"style":75},[2349],{"type":37,"value":2350},"-- BigQuery: conversion rate per velocità LCP\n",{"type":32,"tag":68,"props":2352,"children":2353},{"class":70,"line":81},[2354,2359,2364,2368],{"type":32,"tag":68,"props":2355,"children":2356},{"style":662},[2357],{"type":37,"value":2358},"WITH",{"type":32,"tag":68,"props":2360,"children":2361},{"style":91},[2362],{"type":37,"value":2363}," metrics_with_sessions ",{"type":32,"tag":68,"props":2365,"children":2366},{"style":662},[2367],{"type":37,"value":1413},{"type":32,"tag":68,"props":2369,"children":2370},{"style":91},[2371],{"type":37,"value":2372}," (\n",{"type":32,"tag":68,"props":2374,"children":2375},{"class":70,"line":103},[2376],{"type":32,"tag":68,"props":2377,"children":2378},{"style":662},[2379],{"type":37,"value":2380},"  SELECT\n",{"type":32,"tag":68,"props":2382,"children":2383},{"class":70,"line":128},[2384],{"type":32,"tag":68,"props":2385,"children":2386},{"style":91},[2387],{"type":37,"value":2388},"    session_id,\n",{"type":32,"tag":68,"props":2390,"children":2391},{"class":70,"line":142},[2392,2397,2401,2405,2409,2413,2417],{"type":32,"tag":68,"props":2393,"children":2394},{"style":91},[2395],{"type":37,"value":2396},"    APPROX_QUANTILES(",{"type":32,"tag":68,"props":2398,"children":2399},{"style":662},[2400],{"type":37,"value":1394},{"type":32,"tag":68,"props":2402,"children":2403},{"style":91},[2404],{"type":37,"value":1020},{"type":32,"tag":68,"props":2406,"children":2407},{"style":107},[2408],{"type":37,"value":1403},{"type":32,"tag":68,"props":2410,"children":2411},{"style":91},[2412],{"type":37,"value":1408},{"type":32,"tag":68,"props":2414,"children":2415},{"style":662},[2416],{"type":37,"value":1413},{"type":32,"tag":68,"props":2418,"children":2419},{"style":91},[2420],{"type":37,"value":2421}," lcp_p75\n",{"type":32,"tag":68,"props":2423,"children":2424},{"class":70,"line":155},[2425,2430,2434,2438],{"type":32,"tag":68,"props":2426,"children":2427},{"style":662},[2428],{"type":37,"value":2429},"  FROM",{"type":32,"tag":68,"props":2431,"children":2432},{"style":107},[2433],{"type":37,"value":1461},{"type":32,"tag":68,"props":2435,"children":2436},{"style":91},[2437],{"type":37,"value":781},{"type":32,"tag":68,"props":2439,"children":2440},{"style":107},[2441],{"type":37,"value":1470},{"type":32,"tag":68,"props":2443,"children":2444},{"class":70,"line":173},[2445,2450,2455,2459],{"type":32,"tag":68,"props":2446,"children":2447},{"style":662},[2448],{"type":37,"value":2449},"  WHERE",{"type":32,"tag":68,"props":2451,"children":2452},{"style":91},[2453],{"type":37,"value":2454}," metric ",{"type":32,"tag":68,"props":2456,"children":2457},{"style":662},[2458],{"type":37,"value":1820},{"type":32,"tag":68,"props":2460,"children":2461},{"style":97},[2462],{"type":37,"value":2463}," 'LCP'\n",{"type":32,"tag":68,"props":2465,"children":2466},{"class":70,"line":186},[2467,2472],{"type":32,"tag":68,"props":2468,"children":2469},{"style":662},[2470],{"type":37,"value":2471},"  GROUP BY",{"type":32,"tag":68,"props":2473,"children":2474},{"style":91},[2475],{"type":37,"value":2476}," session_id\n",{"type":32,"tag":68,"props":2478,"children":2479},{"class":70,"line":26},[2480],{"type":32,"tag":68,"props":2481,"children":2482},{"style":91},[2483],{"type":37,"value":1229},{"type":32,"tag":68,"props":2485,"children":2486},{"class":70,"line":229},[2487,2492,2496],{"type":32,"tag":68,"props":2488,"children":2489},{"style":91},[2490],{"type":37,"value":2491},"conversions ",{"type":32,"tag":68,"props":2493,"children":2494},{"style":662},[2495],{"type":37,"value":1413},{"type":32,"tag":68,"props":2497,"children":2498},{"style":91},[2499],{"type":37,"value":2372},{"type":32,"tag":68,"props":2501,"children":2502},{"class":70,"line":242},[2503],{"type":32,"tag":68,"props":2504,"children":2505},{"style":662},[2506],{"type":37,"value":2380},{"type":32,"tag":68,"props":2508,"children":2509},{"class":70,"line":260},[2510],{"type":32,"tag":68,"props":2511,"children":2512},{"style":91},[2513],{"type":37,"value":2388},{"type":32,"tag":68,"props":2515,"children":2516},{"class":70,"line":282},[2517,2522,2527,2531],{"type":32,"tag":68,"props":2518,"children":2519},{"style":107},[2520],{"type":37,"value":2521},"    SUM",{"type":32,"tag":68,"props":2523,"children":2524},{"style":91},[2525],{"type":37,"value":2526},"(revenue) ",{"type":32,"tag":68,"props":2528,"children":2529},{"style":662},[2530],{"type":37,"value":1413},{"type":32,"tag":68,"props":2532,"children":2533},{"style":91},[2534],{"type":37,"value":2535}," revenue\n",{"type":32,"tag":68,"props":2537,"children":2538},{"class":70,"line":303},[2539,2543,2548,2552],{"type":32,"tag":68,"props":2540,"children":2541},{"style":662},[2542],{"type":37,"value":2429},{"type":32,"tag":68,"props":2544,"children":2545},{"style":107},[2546],{"type":37,"value":2547}," ecommerce",{"type":32,"tag":68,"props":2549,"children":2550},{"style":91},[2551],{"type":37,"value":781},{"type":32,"tag":68,"props":2553,"children":2554},{"style":107},[2555],{"type":37,"value":2556},"transactions\n",{"type":32,"tag":68,"props":2558,"children":2559},{"class":70,"line":324},[2560,2564],{"type":32,"tag":68,"props":2561,"children":2562},{"style":662},[2563],{"type":37,"value":2471},{"type":32,"tag":68,"props":2565,"children":2566},{"style":91},[2567],{"type":37,"value":2476},{"type":32,"tag":68,"props":2569,"children":2570},{"class":70,"line":345},[2571],{"type":32,"tag":68,"props":2572,"children":2573},{"style":91},[2574],{"type":37,"value":2575},")\n",{"type":32,"tag":68,"props":2577,"children":2578},{"class":70,"line":358},[2579],{"type":32,"tag":68,"props":2580,"children":2581},{"style":662},[2582],{"type":37,"value":1373},{"type":32,"tag":68,"props":2584,"children":2585},{"class":70,"line":897},[2586],{"type":32,"tag":68,"props":2587,"children":2588},{"style":662},[2589],{"type":37,"value":2590},"  CASE\n",{"type":32,"tag":68,"props":2592,"children":2593},{"class":70,"line":905},[2594,2599,2604,2609,2614,2619],{"type":32,"tag":68,"props":2595,"children":2596},{"style":662},[2597],{"type":37,"value":2598},"    WHEN",{"type":32,"tag":68,"props":2600,"children":2601},{"style":91},[2602],{"type":37,"value":2603}," lcp_p75 ",{"type":32,"tag":68,"props":2605,"children":2606},{"style":662},[2607],{"type":37,"value":2608},"\u003C",{"type":32,"tag":68,"props":2610,"children":2611},{"style":107},[2612],{"type":37,"value":2613}," 2000",{"type":32,"tag":68,"props":2615,"children":2616},{"style":662},[2617],{"type":37,"value":2618}," THEN",{"type":32,"tag":68,"props":2620,"children":2621},{"style":97},[2622],{"type":37,"value":2623}," 'fast'\n",{"type":32,"tag":68,"props":2625,"children":2626},{"class":70,"line":919},[2627,2631,2635,2639,2644,2648],{"type":32,"tag":68,"props":2628,"children":2629},{"style":662},[2630],{"type":37,"value":2598},{"type":32,"tag":68,"props":2632,"children":2633},{"style":91},[2634],{"type":37,"value":2603},{"type":32,"tag":68,"props":2636,"children":2637},{"style":662},[2638],{"type":37,"value":2608},{"type":32,"tag":68,"props":2640,"children":2641},{"style":107},[2642],{"type":37,"value":2643}," 3000",{"type":32,"tag":68,"props":2645,"children":2646},{"style":662},[2647],{"type":37,"value":2618},{"type":32,"tag":68,"props":2649,"children":2650},{"style":97},[2651],{"type":37,"value":2652}," 'moderate'\n",{"type":32,"tag":68,"props":2654,"children":2655},{"class":70,"line":932},[2656,2661],{"type":32,"tag":68,"props":2657,"children":2658},{"style":662},[2659],{"type":37,"value":2660},"    ELSE",{"type":32,"tag":68,"props":2662,"children":2663},{"style":97},[2664],{"type":37,"value":2665}," 'slow'\n",{"type":32,"tag":68,"props":2667,"children":2668},{"class":70,"line":945},[2669,2674,2679],{"type":32,"tag":68,"props":2670,"children":2671},{"style":662},[2672],{"type":37,"value":2673},"  END",{"type":32,"tag":68,"props":2675,"children":2676},{"style":662},[2677],{"type":37,"value":2678}," AS",{"type":32,"tag":68,"props":2680,"children":2681},{"style":91},[2682],{"type":37,"value":2683}," speed_bucket,\n",{"type":32,"tag":68,"props":2685,"children":2686},{"class":70,"line":2314},[2687,2691,2695,2700,2705,2709,2714,2718,2722,2727],{"type":32,"tag":68,"props":2688,"children":2689},{"style":107},[2690],{"type":37,"value":1426},{"type":32,"tag":68,"props":2692,"children":2693},{"style":91},[2694],{"type":37,"value":713},{"type":32,"tag":68,"props":2696,"children":2697},{"style":662},[2698],{"type":37,"value":2699},"DISTINCT",{"type":32,"tag":68,"props":2701,"children":2702},{"style":107},[2703],{"type":37,"value":2704}," m",{"type":32,"tag":68,"props":2706,"children":2707},{"style":91},[2708],{"type":37,"value":781},{"type":32,"tag":68,"props":2710,"children":2711},{"style":107},[2712],{"type":37,"value":2713},"session_id",{"type":32,"tag":68,"props":2715,"children":2716},{"style":91},[2717],{"type":37,"value":1057},{"type":32,"tag":68,"props":2719,"children":2720},{"style":662},[2721],{"type":37,"value":1413},{"type":32,"tag":68,"props":2723,"children":2724},{"style":662},[2725],{"type":37,"value":2726}," sessions",{"type":32,"tag":68,"props":2728,"children":2729},{"style":91},[2730],{"type":37,"value":458},{"type":32,"tag":68,"props":2732,"children":2734},{"class":70,"line":2733},24,[2735,2739,2743,2748,2752,2756,2760,2764],{"type":32,"tag":68,"props":2736,"children":2737},{"style":107},[2738],{"type":37,"value":1426},{"type":32,"tag":68,"props":2740,"children":2741},{"style":91},[2742],{"type":37,"value":713},{"type":32,"tag":68,"props":2744,"children":2745},{"style":107},[2746],{"type":37,"value":2747},"c",{"type":32,"tag":68,"props":2749,"children":2750},{"style":91},[2751],{"type":37,"value":781},{"type":32,"tag":68,"props":2753,"children":2754},{"style":107},[2755],{"type":37,"value":2713},{"type":32,"tag":68,"props":2757,"children":2758},{"style":91},[2759],{"type":37,"value":1057},{"type":32,"tag":68,"props":2761,"children":2762},{"style":662},[2763],{"type":37,"value":1413},{"type":32,"tag":68,"props":2765,"children":2766},{"style":91},[2767],{"type":37,"value":2768}," conversions,\n",{"type":32,"tag":68,"props":2770,"children":2772},{"class":70,"line":2771},25,[2773,2778,2783,2787,2791,2795,2799,2804,2808,2812,2816,2820,2824,2828,2833,2837],{"type":32,"tag":68,"props":2774,"children":2775},{"style":91},[2776],{"type":37,"value":2777},"  SAFE_DIVIDE(",{"type":32,"tag":68,"props":2779,"children":2780},{"style":107},[2781],{"type":37,"value":2782},"COUNT",{"type":32,"tag":68,"props":2784,"children":2785},{"style":91},[2786],{"type":37,"value":713},{"type":32,"tag":68,"props":2788,"children":2789},{"style":107},[2790],{"type":37,"value":2747},{"type":32,"tag":68,"props":2792,"children":2793},{"style":91},[2794],{"type":37,"value":781},{"type":32,"tag":68,"props":2796,"children":2797},{"style":107},[2798],{"type":37,"value":2713},{"type":32,"tag":68,"props":2800,"children":2801},{"style":91},[2802],{"type":37,"value":2803},"), ",{"type":32,"tag":68,"props":2805,"children":2806},{"style":107},[2807],{"type":37,"value":2782},{"type":32,"tag":68,"props":2809,"children":2810},{"style":91},[2811],{"type":37,"value":713},{"type":32,"tag":68,"props":2813,"children":2814},{"style":662},[2815],{"type":37,"value":2699},{"type":32,"tag":68,"props":2817,"children":2818},{"style":107},[2819],{"type":37,"value":2704},{"type":32,"tag":68,"props":2821,"children":2822},{"style":91},[2823],{"type":37,"value":781},{"type":32,"tag":68,"props":2825,"children":2826},{"style":107},[2827],{"type":37,"value":2713},{"type":32,"tag":68,"props":2829,"children":2830},{"style":91},[2831],{"type":37,"value":2832},")) ",{"type":32,"tag":68,"props":2834,"children":2835},{"style":662},[2836],{"type":37,"value":1413},{"type":32,"tag":68,"props":2838,"children":2839},{"style":91},[2840],{"type":37,"value":2841}," conversion_rate,\n",{"type":32,"tag":68,"props":2843,"children":2845},{"class":70,"line":2844},26,[2846,2851,2855,2859,2863,2868,2872,2876],{"type":32,"tag":68,"props":2847,"children":2848},{"style":107},[2849],{"type":37,"value":2850},"  AVG",{"type":32,"tag":68,"props":2852,"children":2853},{"style":91},[2854],{"type":37,"value":713},{"type":32,"tag":68,"props":2856,"children":2857},{"style":107},[2858],{"type":37,"value":2747},{"type":32,"tag":68,"props":2860,"children":2861},{"style":91},[2862],{"type":37,"value":781},{"type":32,"tag":68,"props":2864,"children":2865},{"style":107},[2866],{"type":37,"value":2867},"revenue",{"type":32,"tag":68,"props":2869,"children":2870},{"style":91},[2871],{"type":37,"value":1057},{"type":32,"tag":68,"props":2873,"children":2874},{"style":662},[2875],{"type":37,"value":1413},{"type":32,"tag":68,"props":2877,"children":2878},{"style":91},[2879],{"type":37,"value":2880}," avg_order_value\n",{"type":32,"tag":68,"props":2882,"children":2884},{"class":70,"line":2883},27,[2885,2889],{"type":32,"tag":68,"props":2886,"children":2887},{"style":662},[2888],{"type":37,"value":1456},{"type":32,"tag":68,"props":2890,"children":2891},{"style":91},[2892],{"type":37,"value":2893}," metrics_with_sessions m\n",{"type":32,"tag":68,"props":2895,"children":2897},{"class":70,"line":2896},28,[2898,2903,2908,2913],{"type":32,"tag":68,"props":2899,"children":2900},{"style":662},[2901],{"type":37,"value":2902},"LEFT JOIN",{"type":32,"tag":68,"props":2904,"children":2905},{"style":91},[2906],{"type":37,"value":2907}," conversions c ",{"type":32,"tag":68,"props":2909,"children":2910},{"style":662},[2911],{"type":37,"value":2912},"USING",{"type":32,"tag":68,"props":2914,"children":2915},{"style":91},[2916],{"type":37,"value":2917},"(session_id)\n",{"type":32,"tag":68,"props":2919,"children":2921},{"class":70,"line":2920},29,[2922,2926],{"type":32,"tag":68,"props":2923,"children":2924},{"style":662},[2925],{"type":37,"value":1526},{"type":32,"tag":68,"props":2927,"children":2928},{"style":91},[2929],{"type":37,"value":2930}," speed_bucket;\n",{"type":32,"tag":33,"props":2932,"children":2933},{},[2934],{"type":37,"value":2935},"Output di esempio:",{"type":32,"tag":2937,"props":2938,"children":2939},"ul",{},[2940,2959,2976],{"type":32,"tag":2941,"props":2942,"children":2943},"li",{},[2944,2950,2952,2957],{"type":32,"tag":2945,"props":2946,"children":2947},"strong",{},[2948],{"type":37,"value":2949},"fast (LCP \u003C 2s):",{"type":37,"value":2951}," 15.240 session, 1.829 conversioni → ",{"type":32,"tag":2945,"props":2953,"children":2954},{},[2955],{"type":37,"value":2956},"12,0% CR",{"type":37,"value":2958},", €87 AOV",{"type":32,"tag":2941,"props":2960,"children":2961},{},[2962,2967,2969,2974],{"type":32,"tag":2945,"props":2963,"children":2964},{},[2965],{"type":37,"value":2966},"moderate (2-3s):",{"type":37,"value":2968}," 8.910 session, 934 conversioni → ",{"type":32,"tag":2945,"props":2970,"children":2971},{},[2972],{"type":37,"value":2973},"10,5% CR",{"type":37,"value":2975},", €83 AOV",{"type":32,"tag":2941,"props":2977,"children":2978},{},[2979,2984,2986,2991],{"type":32,"tag":2945,"props":2980,"children":2981},{},[2982],{"type":37,"value":2983},"slow (>3s):",{"type":37,"value":2985}," 3.200 session, 256 conversioni → ",{"type":32,"tag":2945,"props":2987,"children":2988},{},[2989],{"type":37,"value":2990},"8,0% CR",{"type":37,"value":2992},", €78 AOV",{"type":32,"tag":33,"props":2994,"children":2995},{},[2996],{"type":37,"value":2997},"Questi dati mostrano che ridurre LCP da 3s a 2s aumenterebbe il conversion rate dall'8% al 12%—un differenziale di 4 punti. Per un sito con 10.000 visitatori mensili, questo significa 400 conversioni extra. Con AOV di €80, il ricavo aggiuntivo mensile è €32.000. Quando comunichi questo numero nella riunione del budget di performance, il meccanismo decisionale cambia—l'ottimizzazione di LCP sale in cima al backlog.",{"type":32,"tag":1538,"props":2999,"children":3001},{"id":3000},"rendere-il-budget-dinamico",[3002],{"type":37,"value":3003},"Rendere il Budget Dinamico",{"type":32,"tag":33,"props":3005,"children":3006},{},[3007],{"type":37,"value":3008},"Un budget statico come \"LCP \u003C 2,5s\" potrebbe non essere adatto a tutte le pagine. Una pagina di listing di prodotti e una pagina di checkout hanno criticità diverse. Un ritardo di 100ms al checkout è perdita diretta di revenue, nel listing è meno critico. Differenziare il budget per tipo di pagina:",{"type":32,"tag":57,"props":3010,"children":3012},{"code":3011,"language":390,"meta":16,"className":391,"style":16},"\u002F\u002F lighthouserc.json — assert differenti per tipo di pagina\n{\n  \"ci\": {\n    \"collect\": {\n      \"url\": [\n        \"https:\u002F\u002Fstaging.example.com\u002F\",\n        \"https:\u002F\u002Fstaging.example.com\u002Fproducts\",\n        \"https:\u002F\u002Fstaging.example.com\u002Fcheckout\"\n      ]\n    },\n    \"assert\": {\n      \"assertions\": {\n        \"largest-contentful-paint\": [\n          \"error\",\n          {\n            \"maxNumericValue\": 2000,\n            \"matchingUrlPattern\": \".*\u002Fcheckout\"\n          }\n        ],\n        \"largest-contentful-paint\": [\n          \"warn\",\n          {\n            \"maxNumericValue\": 2500,\n            \"matchingUrlPattern\": \".*\u002F(products|)\"\n          }\n        ]\n      }\n    }\n  }\n}\n",[3013],{"type":32,"tag":64,"props":3014,"children":3015},{"__ignoreMap":16},[3016,3024,3031,3042,3054,3067,3079,3091,3099,3107,3115,3126,3137,3148,3160,3168,3189,3206,3214,3222,3233,3245,3252,3271,3287,3294,3302,3309,3316,3323],{"type":32,"tag":68,"props":3017,"children":3018},{"class":70,"line":71},[3019],{"type":32,"tag":68,"props":3020,"children":3021},{"style":75},[3022],{"type":37,"value":3023},"\u002F\u002F lighthouserc.json — assert differenti per tipo di pagina\n",{"type":32,"tag":68,"props":3025,"children":3026},{"class":70,"line":81},[3027],{"type":32,"tag":68,"props":3028,"children":3029},{"style":91},[3030],{"type":37,"value":411},{"type":32,"tag":68,"props":3032,"children":3033},{"class":70,"line":103},[3034,3038],{"type":32,"tag":68,"props":3035,"children":3036},{"style":107},[3037],{"type":37,"value":419},{"type":32,"tag":68,"props":3039,"children":3040},{"style":91},[3041],{"type":37,"value":424},{"type":32,"tag":68,"props":3043,"children":3044},{"class":70,"line":128},[3045,3050],{"type":32,"tag":68,"props":3046,"children":3047},{"style":107},[3048],{"type":37,"value":3049},"    \"collect\"",{"type":32,"tag":68,"props":3051,"children":3052},{"style":91},[3053],{"type":37,"value":424},{"type":32,"tag":68,"props":3055,"children":3056},{"class":70,"line":142},[3057,3062],{"type":32,"tag":68,"props":3058,"children":3059},{"style":107},[3060],{"type":37,"value":3061},"      \"url\"",{"type":32,"tag":68,"props":3063,"children":3064},{"style":91},[3065],{"type":37,"value":3066},": [\n",{"type":32,"tag":68,"props":3068,"children":3069},{"class":70,"line":155},[3070,3075],{"type":32,"tag":68,"props":3071,"children":3072},{"style":97},[3073],{"type":37,"value":3074},"        \"https:\u002F\u002Fstaging.example.com\u002F\"",{"type":32,"tag":68,"props":3076,"children":3077},{"style":91},[3078],{"type":37,"value":458},{"type":32,"tag":68,"props":3080,"children":3081},{"class":70,"line":173},[3082,3087],{"type":32,"tag":68,"props":3083,"children":3084},{"style":97},[3085],{"type":37,"value":3086},"        \"https:\u002F\u002Fstaging.example.com\u002Fproducts\"",{"type":32,"tag":68,"props":3088,"children":3089},{"style":91},[3090],{"type":37,"value":458},{"type":32,"tag":68,"props":3092,"children":3093},{"class":70,"line":186},[3094],{"type":32,"tag":68,"props":3095,"children":3096},{"style":97},[3097],{"type":37,"value":3098},"        \"https:\u002F\u002Fstaging.example.com\u002Fcheckout\"\n",{"type":32,"tag":68,"props":3100,"children":3101},{"class":70,"line":26},[3102],{"type":32,"tag":68,"props":3103,"children":3104},{"style":91},[3105],{"type":37,"value":3106},"      ]\n",{"type":32,"tag":68,"props":3108,"children":3109},{"class":70,"line":229},[3110],{"type":32,"tag":68,"props":3111,"children":3112},{"style":91},[3113],{"type":37,"value":3114},"    },\n",{"type":32,"tag":68,"props":3116,"children":3117},{"class":70,"line":242},[3118,3122],{"type":32,"tag":68,"props":3119,"children":3120},{"style":107},[3121],{"type":37,"value":432},{"type":32,"tag":68,"props":3123,"children":3124},{"style":91},[3125],{"type":37,"value":424},{"type":32,"tag":68,"props":3127,"children":3128},{"class":70,"line":260},[3129,3133],{"type":32,"tag":68,"props":3130,"children":3131},{"style":107},[3132],{"type":37,"value":466},{"type":32,"tag":68,"props":3134,"children":3135},{"style":91},[3136],{"type":37,"value":424},{"type":32,"tag":68,"props":3138,"children":3139},{"class":70,"line":282},[3140,3144],{"type":32,"tag":68,"props":3141,"children":3142},{"style":107},[3143],{"type":37,"value":478},{"type":32,"tag":68,"props":3145,"children":3146},{"style":91},[3147],{"type":37,"value":3066},{"type":32,"tag":68,"props":3149,"children":3150},{"class":70,"line":303},[3151,3156],{"type":32,"tag":68,"props":3152,"children":3153},{"style":97},[3154],{"type":37,"value":3155},"          \"error\"",{"type":32,"tag":68,"props":3157,"children":3158},{"style":91},[3159],{"type":37,"value":458},{"type":32,"tag":68,"props":3161,"children":3162},{"class":70,"line":324},[3163],{"type":32,"tag":68,"props":3164,"children":3165},{"style":91},[3166],{"type":37,"value":3167},"          {\n",{"type":32,"tag":68,"props":3169,"children":3170},{"class":70,"line":345},[3171,3176,3180,3185],{"type":32,"tag":68,"props":3172,"children":3173},{"style":107},[3174],{"type":37,"value":3175},"            \"maxNumericValue\"",{"type":32,"tag":68,"props":3177,"children":3178},{"style":91},[3179],{"type":37,"value":94},{"type":32,"tag":68,"props":3181,"children":3182},{"style":107},[3183],{"type":37,"value":3184},"2000",{"type":32,"tag":68,"props":3186,"children":3187},{"style":91},[3188],{"type":37,"value":458},{"type":32,"tag":68,"props":3190,"children":3191},{"class":70,"line":358},[3192,3197,3201],{"type":32,"tag":68,"props":3193,"children":3194},{"style":107},[3195],{"type":37,"value":3196},"            \"matchingUrlPattern\"",{"type":32,"tag":68,"props":3198,"children":3199},{"style":91},[3200],{"type":37,"value":94},{"type":32,"tag":68,"props":3202,"children":3203},{"style":97},[3204],{"type":37,"value":3205},"\".*\u002Fcheckout\"\n",{"type":32,"tag":68,"props":3207,"children":3208},{"class":70,"line":897},[3209],{"type":32,"tag":68,"props":3210,"children":3211},{"style":91},[3212],{"type":37,"value":3213},"          }\n",{"type":32,"tag":68,"props":3215,"children":3216},{"class":70,"line":905},[3217],{"type":32,"tag":68,"props":3218,"children":3219},{"style":91},[3220],{"type":37,"value":3221},"        ],\n",{"type":32,"tag":68,"props":3223,"children":3224},{"class":70,"line":919},[3225,3229],{"type":32,"tag":68,"props":3226,"children":3227},{"style":107},[3228],{"type":37,"value":478},{"type":32,"tag":68,"props":3230,"children":3231},{"style":91},[3232],{"type":37,"value":3066},{"type":32,"tag":68,"props":3234,"children":3235},{"class":70,"line":932},[3236,3241],{"type":32,"tag":68,"props":3237,"children":3238},{"style":97},[3239],{"type":37,"value":3240},"          \"warn\"",{"type":32,"tag":68,"props":3242,"children":3243},{"style":91},[3244],{"type":37,"value":458},{"type":32,"tag":68,"props":3246,"children":3247},{"class":70,"line":945},[3248],{"type":32,"tag":68,"props":3249,"children":3250},{"style":91},[3251],{"type":37,"value":3167},{"type":32,"tag":68,"props":3253,"children":3254},{"class":70,"line":2314},[3255,3259,3263,3267],{"type":32,"tag":68,"props":3256,"children":3257},{"style":107},[3258],{"type":37,"value":3175},{"type":32,"tag":68,"props":3260,"children":3261},{"style":91},[3262],{"type":37,"value":94},{"type":32,"tag":68,"props":3264,"children":3265},{"style":107},[3266],{"type":37,"value":506},{"type":32,"tag":68,"props":3268,"children":3269},{"style":91},[3270],{"type":37,"value":458},{"type":32,"tag":68,"props":3272,"children":3273},{"class":70,"line":2733},[3274,3278,3282],{"type":32,"tag":68,"props":3275,"children":3276},{"style":107},[3277],{"type":37,"value":3196},{"type":32,"tag":68,"props":3279,"children":3280},{"style":91},[3281],{"type":37,"value":94},{"type":32,"tag":68,"props":3283,"children":3284},{"style":97},[3285],{"type":37,"value":3286},"\".*\u002F(products|)\"\n",{"type":32,"tag":68,"props":3288,"children":3289},{"class":70,"line":2771},[3290],{"type":32,"tag":68,"props":3291,"children":3292},{"style":91},[3293],{"type":37,"value":3213},{"type":32,"tag":68,"props":3295,"children":3296},{"class":70,"line":2844},[3297],{"type":32,"tag":68,"props":3298,"children":3299},{"style":91},[3300],{"type":37,"value":3301},"        ]\n",{"type":32,"tag":68,"props":3303,"children":3304},{"class":70,"line":2883},[3305],{"type":32,"tag":68,"props":3306,"children":3307},{"style":91},[3308],{"type":37,"value":594},{"type":32,"tag":68,"props":3310,"children":3311},{"class":70,"line":2896},[3312],{"type":32,"tag":68,"props":3313,"children":3314},{"style":91},[3315],{"type":37,"value":602},{"type":32,"tag":68,"props":3317,"children":3318},{"class":70,"line":2920},[3319],{"type":32,"tag":68,"props":3320,"children":3321},{"style":91},[3322],{"type":37,"value":610},{"type":32,"tag":68,"props":3324,"children":3326},{"class":70,"line":3325},30,[3327],{"type":32,"tag":68,"props":3328,"children":3329},{"style":91},[3330],{"type":37,"value":618},{"type":32,"tag":33,"props":3332,"children":3333},{},[3334,3336,3342,3344,3350],{"type":37,"value":3335},"Al checkout, superare 2 secondi di LCP blocca il merge (",{"type":32,"tag":64,"props":3337,"children":3339},{"className":3338},[],[3340],{"type":37,"value":3341},"error",{"type":37,"value":3343},"), nella homepage superare 2,5 secondi genera solo un avviso (",{"type":32,"tag":64,"props":3345,"children":3347},{"className":3346},[],[3348],{"type":37,"value":3349},"warn",{"type":37,"value":3351},"). Puoi applicare questa granularità anche in RUM—soglie di allarme diverse per tipo di pagina.",{"type":32,"tag":40,"props":3353,"children":3355},{"id":3354},"integrare-la-pipeline-ci-nel-workflow-aziendale",[3356],{"type":37,"value":3357},"Integrare la Pipeline CI nel Workflow Aziendale",{"type":32,"tag":33,"props":3359,"children":3360},{},[3361],{"type":37,"value":3362},"Usare Lighthouse CI solo come strumento di test, piuttosto che fargli scrivere commenti sui PR, aumenta la visibilità nel team:",{"type":32,"tag":57,"props":3364,"children":3366},{"code":3365,"language":60,"meta":16,"className":61,"style":16},"# .github\u002Fworkflows\u002Flighthouse-comment.yml\n- name: Comment PR with Lighthouse results\n  uses: treosh\u002Flighthouse-ci-action@v9\n  with:\n    uploadArtifacts: true\n    temporaryPublicStorage: true\n    runs: 3 # eseguire 3 volte, fare la media\n",[3367],{"type":32,"tag":64,"props":3368,"children":3369},{"__ignoreMap":16},[3370,3378,3399,3416,3428,3444,3460],{"type":32,"tag":68,"props":3371,"children":3372},{"class":70,"line":71},[3373],{"type":32,"tag":68,"props":3374,"children":3375},{"style":75},[3376],{"type":37,"value":3377},"# .github\u002Fworkflows\u002Flighthouse-comment.yml\n",{"type":32,"tag":68,"props":3379,"children":3380},{"class":70,"line":81},[3381,3386,3390,3394],{"type":32,"tag":68,"props":3382,"children":3383},{"style":91},[3384],{"type":37,"value":3385},"- ",{"type":32,"tag":68,"props":3387,"children":3388},{"style":85},[3389],{"type":37,"value":88},{"type":32,"tag":68,"props":3391,"children":3392},{"style":91},[3393],{"type":37,"value":94},{"type":32,"tag":68,"props":3395,"children":3396},{"style":97},[3397],{"type":37,"value":3398},"Comment PR with Lighthouse results\n",{"type":32,"tag":68,"props":3400,"children":3401},{"class":70,"line":103},[3402,3407,3411],{"type":32,"tag":68,"props":3403,"children":3404},{"style":85},[3405],{"type":37,"value":3406},"  uses",{"type":32,"tag":68,"props":3408,"children":3409},{"style":91},[3410],{"type":37,"value":94},{"type":32,"tag":68,"props":3412,"children":3413},{"style":97},[3414],{"type":37,"value":3415},"treosh\u002Flighthouse-ci-action@v9\n",{"type":32,"tag":68,"props":3417,"children":3418},{"class":70,"line":128},[3419,3424],{"type":32,"tag":68,"props":3420,"children":3421},{"style":85},[3422],{"type":37,"value":3423},"  with",{"type":32,"tag":68,"props":3425,"children":3426},{"style":91},[3427],{"type":37,"value":139},{"type":32,"tag":68,"props":3429,"children":3430},{"class":70,"line":142},[3431,3436,3440],{"type":32,"tag":68,"props":3432,"children":3433},{"style":85},[3434],{"type":37,"value":3435},"    uploadArtifacts",{"type":32,"tag":68,"props":3437,"children":3438},{"style":91},[3439],{"type":37,"value":94},{"type":32,"tag":68,"props":3441,"children":3442},{"style":107},[3443],{"type":37,"value":879},{"type":32,"tag":68,"props":3445,"children":3446},{"class":70,"line":155},[3447,3452,3456],{"type":32,"tag":68,"props":3448,"children":3449},{"style":85},[3450],{"type":37,"value":3451},"    temporaryPublicStorage",{"type":32,"tag":68,"props":3453,"children":3454},{"style":91},[3455],{"type":37,"value":94},{"type":32,"tag":68,"props":3457,"children":3458},{"style":107},[3459],{"type":37,"value":879},{"type":32,"tag":68,"props":3461,"children":3462},{"class":70,"line":173},[3463,3468,3472,3477],{"type":32,"tag":68,"props":3464,"children":3465},{"style":85},[3466],{"type":37,"value":3467},"    runs",{"type":32,"tag":68,"props":3469,"children":3470},{"style":91},[3471],{"type":37,"value":94},{"type":32,"tag":68,"props":3473,"children":3474},{"style":107},[3475],{"type":37,"value":3476},"3",{"type":32,"tag":68,"props":3478,"children":3479},{"style":75},[3480],{"type":37,"value":3481}," # eseguire 3 volte, fare la media\n",{"type":32,"tag":33,"props":3483,"children":3484},{},[3485],{"type":37,"value":3486},"Questa action aggiunge un commento al PR come questo:",{"type":32,"tag":57,"props":3488,"children":3490},{"code":3489},"Lighthouse CI Report\n\n| Metric | Before | After | Diff |\n|--------|--------|-------|------|\n| LCP    | 2,8s   | 2,1s  | -700ms ✅ |\n| TBT    | 420ms  | 310ms | -110ms ✅ |\n| CLS    | 0,08   | 0,12  | +0,04 ⚠️ |\n",[3491],{"type":32,"tag":64,"props":3492,"children":3493},{"__ignoreMap":16},[3494],{"type":37,"value":3489},{"type":32,"tag":33,"props":3496,"children":3497},{},[3498],{"type":37,"value":3499},"CLS (Cumulative Layout Shift) è peggiorato—il team lo nota subito, può correggere prima del deployment. Chiudere questo feedback loop è essenziale per costruire una cultura di performance.",{"type":32,"tag":33,"props":3501,"children":3502},{},[3503],{"type":37,"value":3504},"Trasferire i dati RUM in un dashboard è altrettanto critico. La combinazione Grafana + BigQuery è semplice:",{"type":32,"tag":57,"props":3506,"children":3508},{"code":3507,"language":1360,"meta":16,"className":1361,"style":16},"-- Panel di Grafana: trend di LCP nelle ultime 24 ore\nSELECT\n  TIMESTAMP_SECONDS(DIV(timestamp, 1000)) AS time,\n  APPROX_QUANTILES(value, 100)[OFFSET(75)] AS p75_lcp\nFROM web_vitals.raw_metrics\nWHERE metric = 'LCP'\n  AND timestamp >= UNIX_MILLIS(TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 24 HOUR))\nGROUP BY time\nORDER BY time;\n",[3509],{"type":32,"tag":64,"props":3510,"children":3511},{"__ignoreMap":16},[3512,3520,3527,3566,3598,3617,3636,3678,3690],{"type":32,"tag":68,"props":3513,"children":3514},{"class":70,"line":71},[3515],{"type":32,"tag":68,"props":3516,"children":3517},{"style":75},[3518],{"type":37,"value":3519},"-- Panel di Grafana: trend di LCP nelle ultime 24 ore\n",{"type":32,"tag":68,"props":3521,"children":3522},{"class":70,"line":81},[3523],{"type":32,"tag":68,"props":3524,"children":3525},{"style":662},[3526],{"type":37,"value":1373},{"type":32,"tag":68,"props":3528,"children":3529},{"class":70,"line":103},[3530,3535,3540,3544,3549,3553,3557,3562],{"type":32,"tag":68,"props":3531,"children":3532},{"style":91},[3533],{"type":37,"value":3534},"  TIMESTAMP_SECONDS(DIV(",{"type":32,"tag":68,"props":3536,"children":3537},{"style":662},[3538],{"type":37,"value":3539},"timestamp",{"type":32,"tag":68,"props":3541,"children":3542},{"style":91},[3543],{"type":37,"value":1020},{"type":32,"tag":68,"props":3545,"children":3546},{"style":107},[3547],{"type":37,"value":3548},"1000",{"type":32,"tag":68,"props":3550,"children":3551},{"style":91},[3552],{"type":37,"value":2832},{"type":32,"tag":68,"props":3554,"children":3555},{"style":662},[3556],{"type":37,"value":1413},{"type":32,"tag":68,"props":3558,"children":3559},{"style":662},[3560],{"type":37,"value":3561}," time",{"type":32,"tag":68,"props":3563,"children":3564},{"style":91},[3565],{"type":37,"value":458},{"type":32,"tag":68,"props":3567,"children":3568},{"class":70,"line":128},[3569,3573,3577,3581,3585,3589,3593],{"type":32,"tag":68,"props":3570,"children":3571},{"style":91},[3572],{"type":37,"value":1389},{"type":32,"tag":68,"props":3574,"children":3575},{"style":662},[3576],{"type":37,"value":1394},{"type":32,"tag":68,"props":3578,"children":3579},{"style":91},[3580],{"type":37,"value":1020},{"type":32,"tag":68,"props":3582,"children":3583},{"style":107},[3584],{"type":37,"value":1403},{"type":32,"tag":68,"props":3586,"children":3587},{"style":91},[3588],{"type":37,"value":1408},{"type":32,"tag":68,"props":3590,"children":3591},{"style":662},[3592],{"type":37,"value":1413},{"type":32,"tag":68,"props":3594,"children":3595},{"style":91},[3596],{"type":37,"value":3597}," p75_lcp\n",{"type":32,"tag":68,"props":3599,"children":3600},{"class":70,"line":142},[3601,3605,3609,3613],{"type":32,"tag":68,"props":3602,"children":3603},{"style":662},[3604],{"type":37,"value":1456},{"type":32,"tag":68,"props":3606,"children":3607},{"style":107},[3608],{"type":37,"value":1461},{"type":32,"tag":68,"props":3610,"children":3611},{"style":91},[3612],{"type":37,"value":781},{"type":32,"tag":68,"props":3614,"children":3615},{"style":107},[3616],{"type":37,"value":1470},{"type":32,"tag":68,"props":3618,"children":3619},{"class":70,"line":155},[3620,3624,3628,3632],{"type":32,"tag":68,"props":3621,"children":3622},{"style":662},[3623],{"type":37,"value":1478},{"type":32,"tag":68,"props":3625,"children":3626},{"style":91},[3627],{"type":37,"value":2454},{"type":32,"tag":68,"props":3629,"children":3630},{"style":662},[3631],{"type":37,"value":1820},{"type":32,"tag":68,"props":3633,"children":3634},{"style":97},[3635],{"type":37,"value":2463},{"type":32,"tag":68,"props":3637,"children":3638},{"class":70,"line":173},[3639,3644,3648,3652,3656,3660,3664,3669,3674],{"type":32,"tag":68,"props":3640,"children":3641},{"style":662},[3642],{"type":37,"value":3643},"  AND",{"type":32,"tag":68,"props":3645,"children":3646},{"style":662},[3647],{"type":37,"value":1483},{"type":32,"tag":68,"props":3649,"children":3650},{"style":662},[3651],{"type":37,"value":1488},{"type":32,"tag":68,"props":3653,"children":3654},{"style":91},[3655],{"type":37,"value":1493},{"type":32,"tag":68,"props":3657,"children":3658},{"style":107},[3659],{"type":37,"value":1498},{"type":32,"tag":68,"props":3661,"children":3662},{"style":91},[3663],{"type":37,"value":1503},{"type":32,"tag":68,"props":3665,"children":3666},{"style":107},[3667],{"type":37,"value":3668},"24",{"type":32,"tag":68,"props":3670,"children":3671},{"style":662},[3672],{"type":37,"value":3673}," HOUR",{"type":32,"tag":68,"props":3675,"children":3676},{"style":91},[3677],{"type":37,"value":1518},{"type":32,"tag":68,"props":3679,"children":3680},{"class":70,"line":186},[3681,3685],{"type":32,"tag":68,"props":3682,"children":3683},{"style":662},[3684],{"type":37,"value":1526},{"type":32,"tag":68,"props":3686,"children":3687},{"style":662},[3688],{"type":37,"value":3689}," time\n",{"type":32,"tag":68,"props":3691,"children":3692},{"class":70,"line":26},[3693,3698,3702],{"type":32,"tag":68,"props":3694,"children":3695},{"style":662},[3696],{"type":37,"value":3697},"ORDER BY",{"type":32,"tag":68,"props":3699,"children":3700},{"style":662},[3701],{"type":37,"value":3561},{"type":32,"tag":68,"props":3703,"children":3704},{"style":91},[3705],{"type":37,"value":685},{"type":32,"tag":33,"props":3707,"children":3708},{},[3709],{"type":37,"value":3710},"Nel dashboard, aggiungere annotazioni di deployment per vedere quale release ha avuto quale impatto. Ad esempio, un cambio di lazy loading per le immagini riduce il LCP del 18%—se mostri l'ID del deployment come",{"type":32,"tag":3712,"props":3713,"children":3714},"style",{},[3715],{"type":37,"value":3716},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":16,"searchDepth":103,"depth":103,"links":3718},[3719,3720,3723,3724,3727],{"id":42,"depth":81,"text":45},{"id":631,"depth":81,"text":634,"children":3721},[3722],{"id":1540,"depth":103,"text":1543},{"id":1567,"depth":81,"text":1570},{"id":2327,"depth":81,"text":2330,"children":3725},[3726],{"id":3000,"depth":103,"text":3003},{"id":3354,"depth":81,"text":3357},"markdown","content:it:tech:web-performance-budget-decisioni.md","content","it\u002Ftech\u002Fweb-performance-budget-decisioni.md","it\u002Ftech\u002Fweb-performance-budget-decisioni","md",1778767427771]