Reports¶
App Sizer supports four types of reports to cater to different use cases and environments:
- HTML dashboard
- InfluxDB database (1.x)
- Markdown tables
- JSON data
HTML Dashboard¶
Every analysis writes a self-contained index.html dashboard into each device's report folder, next to the markdown and JSON reports:
- Gradle plugin:
[outputDirectory]/[device]/index.html(defaultapp/build/sizer/reports/[variant]/[device]/index.html) - CLI:
[output-directory]/[device]/index.html
It has no external dependencies, so it can be opened offline, shared as a single file, or viewed straight from a CI artifact browser; any static file server serves it automatically when the folder is opened.
The dashboard includes:
- Header tiles with the total download size and the code/resources/native/assets split
- Download size by component (stacked bar with legend)
- Download size by team, with a per-team drill-down into its components, modules, and libraries
- Searchable tables for all modules, libraries, and large files
- Light and dark themes (follows the system setting, with a manual toggle)
InfluxDB Database¶
Setup¶
We provide a Docker image with InfluxDB (1.x) and Grafana pre-configured to showcase the dashboards:
docker run -d \
--name sizer-influxdb-grafana \
-p 3003:3003 \
-p 8086:8086 \
-v /path/for/influxdb:/var/lib/influxdb \
-v /path/for/grafana:/var/lib/grafana \
mikenguyen/sizer-influx-grafana:SNAPSHOT
For more details on the Docker setup, see our Docker guide.
Grafana Dashboard¶
A default App Download Size Breakdown dashboard is included in the Grafana docker instance. If you have an existing InfluxDB and Grafana setup, you can import our dashboard using this JSON file. Our blogpost introduce the provided dashboards
Markdown Tables¶
Markdown tables provide a convenient format for local analysis. The report is saved as [option]-report.md in the configured output folder (default: app/build/sizer/reports).
Example: Module-wise Size Contribution¶
| Contributor | Size | Owner |
|---|---|---|
| app | 90.078 KB | Platform |
| sample-group:android-module-level2 | 123.968 KB | Team2 |
| android-module-level1 | 124.042 KB | Team1 |
| kotlin-module | 248.326 KB | Team2 |
Example: Library-wise Size Contribution¶
| Contributor | Size | Owner |
|---|---|---|
| androidx.appcompat:appcompat:1.7.0 | 166.844 KB | Platform |
| com.google.android.material:material:1.4.0-beta01 | 164.000 KB | Team1 |
| org.jetbrains.kotlin:kotlin-stdlib:1.8.22 | 58.547 KB | Team2 |
The Owner column appears when teamMappingFile/libraryOwnershipFile are configured; contributors that match no mapping are reported as NA.
JSON Report¶
JSON reports offer compatibility with other platforms and tools. The report is saved as [option]-metrics.json in the configured output folder.
JSON Structure¶
Here's a sample of the JSON structure:
[
{
"name": "apk",
"fields": [
{
"name": "size",
"value": "1789199",
"value_type": "integer"
},
{
"name": "pipeline_id",
"value": "1001",
"value_type": "string"
}
],
"tags": [
{
"name": "contributor",
"value": "apk",
"value_type": "string"
},
{
"name": "project",
"value": "sample",
"value_type": "string"
},
{
"name": "app_version",
"value": "1.0.9",
"value_type": "string"
},
{
"name": "build_type",
"value": "proDebug",
"value_type": "string"
},
{
"name": "device_name",
"value": "device-1",
"value_type": "string"
}
],
"timestamp": 1720248703061
},
// More measurements...
]
JSON Fields Explanation¶
Each object in the array represents a single database row and contains the following properties:
name: The measurement name (e.g., "apk")fields: An array of fields containing numerical or custom datatags: Each measurement includes relevant tags such as the project name, app version, build type, and device name, allowing for detailed analysis and filtering of the data.timestamp: Unix timestamp (in milliseconds) when the measurement was taken
Using the JSON Report¶
The JSON format makes it easy to:
- Import the data into various tools/databases
- Integrate with other CI/CD processes
- Perform programmatic analysis of app size trends over time
You can parse this JSON data using any standard JSON library in your preferred programming language to extract and analyze the information as needed for your project.
Customizing Reports¶
You can customize the reports by modifying the configuration in your Gradle plugin or CLI tool setup. For more details, refer to the Plugin Configuration or CLI Configuration guides.