HangfireIO / HangfireIO/Hangfire
Realtime Graph numbers aren't normalized to the second.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
The values for the Realtime Graph aren't normalized to the second so the values get skewed.
In this example, there are 5 servers processing a bunch of tasks in the background where the job is just a Thread.Sleep(1000); -- at 20 threads/server, it is processing 100 tasks/second on average. However, since it is updating every 2 seconds and not normalizing the number, the graph gets essentially doubled (or a little higher depending on call latency).

The issue seems to stem from the javascript in RealtimeGraph.prototype.appendHistory -- it should be taking the last update time into account and normalizing the succeeded/failed calculated values (https://github.com/HangfireIO/Hangfire/blob/master/src/Hangfire.Core/Dashboard/Content/js/hangfire.js#L101)
[Note: This graph will jump up to 300 if it is running in a background tab in Chrome because the stats poll interval increased to once every 3 seconds -- which is how I first noticed it]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Hangfire.Core/Dashboard/Content/js/hangfire.js at RealtimeGraph.prototype.appendHistory. Check how the last update time and succeeded/failed values are used, then normalize the graph values to a per-second rate despite the polling interval. Done means a two-second update and a three-second background-tab update no longer double or triple the displayed rate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100