hugolnx

hugolnx

Application using GenStage with pretty tracing for studying purposes

Hey!

I created a simple project using GenStage only to study more deeply how the processes comunicate with each other. Instead of using the default erlang tracer, I implemented a prettier tracer and also added some extra logging stuff, that help me understand better how the stages behave with different max_demand and min_demand configurations.

The Stages

[Stock] ----------> [Chef] ------------> [Checkout] >>>>>>>>> Checkout.Task

A example of the tracing logs

15:50.768 trace: :chef      => :stock                    {:subscribe, nil, [min_demand: 3, max_demand: 5]}
15:50.768 trace: :chef      => :stock                    {:ask, 5}
15:50.769 trace: :checkout  => :chef                     {:subscribe, nil, [min_demand: 0, max_demand: 2]}
15:50.769 trace: :checkout  => :chef                     {:ask, 2}
15:52.031 trace: :stock     => :chef                     {:snt, 5}
15:53.037 trace: :chef      => :checkout                 {:snt, 2}
15:53.038 trace: :chef      => :stock                    {:ask, 2}
15:53.039 trace: :checkout  => {:task, #PID<0.255.0>}    :acai1029
15:53.039 trace: :checkout  => {:task, #PID<0.256.0>}    :acai1093
15:53.543 trace: :stock     => :chef                     {:snt, 2}
15:54.039 trace: :checkout  => :chef                     {:ask, 1}
...

Repository: https://github.com/HugoLnx/acai-restaurant

Hope it help. :wink:

PS.: I created a few issues with some ideas.

Where Next?

Popular in Guides/Tuts Top

New
hlx
Typed my very first blog post ever, hope it will help some people https://henricus.xyz/roll-your-own-email-password-authentication-with...
New
GenericJam
Just leaving some breadcrumbs for future me and future others like me. Connect with TCP (not secured) - most servers will reject but use...
New
redfloyd
Greetings fellow alchemists ! I have started to write an open-source interpreter in Elixir (https://github.com/nicolasdilley/dwarf-inter...
New
kokolegorille
Hello dear alchemists, There was this question some days ago here about the deployment to a VPS. As I was in the process of deploying t...
New
f0rest8
Hi, TLDR: form attribute set on the input fields and button submit. I just wanted to share a solution I discovered when making live inl...
New
TwistingTwists
This is a thread to note down things/best practices encountered in LiveBeats App as I explore the source code. Found this usage of r...
New
fmcgeough
pipe into case? I use that fairly frequently…unless I’m misunderstanding what you’re wanting…could be… its still very early… str = "Hell...
New
zookzook
If you want to use the MongoDB in your next Killer-App-Project, but you did not dare ask because otherwise many would advise you to use P...
New
niku
I write an article Parameterized testing with ExUnit.The key concept is using ExUnit.Case.register_test/4 such as ExUnit.start() defmod...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

We're in Beta

About us Mission Statement