Page MenuHomePhorge

No OneTemporary

Size
9 KB
Referenced Files
None
Subscribers
None
diff --git a/lib/prometheus/metric/counter.ex b/lib/prometheus/metric/counter.ex
index 81f66d4..bf88147 100644
--- a/lib/prometheus/metric/counter.ex
+++ b/lib/prometheus/metric/counter.ex
@@ -1,71 +1,67 @@
defmodule Prometheus.Metric.Counter do
alias Prometheus.Metric
require Prometheus.Error
defmacro new(spec) do
- {registry, _, _} = Metric.parse_spec(spec)
-
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
- :prometheus_counter.new(unquote(spec), unquote(registry))
+ :prometheus_counter.new(unquote(spec))
)
end
end
defmacro declare(spec) do
- {registry, _, _} = Metric.parse_spec(spec)
-
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
- :prometheus_counter.declare(unquote(spec), unquote(registry))
+ :prometheus_counter.declare(unquote(spec))
)
end
end
defmacro inc(spec, value \\ 1) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_counter.inc(unquote(registry), unquote(name), unquote(labels), unquote(value))
)
end
end
defmacro dinc(spec, value \\ 1) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_counter.dinc(unquote(registry), unquote(name), unquote(labels), unquote(value))
)
end
end
defmacro reset(spec) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_counter.reset(unquote(registry), unquote(name), unquote(labels))
)
end
end
defmacro value(spec) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_counter.value(unquote(registry), unquote(name), unquote(labels))
)
end
end
end
diff --git a/lib/prometheus/metric/gauge.ex b/lib/prometheus/metric/gauge.ex
index 98ab63f..e553cd3 100644
--- a/lib/prometheus/metric/gauge.ex
+++ b/lib/prometheus/metric/gauge.ex
@@ -1,82 +1,78 @@
defmodule Prometheus.Metric.Gauge do
alias Prometheus.Metric
require Prometheus.Error
defmacro new(spec) do
- {registry, _, _} = Metric.parse_spec(spec)
-
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
- :prometheus_gauge.new(unquote(spec), unquote(registry))
+ :prometheus_gauge.new(unquote(spec))
)
end
end
defmacro declare(spec) do
- {registry, _, _} = Metric.parse_spec(spec)
-
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
- :prometheus_gauge.declare(unquote(spec), unquote(registry))
+ :prometheus_gauge.declare(unquote(spec))
)
end
end
defmacro set(spec, value) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_gauge.set(unquote(registry), unquote(name), unquote(labels), unquote(value))
)
end
end
defmacro set_to_current_time(spec) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_gauge.set_to_current_time(unquote(registry), unquote(name), unquote(labels))
)
end
end
defmacro track_inprogress(spec, fun) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_gauge.track_inprogress(unquote(registry), unquote(name), unquote(labels), unquote(fun))
)
end
end
defmacro reset(spec) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_gauge.reset(unquote(registry), unquote(name), unquote(labels))
)
end
end
defmacro value(spec) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_gauge.value(unquote(registry), unquote(name), unquote(labels))
)
end
end
end
diff --git a/lib/prometheus/metric/histogram.ex b/lib/prometheus/metric/histogram.ex
index 16d4e00..ff93081 100644
--- a/lib/prometheus/metric/histogram.ex
+++ b/lib/prometheus/metric/histogram.ex
@@ -1,87 +1,83 @@
defmodule Prometheus.Metric.Histogram do
alias Prometheus.Metric
require Prometheus.Error
defmacro new(spec) do
- {registry, _, _} = Metric.parse_spec(spec)
-
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
- :prometheus_histogram.new(unquote(spec), unquote(registry))
+ :prometheus_histogram.new(unquote(spec))
)
end
end
defmacro declare(spec) do
- {registry, _, _} = Metric.parse_spec(spec)
-
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
- :prometheus_histogram.declare(unquote(spec), unquote(registry))
+ :prometheus_histogram.declare(unquote(spec))
)
end
end
defmacro observe(spec, value \\ 1) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_histogram.observe(unquote(registry),
unquote(name), unquote(labels), unquote(value))
)
end
end
defmacro dobserve(spec, value \\ 1) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_histogram.dobserve(unquote(registry),
unquote(name), unquote(labels), unquote(value))
)
end
end
defmacro observe_duration(spec, fun) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_histogram.observe_duration(unquote(name),
unquote(registry), unquote(labels), unquote(fun))
)
end
end
defmacro reset(spec) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_histogram.reset(unquote(registry),
unquote(name), unquote(labels))
)
end
end
defmacro value(spec) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_histogram.value(unquote(registry),
unquote(name), unquote(labels))
)
end
end
end
diff --git a/lib/prometheus/metric/summary.ex b/lib/prometheus/metric/summary.ex
index e955525..93afffd 100644
--- a/lib/prometheus/metric/summary.ex
+++ b/lib/prometheus/metric/summary.ex
@@ -1,87 +1,83 @@
defmodule Prometheus.Metric.Summary do
alias Prometheus.Metric
require Prometheus.Error
defmacro new(spec) do
- {registry, _, _} = Metric.parse_spec(spec)
-
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
- :prometheus_summary.new(unquote(spec), unquote(registry))
+ :prometheus_summary.new(unquote(spec))
)
end
end
defmacro declare(spec) do
- {registry, _, _} = Metric.parse_spec(spec)
-
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
- :prometheus_summary.declare(unquote(spec), unquote(registry))
+ :prometheus_summary.declare(unquote(spec))
)
end
end
defmacro observe(spec, value \\ 1) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_summary.observe(unquote(registry),
unquote(name), unquote(labels), unquote(value))
)
end
end
defmacro dobserve(spec, value \\ 1) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_summary.dobserve(unquote(registry),
unquote(name), unquote(labels), unquote(value))
)
end
end
defmacro observe_duration(spec, fun) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_summary.observe_duration(unquote(name),
unquote(registry), unquote(labels), unquote(fun))
)
end
end
defmacro reset(spec) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_summary.reset(unquote(registry),
unquote(name), unquote(labels))
)
end
end
defmacro value(spec) do
{registry, name, labels} = Metric.parse_spec(spec)
quote do
require Prometheus.Error
Prometheus.Error.with_prometheus_error(
:prometheus_summary.value(unquote(registry),
unquote(name), unquote(labels))
)
end
end
end
diff --git a/mix.lock b/mix.lock
index 06d4a89..a63c9f8 100644
--- a/mix.lock
+++ b/mix.lock
@@ -1 +1 @@
-%{"prometheus": {:hex, :prometheus, "2.2.0", "f58f6f168d2d83afacd010b440c28ac897b5fcc81281845b218ce48b2fe21bd0", [:rebar3], []}}
+%{"prometheus": {:hex, :prometheus, "3.0.0-alpha1", "a547a71d32020adf2197d4e457cdb83cf63ecdb73bb2716b13d542f346255ea0", [:rebar3], []}}

File Metadata

Mime Type
text/x-diff
Expires
Wed, Nov 27, 9:34 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40602
Default Alt Text
(9 KB)

Event Timeline