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

jallum / bedrock / 84f2ec5d5a2517957ec3c4741969ffc8414a4994

13 Aug 2025 02:57AM UTC coverage: 58.423%. Remained the same
84f2ec5d5a2517957ec3c4741969ffc8414a4994

push

github

jallum
0.1.2

- Reworked and simplified documentation
- Increased test coverage
- Project housekeeping

1515 of 2481 new or added lines in 105 files covered. (61.06%)

424 existing lines in 63 files now uncovered.

2112 of 3615 relevant lines covered (58.42%)

1870.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/lib/bedrock/data_plane/commit_proxy/batch.ex
1
defmodule Bedrock.DataPlane.CommitProxy.Batch do
2
  @moduledoc false
3
  @type reply_fn :: ({:ok, Bedrock.version()} | {:error, :abort} -> :ok)
4

5
  @type t :: %__MODULE__{
6
          started_at: Bedrock.timestamp_in_ms(),
7
          finalized_at: Bedrock.timestamp_in_ms() | nil,
8
          last_commit_version: Bedrock.version(),
9
          commit_version: Bedrock.version(),
10
          n_transactions: non_neg_integer(),
11
          buffer: [{reply_fn(), Bedrock.transaction()}]
12
        }
13
  defstruct started_at: nil,
14
            finalized_at: nil,
15
            last_commit_version: nil,
16
            commit_version: nil,
17
            n_transactions: 0,
18
            buffer: []
19

20
  @spec new_batch(
21
          Bedrock.timestamp_in_ms(),
22
          last_commit_version :: Bedrock.version(),
23
          commit_version :: Bedrock.version()
24
        ) :: t()
25
  def new_batch(started_at, last_commit_version, commit_version) do
UNCOV
26
    %__MODULE__{
×
27
      started_at: started_at,
28
      last_commit_version: last_commit_version,
29
      commit_version: commit_version,
30
      n_transactions: 0,
31
      buffer: []
32
    }
33
  end
34

35
  @spec transactions_in_order(t()) :: [{reply_fn(), Bedrock.transaction()}]
36
  def transactions_in_order(t),
37
    do: t.buffer |> Enum.reverse()
20✔
38

39
  @spec all_callers(t()) :: [reply_fn()]
40
  def all_callers(t),
UNCOV
41
    do: t.buffer |> Enum.map(&elem(&1, 0))
×
42

43
  @spec add_transaction(t(), Bedrock.transaction(), reply_fn()) :: t()
44
  def add_transaction(t, transaction, reply_fn),
UNCOV
45
    do: %{t | buffer: [{reply_fn, transaction} | t.buffer], n_transactions: t.n_transactions + 1}
×
46

47
  @spec set_finalized_at(t(), Bedrock.timestamp_in_ms()) :: t()
48
  def set_finalized_at(t, finalized_at),
UNCOV
49
    do: %{t | finalized_at: finalized_at}
×
50
end
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