Skip to content

Commit 4790084

Browse files
Content update and new page for image demo example.
1 parent 53899a9 commit 4790084

12 files changed

+163
-9
lines changed

cli/analytics/durable-objects.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,52 @@ OPTIONS:
3333
--help Print help information
3434
--verbose Toggle verbose output (when applicable)
3535
```
36+
37+
## Example output
38+
39+
```
40+
$ dfd analytics durable-objects --start 2022-04-24 --end 2022-05-22
41+
42+
date req ws.max ws.in ws.out subreq active.gbs reads writes deletes storage total.cost
43+
2022-04-24 126870 $0.02 0 0 0 $0.00 7370 $0.00 2248.98gb-s $0.07 25643270 $5.13 161440 $0.16 26660 $0.03 10.38gb $0.07 $5.48
44+
2022-04-25 202450 $0.03 0 0 0 $0.00 6820 $0.00 2740.59gb-s $0.09 10841540 $2.17 355830 $0.36 28820 $0.03 10.43gb $0.07 $2.74
45+
2022-04-26 208000 $0.03 1 0 40 $0.00 6510 $0.00 2847.32gb-s $0.09 9111270 $1.82 388710 $0.39 24220 $0.02 10.48gb $0.07 $2.43
46+
2022-04-27 206800 $0.03 1 0 0 $0.00 6320 $0.00 2931.81gb-s $0.09 9611410 $1.92 380100 $0.38 23550 $0.02 10.53gb $0.07 $2.52
47+
2022-04-28 200340 $0.03 3 0 0 $0.00 7420 $0.00 3348.24gb-s $0.10 10383190 $2.08 374920 $0.37 30400 $0.03 10.58gb $0.07 $2.69
48+
2022-04-29 186480 $0.03 3 0 210 $0.00 6630 $0.00 3272.82gb-s $0.10 14734460 $2.95 329590 $0.33 18730 $0.02 10.62gb $0.07 $3.50
49+
2022-04-30 130810 $0.02 4 0 4780 $0.00 5820 $0.00 12119.85gb-s $0.38 25632220 $5.13 190010 $0.19 23500 $0.02 10.65gb $0.07 $5.81
50+
2022-05-01 129980 $0.02 4 0 4570 $0.00 7100 $0.00 13909.94gb-s $0.43 24708780 $4.94 170080 $0.17 15650 $0.02 10.68gb $0.07 $5.65
51+
2022-05-02 200130 $0.03 4 0 3430 $0.00 7010 $0.00 11603.98gb-s $0.36 8593910 $1.72 334090 $0.33 33750 $0.03 10.72gb $0.07 $2.55
52+
2022-05-03 201910 $0.03 15 10 7830 $0.00 7040 $0.00 14016.41gb-s $0.44 9984680 $2.00 376150 $0.38 24200 $0.02 10.77gb $0.07 $2.94
53+
2022-05-04 214960 $0.03 16 0 7810 $0.00 7300 $0.00 12868.29gb-s $0.40 10944820 $2.19 399550 $0.40 19490 $0.02 10.82gb $0.07 $3.12
54+
2022-05-05 202830 $0.03 8 0 5170 $0.00 8680 $0.00 14937.47gb-s $0.47 9812930 $1.96 354680 $0.35 28200 $0.03 10.87gb $0.07 $2.92
55+
2022-05-06 194540 $0.03 1 0 3900 $0.00 8730 $0.00 12130.33gb-s $0.38 11017360 $2.20 341250 $0.34 22120 $0.02 10.91gb $0.07 $3.05
56+
2022-05-07 144020 $0.02 1 0 4480 $0.00 9690 $0.00 14535.36gb-s $0.45 22080480 $4.42 211820 $0.21 26280 $0.03 10.94gb $0.07 $5.20
57+
2022-05-08 131300 $0.02 2 0 6850 $0.00 8290 $0.00 13988.98gb-s $0.44 30937430 $6.19 186540 $0.19 20700 $0.02 10.97gb $0.07 $6.93
58+
2022-05-09 213160 $0.03 1 0 4670 $0.00 9520 $0.00 13303.48gb-s $0.42 10327890 $2.07 373180 $0.37 29460 $0.03 11.02gb $0.07 $2.99
59+
2022-05-10 214770 $0.03 1 0 5430 $0.00 7680 $0.00 14145.88gb-s $0.44 8290930 $1.66 425260 $0.43 27220 $0.03 11.07gb $0.07 $2.66
60+
2022-05-11 202400 $0.03 2 10 6100 $0.00 7490 $0.00 13328.40gb-s $0.42 10573500 $2.11 347830 $0.35 31300 $0.03 11.11gb $0.07 $3.02
61+
2022-05-12 202010 $0.03 1 0 5740 $0.00 7030 $0.00 15540.45gb-s $0.49 12950970 $2.59 340250 $0.34 29580 $0.03 11.16gb $0.07 $3.55
62+
2022-05-13 233690 $0.04 65538 0 7270 $0.00 10180 $0.00 13400.11gb-s $0.42 26305590 $5.26 387420 $0.39 38980 $0.04 11.21gb $0.07 $6.22
63+
2022-05-14 185050 $0.03 65538 20 4650 $0.00 11950 $0.00 14998.67gb-s $0.47 48220260 $9.64 191140 $0.19 27460 $0.03 11.24gb $0.07 $10.44
64+
2022-05-15 135060 $0.02 1 0 3650 $0.00 10030 $0.00 12710.02gb-s $0.40 34342450 $6.87 206970 $0.21 32390 $0.03 11.26gb $0.08 $7.60
65+
2022-05-16 202780 $0.03 2 0 5220 $0.00 8280 $0.00 14053.43gb-s $0.44 16441340 $3.29 387130 $0.39 25040 $0.03 11.31gb $0.08 $4.25
66+
2022-05-17 246960 $0.04 1 0 5750 $0.00 8400 $0.00 13454.88gb-s $0.42 22049420 $4.41 396430 $0.40 26340 $0.03 11.36gb $0.08 $5.37
67+
2022-05-18 222690 $0.03 1 0 7070 $0.00 7770 $0.00 13102.70gb-s $0.41 23515670 $4.70 375390 $0.38 33750 $0.03 11.41gb $0.08 $5.63
68+
2022-05-19 207190 $0.03 1 0 6080 $0.00 11120 $0.00 13846.00gb-s $0.43 12458810 $2.49 341840 $0.34 30950 $0.03 11.45gb $0.08 $3.41
69+
2022-05-20 195080 $0.03 3 0 7300 $0.00 9270 $0.00 13611.98gb-s $0.43 11319860 $2.26 340280 $0.34 27940 $0.03 11.50gb $0.08 $3.16
70+
2022-05-21 130420 $0.02 3 0 5500 $0.00 9430 $0.00 14031.59gb-s $0.44 26076580 $5.22 187880 $0.19 20880 $0.02 11.52gb $0.08 $5.96
71+
2022-05-22 151510 $0.02 2 0 7450 $0.00 10590 $0.00 14004.85gb-s $0.44 54990540 $11.00 181440 $0.18 23980 $0.02 11.55gb $0.08 $11.74
72+
73+
est 30-day $0.85 $0.00 $0.04 $10.61 $106.48 $9.49 $0.80 $2.28 $130.54
74+
minus free $0.70 $0.00 $0.04 $0.00 $106.28 $8.49 $0.00 $2.08 $117.58
75+
76+
per namespace:
77+
$113.17 2c86df7138295fe4a808601461309da1 script1 BetaDO
78+
$8.18 51154e6f3f283f6585deac84d777a8b8 script7 AlphaDO
79+
$6.89 4b5753137fdbb49fe107047c4bc509ae script3 DeltaDO
80+
$0.02 c08e8625b704b4efbbf52539ab22cbc6 script2 GammaDO
81+
$0.00 0785a5f2fa63e846e5b745aa5fb30625 script5 ZetaDO
82+
$0.00 7642f180e7a7adae1cc444587ed22940 script4 EpsilonDO
83+
$0.00 7fd47b04e803150107753bfa2a77130d script6 EtaDO
84+
```

cli/analytics/r2.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
order: 2
3-
summary: Develop and deploy a static docs site to Cloudflare Pages
3+
summary: Dump R2 stats via the Cloudflare GraphQL Analytics API
44
title: denoflare analytics r2
55
type: overview
66
---
@@ -32,3 +32,50 @@ OPTIONS:
3232
--help Print help information
3333
--verbose Toggle verbose output (when applicable)
3434
```
35+
36+
## Example output
37+
38+
```
39+
$ dfd analytics r2 --start 2022-04-24 --end 2022-05-22
40+
41+
date class-a class-b egress storage total.cost
42+
2022-04-24 88 $0.00 39 $0.00 0.0003gb $0.00 0.00gb $0.00 $0.00
43+
2022-04-25 132 $0.00 22 $0.00 0.0019gb $0.00 1.02gb $0.00 $0.00
44+
2022-04-26 51 $0.00 0 $0.00 0.0000gb $0.00 1.22gb $0.00 $0.00
45+
2022-04-27 67 $0.00 12 $0.00 1.0000gb $0.00 4.58gb $0.00 $0.00
46+
2022-04-28 18 $0.00 18 $0.00 0.0000gb $0.00 1.02gb $0.00 $0.00
47+
2022-04-30 642 $0.00 4 $0.00 0.0000gb $0.00 5.62gb $0.00 $0.01
48+
2022-05-01 505 $0.00 0 $0.00 0.0000gb $0.00 5.28gb $0.00 $0.00
49+
2022-05-09 14 $0.00 4 $0.00 0.0000gb $0.00 1.77gb $0.00 $0.00
50+
2022-05-10 199 $0.00 68 $0.00 0.0184gb $0.00 28.27gb $0.01 $0.02
51+
2022-05-11 424 $0.00 423 $0.00 0.0013gb $0.00 28.27gb $0.01 $0.02
52+
2022-05-12 245 $0.00 389 $0.00 0.0000gb $0.00 28.27gb $0.01 $0.02
53+
2022-05-13 0 $0.00 8 $0.00 0.0000gb $0.00 28.27gb $0.01 $0.01
54+
2022-05-14 12 $0.00 14 $0.00 0.0000gb $0.00 28.27gb $0.01 $0.01
55+
2022-05-15 11 $0.00 0 $0.00 0.0000gb $0.00 28.27gb $0.01 $0.01
56+
2022-05-16 5 $0.00 4 $0.00 0.0000gb $0.00 28.27gb $0.01 $0.01
57+
2022-05-17 14 $0.00 3 $0.00 0.0000gb $0.00 58.66gb $0.03 $0.03
58+
2022-05-18 97 $0.00 52 $0.00 0.0000gb $0.00 58.68gb $0.03 $0.03
59+
2022-05-19 129 $0.00 93 $0.00 0.0000gb $0.00 58.68gb $0.03 $0.03
60+
2022-05-20 94 $0.00 139 $0.00 0.0000gb $0.00 58.68gb $0.03 $0.03
61+
2022-05-21 114 $0.00 136 $0.00 0.0000gb $0.00 58.68gb $0.03 $0.03
62+
2022-05-22 82 $0.00 57 $0.00 0.0000gb $0.00 58.68gb $0.03 $0.03
63+
64+
total 2943 $0.01 1485 $0.01 1.0219gb $0.00 $0.29 $0.31
65+
66+
per bucket:
67+
cost storage objects egress bucket
68+
$0.18 33.73gb 16 1.0000gb delta
69+
$0.10 22.87gb 815 0.0000gb zeta
70+
$0.02 2.01gb 25 0.0022gb alpha
71+
$0.01 0.00gb 93 0.0017gb mu
72+
$0.00 0.02gb 11 0.0000gb lambda
73+
$0.00 0.00gb 2 0.0000gb nu
74+
$0.00 0.00gb 2 0.0000gb epsilon
75+
$0.00 0.05gb 10 0.0180gb eta
76+
$0.00 0.00gb 0 0.0000gb beta
77+
$0.00 0.00gb 1 0.0000gb gamma
78+
$0.00 0.00gb 0 0.0000gb theta
79+
$0.00 0.00gb 0 0.0000gb iota
80+
$0.00 0.00gb 0 0.0000gb kappa
81+
```

