kickinespresso

kickinespresso

Recording Telemetry for Elixir/Phoenix Applications for performance comparisons

I am looking for a way for benchmarking and recording the metrics from a Phoenix/Elixir App as part of my prototyping/development process. I’d like to record and compare test runs against each other to see how they perform between iterations. Ideally, I could export the metrics to .csv or a .json file and import them into Pandas/Seaborn for visualization (or even possibly LiveBook). benchee is great, but it fits better for benchmarking specific functions or modules instead of a whole application. I’ve been looking at beamchmark, but it sort of relies on setting up things in a .exs file as a scenario.

My goal is to be able to compare and visualize changes to see if there is performance improvements. For Example:

  • Test Run 1:
    • vm.memory.total
    • vm.total_run_queue_lengths.cpu
    • … other metrics and custom telemetry
  • Test Run 2:
    • vm.memory.total
    • vm.total_run_queue_lengths.cpu
    • … other metrics and custom telemetry

What I am considering as an approach is to record some of the metrics produced from phoenix_live_dashboard or [:telemetry] and log them to a file for the test run. Exporting the telemetry via the Prometheus Exporter prom_ex packages all the data points nicely, but I’d need to scrape them using Prometheus and record to a file. Alternatively, I was considering using the telemetry_influxdb telemetry reporter to InfluxDB to record the Telemetry events.

The reason I am initially considering logging things to a file is that it seems like it is easier to manipulate, review and analyze after test runs, although I’m open to other ideas on what might enable easier/better analysis for rapid iterations during the development cycle.

Additionally, are there any examples of using performance metrics in test suites?

Most Liked

stefanchrobot

stefanchrobot

Not answering your question in full, but I think you can roll your own telemetry reporter pretty easily - you should be able to easily extend the provided console reporter. The link to the sources is broken, so I’m posting it here: telemetry_metrics/lib/telemetry_metrics/console_reporter.ex at main · beam-telemetry/telemetry_metrics · GitHub

Where Next?

Popular in Questions Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
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
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30877 112
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New

We're in Beta

About us Mission Statement