aboutsummaryrefslogtreecommitdiff
path: root/lib/ex_prometheus_io.ex
diff options
context:
space:
mode:
authorkballou <kballou@devnulllabs.io>2016-03-22 15:54:49 -0600
committerkballou <kballou@devnulllabs.io>2016-03-22 16:40:21 -0600
commitcf50bcf5adacca9fdb204eec346e5994ca08ad4b (patch)
tree40f212b3c5d4ee033576d1a9077cbf2b40a73932 /lib/ex_prometheus_io.ex
parent7c902cfadff18e93d181d3b4c0e91b68316104f4 (diff)
downloadex_prometheus_io-cf50bcf5adacca9fdb204eec346e5994ca08ad4b.tar.gz
ex_prometheus_io-cf50bcf5adacca9fdb204eec346e5994ca08ad4b.tar.xz
Refactor: internally pass tuples
This removes the need for 3 different method heads for `process/4`, the internal query functions will handle building a correct url for processing
Diffstat (limited to 'lib/ex_prometheus_io.ex')
-rw-r--r--lib/ex_prometheus_io.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ex_prometheus_io.ex b/lib/ex_prometheus_io.ex
index 43604ea..9eb7c1c 100644
--- a/lib/ex_prometheus_io.ex
+++ b/lib/ex_prometheus_io.ex
@@ -11,17 +11,17 @@ defmodule ExPrometheusIo do
end
def range(query, start_ts, end_ts, step, _opts \\ []) do
- query_opts = [query, start_ts, end_ts, step]
+ query_opts = {query, start_ts, end_ts, step}
spawn_query(:range, query_opts)
end
def series(matches, _opts \\ []) when is_list(matches) do
- spawn_query(:series, [matches])
+ spawn_query(:series, {matches})
end
defp spawn_query(query, query_opts, _opts \\ []) do
query_ref = make_ref()
- query_opts = [query | query_opts] ++ [query_ref, self()]
+ query_opts = [query, query_opts, query_ref, self()]
{:ok, pid} = Task.Supervisor.start_child(
ExPrometheusIo.QuerySupervisor,
ExPrometheusIo.Query,