• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Logflare / logflare / 64687dc3fb5ead1d49839769adef1db8ed53bf86
82%

Build:
DEFAULT BRANCH: main
Ran 22 Jun 2026 10:17AM UTC
Jobs 1
Files 484
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Jun 2026 10:03AM UTC coverage: 81.177% (+0.03%) from 81.15%
64687dc3fb5ead1d49839769adef1db8ed53bf86

push

github

web-flow
perf(ingest): claim pending events via an atomic claim counter (#3617)

* perf(ingest queue): claim pending events via update_counter CAS-lite

take_pending_ids/2 claimed each event with a per-id :ets.select_replace,
which compiles a match spec per id in the BIF layer — the dominant cost on
the BigQuery claim hot path.

Replace it with an atomic claim counter held in a new 5th tuple field. The
row is now {event_id, status, event, size, claim}, and a claim succeeds when
:ets.update_counter/3 transitions claim from 0 to 1. This is multi-consumer
safe (only the 0->1 winner takes the event) like select_replace, but uses a
direct integer op with no per-id match-spec compilation, and needs no dedup
pass since write_concurrency resize-duplicates lose the CAS naturally.

Re-insertion resets the counter to 0, so both requeue paths keep events
claimable: BufferProducer failure requeue (via add_to_table) and the
QueueJanitor stale :processing -> :pending reset. Also drops a redundant
:ets.info(:size) read in take_pending_ids, since get_tid/1 already confirms
the table is live.

Benchmarks show ~4.9x faster claims (652 -> 132 us per 1000-event batch).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(ingest queue): take_pending_ids tests and claim-strategy benchmark

Add a take_pending_ids/2 describe block covering claim correctness, the
remainder-left-pending case, no re-claim across sequential calls, and a
concurrent-claim race test asserting no event is claimed twice (the
multi-consumer guarantee).

Add a profiling benchmark comparing claim strategies (update_counter,
select_replace, update_element, single compiled select_replace) with
recorded results and notes on why the single-compile approach is rejected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(ingest queue): cover claim-reset reclaim cycle for take_pending_ids

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(inge... (continued)

10 of 11 new or added lines in 3 files covered. (90.91%)

1 existing line in 1 file now uncovered.

13227 of 16294 relevant lines covered (81.18%)

5167.31 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
86.72
-0.29% lib/logflare/backends/ingest_event_queue.ex

Coverage Regressions

Lines Coverage ∆ File
1
30.77
-3.85% lib/logflare/sources/source/text_notification_server.ex
Jobs
ID Job ID Ran Files Coverage
1 64687dc3fb5ead1d49839769adef1db8ed53bf86.1 22 Jun 2026 10:17AM UTC 484
81.18
GitHub Action Run
Source Files on build 64687dc3fb5ead1d49839769adef1db8ed53bf86
  • Tree
  • List 484
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 64687dc3 on github
  • Prev Build on main (#F3DF6597...)
  • Next Build on main (#5D9CBECC...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc