elikim
Hi!
I’m running some benchmarks and trying to see how long it takes a job to complete in chunked jobs. I’m running this query
select AVG(completed_at - attempted_at) AS average_duration, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY completed_at - attempted_at) AS median_duration
from oban_jobs
where worker = 'MyWorker'
which I think would accurately show the execution time of a single job but it’s showing some surprising results (55s - 62s when the expectation is around a second). Do you have any suggestions on how to find the execution time of a single job in a chunk?
Thanks!
Eli
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
sorenone
Hello,
Measuring the time for a single job won’t be meaningful for a chunk. Instead, we group by chunk.
Each chunk has a leader and that’s recorded in the
attempted_bycolumn. So, here is how you could do it based on the query you sent:The state is set to
completedto prevent measuring the in-progress chunks.Hope this helps!
elikim
Hi! Thank you and that definitely does help. I am seeing a bit of variance in the query and want to understand it a bit more deeply. Is attempted at set when Oban first attempts a job regardless of if the chunk is run or not?
Would the flow be something like
Oban queries for job
Oban gets job and sets attempted at
Oban checks to see if the job fits in a chunk
Chunk can be run or not
That would totally explain the variance to me as we set the chunk timeout to 10 minutes!
sorenone
You have a great point.
That’s mostly right. The chunk will always run, even if it isn’t “full”, and the first job will always have an
attempted_at.The rest of the chunk is all fetched together when it reaches the
sizeortimeout. You could get a more accurate value by usingmax(attempted_at)instead. That’s when the chunk actually starts processing.elikim
Thanks @sorenone!
GishaJamesB
I noticed that first job is executed immediately, without waiting for the timeout, but rest of the jobs are fetched and executed together. Is it possible to execute first job also as part of the group?