cli/index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ https://raw.githubusercontent.com/skymethod/denoflare/v0.5.0/cli/cli.ts serve x
4747

4848
We'll start posting standard binary releases (via [deno compile](https://deno.land/manual@v1.22.0/tools/compiler)) when `denoflare` nears a stable feature set.
4949

50+
Check out the [Releases](https://github.com/skymethod/denoflare/releases) page for the latest version number tag, and details about each pre-release.
51+
5052
## Command help
5153
Once `denoflare` is installed, the cli includes docs on each command and subcommand, available via `--help`.
5254

@@ -68,9 +70,9 @@ COMMANDS:
6870
[push](/cli/push) Upload a Cloudflare worker script to Cloudflare
6971
[tail](/cli/tail) View a real-time stream of logs from a published Cloudflare worker
7072
[site](/cli/site) Develop and deploy a static docs site to Cloudflare Pages
71-
analytics Dump stats via the Cloudflare GraphQL Analytics API
72-
cfapi Call the Cloudflare REST API
73-
r2 Manage Cloudflare R2 storage using the S3 compatibility API
73+
[analytics](/cli/analytics) Dump stats via the Cloudflare GraphQL Analytics API
74+
[cfapi](/cli/cfapi) Call the Cloudflare REST API
75+
[r2](/cli/r2) Manage Cloudflare R2 storage using the S3 compatibility API
7476
version Dump cli version
7577
7678
For command-specific help: denoflare <command> --help

cli/push.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
order: 2
3-
summary: Upload a worker script to Cloudflare Workers
3+
summary: Upload a Cloudflare worker script to Cloudflare
44
type: overview
55
---
66

cli/site/generate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
order: 2
3-
summary: Generate static output for Cloudfare Pages
3+
summary: Develop and deploy a static docs site to Cloudflare Pages
44
title: denoflare site generate
55
type: overview
66
---

cli/site/serve.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
order: 3
3-
summary: Host static Cloudflare Pages site locally
3+
summary: Host a static Cloudflare Pages site in a local Deno web server
44
title: denoflare site serve
55
type: overview
66
---

cli/tail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
order: 3
3-
summary: View a stream of logs from a published worker
3+
summary: View a real-time stream of logs from a published Cloudflare worker
44
type: overview
55
---
66

examples/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ summary: Example projects made with Denoflare
55
# Examples
66

77
- [Webtail for Cloudflare Workers](/examples/webtail) - View live requests and logs from Cloudflare Workers from the comfort of your browser.
8+
9+
- [Transform Images with WASM in a Cloudflare Worker](/examples/transform-images-wasm) - Using WebAssembly from Photon and pngs.

examples/transform-images-wasm.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Transform Images with WASM
3+
summary: Transform Images with WASM in a Cloudflare Worker, using WebAssembly from Photon and pngs.
4+
order: 2
5+
---
6+
7+
# Transform Images with WASM in a Cloudflare Worker
8+
9+
Prototype demonstrating running image resizing and other transforms completely inside a Cloudflare Worker.
10+
11+
<Aside>
12+
13+
Hosted version: https://image-demo.denoflare.dev/
14+
15+
</Aside>
16+
17+
<img src="/images/transform-images-wasm.png" class="large-img" style="margin: auto">
18+
19+
Sample input images come from [Unsplash](https://unsplash.com/).
20+
21+
Source is available in the [Denoflare repo](https://github.com/skymethod/denoflare/tree/v0.5.0/examples/image-demo-worker).
22+
23+
## Deploy it to your own account
24+
25+
Since it is a standard module-based Cloudflare Worker, you can deploy it like any other worker with `denoflare push`:
26+
27+
First, register a new app with Unsplash (free), you'll need your app name and _ixid_ as worker environment vars, to comply their TOS.
28+
29+
```
30+
denoflare push --name image-demo \
31+
https://raw.githubusercontent.com/skymethod/denoflare/v0.5.0/examples/image-demo-worker/worker.ts \
32+
--text-binding unsplashAppName:your_app_name \
33+
--text-binding unsplashIxid:your_ixid
34+
```
35+
36+
## Host it locally
37+
38+
Since it is a standard module-based Cloudflare Worker, you can run it locally like any other worker with `denoflare serve`:
39+
40+
First, register a new app with Unsplash (free), you'll need your app name and _ixid_ as worker environment vars, to comply their TOS.
41+
```
42+
denoflare serve \
43+
https://raw.githubusercontent.com/skymethod/denoflare/v0.5.0/examples/image-demo-worker/worker.ts
44+
--text-binding unsplashAppName:your_app_name \
45+
--text-binding unsplashIxid:your_ixid
46+
```

examples/webtail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ denoflare push --name webtail \
5151

5252
## Host it locally
5353

54-
Since it is a standard module-based Cloudflare Worker, you can serve it locally like any other worker with `denoflare serve`:
54+
Since it is a standard module-based Cloudflare Worker, you can run it locally like any other worker with `denoflare serve`:
5555

5656
```
5757
denoflare serve \

images/transform-images-wasm.png

1.92 MB
Loading

index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ Denoflare can:
3333
- see [denoflare tail](/cli/tail)
3434
- Generate a customizable static documentation site for Cloudflare Pages in the style of Cloudflare's [Docs Engine](https://developers.cloudflare.com/docs-engine/)
3535
- see [denoflare site](/cli/site)
36+
- Keep track of your Durable Objects and R2 costs and statistics
37+
- see [denoflare analytics](/cli/analytics)
38+
- Call the Cloudflare REST API from the command line
39+
- see [denoflare cfapi](/cli/cfapi)
40+
- Manage Cloudflare R2 storage using the S3 compatibility API
41+
- see [denoflare r2](/cli/r2)
3642

3743
[Learn more about the CLI](/cli)
3844

@@ -45,6 +51,8 @@ denoflare push https://raw.githubusercontent.com/skymethod/denoflare/v0.5.0/exam
4551
## Roadmap
4652
Denoflare is still under active initial development (pre 1.0), but is completely open-source and can be used as is.
4753

54+
[Releases](https://github.com/skymethod/denoflare/releases)
55+
4856
After getting this documentation site ([denoflare.dev](https://denoflare.dev)) hosted on Cloudflare Pages generated by `denoflare site`, the next focus is fleshing out unimplemented parts of the local dev Workers emulation environment, making it handle even the most complicated worker scenarios.
4957

5058
Join the project over on [the Denoflare GitHub repo](https://github.com/skymethod/denoflare).

0 commit comments

Comments
 (0)