Dashboard graphs load every job into memory to count them

Aperta
#71 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
46/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, mongodb

Direzione di ricerca

Start in src/TickerNet.Dashboard/Infrastructure/Dashboard/TickerDashboardRepository.cs at the count calls around lines 73, 212, 334 and 373, then read TickerEFCorePersistenceProvider.cs around lines 92-101 and 273-277 to see how the null filter materializes rows. Add count-by-status and count-by-day methods to the persistence provider interface and both EF Core (GROUP BY) and MongoDB implementations, call them from the repository, and write a failing test first. Done when the dashboard aggregates in the store and the new test passes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

.NET bug

What happens

The dashboard's home page and graph endpoints load every row into memory to count them by status. TickerDashboardRepository (src/TickerNet.Dashboard/Infrastructure/Dashboard/TickerDashboardRepository.cs, around lines 73, 212, 334 and 373) calls the persistence provider with a null filter, and the EF Core provider then loads all time tickers with their children (TickerEFCorePersistenceProvider.cs, around lines 92-101 and 273-277), and the same for cron occurrences. The counting happens in memory.

Impact

On a store with many finished jobs, opening the dashboard can use a lot of memory and run the app out of it. High. Retention (#51) reduces the table size but doesn't fix the query.

Fix idea

Add provider methods that count by status (and by day for the range graphs) in the store, with GROUP BY in EF Core and aggregations in MongoDB, and use them from the repository.


Found while checking which problems that TickerQ fixed after the fork still exist in TickerNet. Fix it from this description and TickerNet's own code only: never read or copy code from TickerQ 10.5.0 or later (see CONTRIBUTING.md). Please add a test that fails before the fix.

Lingua principale
C#
Stelle
0
Fork
2
Merge medio
1h 8m
PR unite (30g)
24

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TickerNet/TickerNet

Tutte le issue di TickerNet/TickerNet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.