prop/vendor/oban_met/lib/oban/met/value.ex
Graham McIntire caad7d90a7 Mount Oban Web dashboard at /admin/oban
Vendor oban_web 2.12.1 and oban_met 1.1.0 (taken from the
towerops-web2 vendor tree), bump oban to ~> 2.21, and mount the Oban
dashboard at /admin/oban behind the existing require_admin on_mount
hook. Adds an admin-only "Oban" nav link and extends the Dockerfile
to copy vendor/ before deps.get so production builds pick up the
path dependencies.
2026-04-09 14:07:33 -05:00

44 lines
873 B
Elixir

defprotocol Oban.Met.Value do
@moduledoc """
Tracked data access functions.
"""
@doc """
Add or append a new value to the data type.
"""
def add(struct, value)
@doc """
Merge two values into one.
"""
def merge(struct_1, struct_2)
@doc """
Compute the quantile for a value.
"""
def quantile(struct, quantile)
@doc """
Sum all data points for a value.
"""
def sum(struct)
@doc """
Union two values by reducing them into one.
"""
def union(struct_1, struct_2)
end
for module <- [Oban.Met.Values.Gauge, Oban.Met.Values.Sketch] do
defimpl Oban.Met.Value, for: module do
defdelegate add(struct, value), to: @for
defdelegate merge(struct_1, struct_2), to: @for
defdelegate quantile(struct, quantile), to: @for
defdelegate sum(struct), to: @for
defdelegate union(struct_1, struct_2), to: @for
end
end