furiko-io / furiko

Kubernetes cron and batch job platform
https://furiko.io
Apache License 2.0
483 stars 21 forks source link

feat(croncontroller): Implement heap-based Schedule #95

Closed irvinlim closed 2 years ago

irvinlim commented 2 years ago

Improves the performance of the CronController by switching to a min-heap instead of iterating all JobConfigs every second.

codecov[bot] commented 2 years ago

Codecov Report

Merging #95 (322f328) into main (6d36ac5) will increase coverage by 0.15%. The diff coverage is 80.10%.

@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
+ Coverage   63.35%   63.50%   +0.15%     
==========================================
  Files         203      205       +2     
  Lines       10735    10958     +223     
==========================================
+ Hits         6801     6959     +158     
- Misses       3571     3621      +50     
- Partials      363      378      +15     
Impacted Files Coverage Δ
...execution/controllers/croncontroller/controller.go 24.00% <0.00%> (-1.00%) :arrow_down:
...xecution/controllers/croncontroller/cron_worker.go 66.48% <70.87%> (-4.77%) :arrow_down:
pkg/execution/util/schedule/schedule.go 75.72% <75.72%> (ø)
pkg/utils/heap/heap.go 98.92% <98.92%> (ø)
pkg/execution/util/schedule/option.go 100.00% <100.00%> (ø)
...kg/execution/controllers/croncontroller/metrics.go 0.00% <0.00%> (-100.00%) :arrow_down:
pkg/runtime/reconciler/metrics.go 42.10% <0.00%> (-26.32%) :arrow_down:
pkg/execution/controllers/croncontroller/ticker.go 87.50% <0.00%> (-12.50%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6d36ac5...322f328. Read the comment docs.

qingyuanz commented 2 years ago

LGTM!