Skip to content

Commit a29ff34

Browse files
committed
rename diagrams to architecture and provide a more comprehensive README
1 parent 364bb86 commit a29ff34

File tree

8 files changed

+52
-6
lines changed

8 files changed

+52
-6
lines changed

architecture/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Architecture
2+
3+
This folder contains notes about benchee's architecture and some diagrams showing said architecture.
4+
5+
The architecture is relatively simple but flexible and could probably best be described as _pipes_.
6+
The goal is to allow for extension and customization.
7+
There is a big structure called `Benchee.Suite` which is progressively enhanced by multiple steps.
8+
Each of these steps should be exchangeable and they're all part of the public API.
9+
Each step is just a function to make using and exchanging them easy.
10+
11+
The order of these steps is best illustrated by the implementation of `Benchee.run/2` to see in which order they're called:
12+
13+
```elixir
14+
def run(jobs, config \\ []) when is_list(config) do
15+
config
16+
|> Benchee.init()
17+
|> Benchee.system()
18+
|> add_benchmarking_jobs(jobs)
19+
|> Benchee.collect()
20+
|> Benchee.statistics()
21+
|> Benchee.load()
22+
|> Benchee.relative_statistics()
23+
|> Formatter.output()
24+
|> Benchee.profile()
25+
end
26+
27+
defp add_benchmarking_jobs(suite, jobs) do
28+
Enum.reduce(jobs, suite, fn {key, function}, suite_acc ->
29+
Benchee.benchmark(suite_acc, key, function)
30+
end)
31+
end
32+
```
33+
34+
## C4 diagrams
35+
36+
### Context
37+
38+
![context diagram](rendered/context.svg)
39+
40+
### Container
41+
42+
![container diagram](rendered/container.svg)
43+
44+
### Component
45+
46+
![component diagram](rendered/component.svg)
47+
48+
49+
## Working with the diagrams
50+
51+
To render them you need a a tool such as [the PlantUML plugin for VScode](https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml).
52+
For that to work, you also need to install `graphviz` (`sudo apt-get install graphviz`)

diagrams/README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)