Skip to content

Commit 17b4fc4

Browse files
committed
release assets
1 parent d8a4e1e commit 17b4fc4

File tree

6 files changed

+84
-34
lines changed

6 files changed

+84
-34
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
"pluginRepos": true,
66
"data/out/plugin-repos/**": true
77
},
8-
"rust-analyzer.files.exclude": ["data/out/**"]
8+
"rust-analyzer.files.exclude": [
9+
"data/out/**"
10+
]
911
}

data-lib/src/release/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ pub fn get_asset_release_file_type(file_name: &str) -> Option<String> {
114114

115115
pub fn get_asset_cpu_instruction_set(file_name: &str) -> Option<&'static str> {
116116
if file_name.ends_with(".dmg") {
117-
Some("both")
117+
Some("both (.dmg)")
118118
} else if file_name.contains("arm64") {
119119
Some("arm64")
120120
} else {
121-
Some("x64")
121+
Some("x86")
122122
}
123123
}

website/astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ export default defineConfig({
8383
label: 'Downloads',
8484
link: '/releasestats/downloads',
8585
},
86+
{
87+
label: 'Assets',
88+
link: '/releasestats/assets',
89+
},
8690
],
8791
},
8892
],
Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
---
2-
import { type Commit } from '../../../src/types';
2+
import type { StringCommit } from "../../../data-wasm/pkg/data_wasm";
33
4-
const props = Astro.props as { commit: Commit } | { date: string; hash: string };
5-
6-
function getHash(): string {
7-
if ('commit' in props) {
8-
return props.commit.hash;
9-
} else {
10-
return props.hash;
11-
}
12-
}
13-
14-
function getDate(): string {
15-
if ('commit' in props) {
16-
return props.commit.date;
17-
} else {
18-
return props.date;
19-
}
20-
}
21-
22-
const url = 'https://github.com/obsidianmd/obsidian-releases/commit/' + getHash();
4+
const props = Astro.props as { commit: StringCommit };
235
---
246

25-
<a href={url} target="_blank">{getDate()}</a>
7+
<a href={'https://github.com/obsidianmd/obsidian-releases/commit/' + props.commit.hash} target="_blank">{props.commit.date}</a>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
3+
import StackedXBarChart from '../../components/newSvelte/charts/StackedXBarChart.svelte';
4+
import AssetSizeChart from '../../components/newSvelte/charts/release/AssetSizeChart.svelte';
5+
import { getReleaseDataArray } from '../../utils/data';
6+
7+
const dataArray = await getReleaseDataArray();
8+
9+
const assetTypes = dataArray.get_asset_type_percentages();
10+
const assetSize = dataArray.get_asset_size_by_version();
11+
const assetInstructionSet = dataArray.get_asset_instruction_set_percentages();
12+
---
13+
14+
<StarlightPage
15+
frontmatter={{
16+
title: 'Release Assets',
17+
description: `Stats about the asset types and sizes of Obsidian releases.`,
18+
}}
19+
headings={[]}
20+
>
21+
22+
<p>
23+
This page looks at the assets that are included in Obsidian releases, including the types of assets, their sizes, and what type of PCs they are for.
24+
</p>
25+
26+
<p>
27+
The following graph groups the assets by type.
28+
The first bar shows the distribution of downloads among the different asset types.
29+
The second bar shows the distribution of how many assets of each type are included in all releases.
30+
The third bar shows the distribution of the average sizes of each asset type.
31+
</p>
32+
33+
<p><StackedXBarChart dataPoints={assetTypes} percentages client:only="svelte" /></p>
34+
35+
<p>
36+
The next graph shows the evolution of asset sizes over time.
37+
The data is split by asset type.
38+
Note that gaps may appear, as not every asset type is included in every release.
39+
</p>
40+
41+
<p><AssetSizeChart dataPoints={assetSize} client:only="svelte" /></p>
42+
43+
<p>
44+
This graph shows the split between downloads of assets for different instruction sets.
45+
The instruction set is the type of CPU architecture that the asset is built for, such as x86 or ARM.
46+
From this we can see that downloads for ARM make up only {assetInstructionSet.find((x) => x.layer === 'arm64')?.value?.toFixed(1)}% of the total downloads.
47+
The macOS <code>.dmg</code> assets make up the <code>both (.dmg)</code> category with {assetInstructionSet.find((x) => x.layer === 'both (.dmg)')?.value?.toFixed(1)}%, as they can be used on both x86 and ARM Macs.
48+
</p>
49+
50+
<p><StackedXBarChart dataPoints={assetInstructionSet} percentages client:only="svelte" /></p>
51+
52+
</StarlightPage>
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
---
22
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
33
import StackedBarChart from '../../components/newSvelte/charts/StackedBarChart.svelte';
4-
import StackedXBarChart from '../../components/newSvelte/charts/StackedXBarChart.svelte';
5-
import AssetSizeChart from '../../components/newSvelte/charts/release/AssetSizeChart.svelte';
64
import { getReleaseDataArray } from '../../utils/data';
75
86
const dataArray = await getReleaseDataArray();
97
108
const downloads = dataArray.total_downloads_per_version_by_os();
119
const downloadsPercentages = dataArray.total_downloads_per_version_by_os_as_percentages();
12-
13-
const assetTypes = dataArray.get_asset_type_percentages();
14-
const assetSize = dataArray.get_asset_size_by_version();
1510
---
1611

1712
<StarlightPage
@@ -21,10 +16,25 @@ const assetSize = dataArray.get_asset_size_by_version();
2116
}}
2217
headings={[]}
2318
>
24-
<StackedBarChart dataPoints={downloads} xLabel="Version Number" yLabel="Downloads" skewLabels client:only="svelte" />
25-
<StackedBarChart dataPoints={downloadsPercentages} xLabel="Version Number" yLabel="Downloads" skewLabels percentages client:only="svelte" />
26-
<StackedXBarChart dataPoints={assetTypes} percentages client:only="svelte" />
27-
<!-- <StackedBarChart dataPoints={assetSize} xLabel="Version Number" yLabel="Asset Size" skewLabels client:only="svelte" /> -->
28-
<AssetSizeChart dataPoints={assetSize} client:only="svelte" />
19+
<p>
20+
This page presents download statistics for Obsidian releases, including the total number of downloads per version and the distribution of downloads across different operating systems.
21+
</p>
22+
23+
<p>
24+
The download stats are inferred from publicly available GitHub release data.
25+
This data does not include mobile or insider releases. Older versions of Obsidian (pre 0.6.4) are also not included in the data.
26+
The charts exclude the <code>.asar.gz</code> assets, which are used for in-app updates on all operating systems.
27+
</p>
28+
29+
<p>
30+
The below graph depicts the total number of downloads for every release, split by OS.
31+
</p>
32+
33+
<p><StackedBarChart dataPoints={downloads} xLabel="Version Number" yLabel="Downloads" skewLabels client:only="svelte" /></p>
34+
35+
<p>
36+
This graph shows the distribution of downloads among the different operating systems.
37+
</p>
2938

39+
<p><StackedBarChart dataPoints={downloadsPercentages} xLabel="Version Number" yLabel="Downloads" skewLabels percentages client:only="svelte" /></p>
3040
</StarlightPage>

0 commit comments

Comments
 (0)