Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Vdimitrakis/try/download stats report #96615

Open therocket-gr opened 15 hours ago

therocket-gr commented 15 hours ago

Related to #

2644-gh-tumblr/a8c-dsp

Proposed Changes

added a download data button in the campaign item details page (for blaze advertising)

Screenshot 2024-11-21 at 1 04 03 PM

when clicked a loading text will appear with text generating report (adding this for translators use)

Screenshot 2024-11-21 at 1 04 06 PM

internally we call 3 DSP endpoints

1 GetStats to start the getting of stats process (this endpoint will return a report_id)

2 GetCampaignReportStatus to check the status of the report (using the report id)

3 GetCampaignReport using the report_id we call this endpoint to get the data of the campaign's stats the result will come back as a base64 encoded string

we then decode the string and start the fetching of the csv values file.

Testing Instructions

you ll need to fire up DSP in localhost on this branch 2860

then fire up Calypso and get to a campaigns details page (one that has stats would be nice or else the csv will be empty)

open up inspect so you can check your network calls

click the download data link on top of the page you should see the file downloaded in your Downloads folder

Pre-merge Checklist

github-actions[bot] commented 15 hours ago
Calypso Live (direct link)
https://calypso.live?image=registry.a8c.com/calypso/app:build-125287
Jetpack Cloud live (direct link)
https://calypso.live?image=registry.a8c.com/calypso/app:build-125287&env=jetpack
Automattic for Agencies live (direct link)
https://calypso.live?image=registry.a8c.com/calypso/app:build-125287&env=a8c-for-agencies
matticbot commented 15 hours ago

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~2 bytes removed 📉 [gzipped])

``` name parsed_size gzip_size entry-stepper +78 B (+0.0%) -2 B (-0.0%) entry-main +78 B (+0.0%) -2 B (-0.0%) ``` Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~16194 bytes added 📈 [gzipped])

``` name parsed_size gzip_size promote-post-i2 +75611 B (+10.8%) +16194 B (+7.3%) stats +332 B (+0.0%) +141 B (+0.0%) posts-custom +332 B (+0.0%) +141 B (+0.1%) posts +332 B (+0.0%) +141 B (+0.1%) pages +332 B (+0.1%) +141 B (+0.1%) ``` Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size? **Parsed Size:** Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. **Gzip Size:** Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

matticbot commented 15 hours ago

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

To test WordPress.com changes, run install-plugin.sh $pluginSlug vdimitrakis/try/download-stats-report on your sandbox.