chore: cleanup
This commit is contained in:
@@ -4,14 +4,14 @@
|
|||||||
|
|
||||||
Lightweight URL shortener API service with minimal resource requirements. Average memory consumption is under **20MiB** and single CPU core consumption under 20%.
|
Lightweight URL shortener API service with minimal resource requirements. Average memory consumption is under **20MiB** and single CPU core consumption under 20%.
|
||||||
|
|
||||||
bit is highly performant, achieving in average **3K RPS** with a minimum latency of 56ms (100K requests using 100 connections, [benchmark](docs/SETUP.md#benchmark)).
|
Performance: Avg **3K reqs/sec**, latency 56ms (100K requests using 100 connections, [benchmark](docs/SETUP.md#benchmark)).
|
||||||
|
|
||||||
Self-hosted with [Dokku](docs/SETUP.md#dokku) and [Docker Compose](docs/SETUP.md#docker-compose).
|
Self-hosted with [Dokku](docs/SETUP.md#dokku) and [Docker Compose](docs/SETUP.md#docker-compose).
|
||||||
|
|
||||||
Images available on [Docker Hub](https://hub.docker.com/r/sjdonado/bit/tags).
|
Images available on [Docker Hub](https://hub.docker.com/r/sjdonado/bit/tags).
|
||||||
|
|
||||||
## Why bit?
|
## Why bit?
|
||||||
It is feature-complete by design. Its strength lies in simplicity, a reliable URL shortener without unnecessary bloat. Bug fixes will continue, but new features aren't planned.
|
It is feature-complete by design. Its strength lies in simplicity, reliable without unnecessary bloat. Bug fixes will continue, but new features aren't planned.
|
||||||
|
|
||||||
- Minimal tracking setup: Country, browser, os, referer. No cookies or persistent tracking mechanisms are used beyond what's available from a basic client's request.
|
- Minimal tracking setup: Country, browser, os, referer. No cookies or persistent tracking mechanisms are used beyond what's available from a basic client's request.
|
||||||
- Flexible request forwarding system passes client context to destinations via standard `X-Forwarded-For` and `User-Agent` headers, enabling advanced tracking and integration capabilities when needed.
|
- Flexible request forwarding system passes client context to destinations via standard `X-Forwarded-For` and `User-Agent` headers, enabling advanced tracking and integration capabilities when needed.
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ module App::Controllers
|
|||||||
end
|
end
|
||||||
|
|
||||||
link.clicks = [] of App::Models::Click
|
link.clicks = [] of App::Models::Click
|
||||||
|
|
||||||
render_json({"data" => App::Serializers::Link.new(link)}, 201)
|
render_json({"data" => App::Serializers::Link.new(link)}, 201)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -71,7 +72,8 @@ module App::Controllers
|
|||||||
query = query.order_by("id DESC").limit(limit + 1)
|
query = query.order_by("id DESC").limit(limit + 1)
|
||||||
|
|
||||||
links = Database.all(Link, query)
|
links = Database.all(Link, query)
|
||||||
return paginated_response(links, limit) { |link| App::Serializers::Link.new(link) }
|
|
||||||
|
paginated_response(links, limit) { |link| App::Serializers::Link.new(link) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def get
|
def get
|
||||||
@@ -106,7 +108,8 @@ module App::Controllers
|
|||||||
query = query.order_by("id DESC").limit(limit + 1)
|
query = query.order_by("id DESC").limit(limit + 1)
|
||||||
|
|
||||||
clicks = Database.all(Click, query)
|
clicks = Database.all(Click, query)
|
||||||
return paginated_response(clicks, limit) { |click| App::Serializers::Click.new(click) }
|
|
||||||
|
paginated_response(clicks, limit) { |click| App::Serializers::Click.new(click) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|||||||
+3
-3
@@ -113,9 +113,9 @@ RAM: 1GiB
|
|||||||
CPU: Apple M3 Pro
|
CPU: Apple M3 Pro
|
||||||
|
|
||||||
**Summary**
|
**Summary**
|
||||||
- Requests/secs average central tendency: (1328.47 + 1357.19 + 1407.03) / 3 + (1785.03 + 1789.06 + 1778.84) / 3 = 3148.54 reqs/sec
|
- Reqs/sec (average central tendency): (1328.47 + 1357.19 + 1407.03) / 3 + (1785.03 + 1789.06 + 1778.84) / 3 = 3148.54 reqs/sec
|
||||||
- Latency average central tendency: (76.19 + 74.68 + 71.85) / 3 - (29.43 + 14.50 + 9.42) / 3 = 56.4ms
|
- Latency (average central tendency): (76.19 + 74.68 + 71.85) / 3 - (29.43 + 14.50 + 9.42) / 3 = 56.4ms
|
||||||
- Latency for conservative capacity planning: (76.19 + 74.68 + 71.85) / 3 + (29.43 + 14.50 + 9.42) / 3 = 89.63ms
|
- Latency (for conservative capacity planning): (76.19 + 74.68 + 71.85) / 3 + (29.43 + 14.50 + 9.42) / 3 = 89.63ms
|
||||||
- Best single run: 18041.44 reqs/sec
|
- Best single run: 18041.44 reqs/sec
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user