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/console_reporter.ex at main · beam-telemetry/telemetry_metrics · GitHub

Where Next?

Popular in Questions Top

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
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
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
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
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
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

Other popular topics Top

William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement