Commit fdac6b50 authored by Heinz N. Gies's avatar Heinz N. Gies

Fix timeshift bug

parent 139c6411
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
-type time_unit() :: ms | s | m | h | d | w. -type time_unit() :: ms | s | m | h | d | w.
-type time() :: #{ op => time, -type time() :: #{ op => time,
args => [pos_integer() | time_unit()]} | pos_integer(). args => [pos_integer() | time_unit()]} |
#{ op => timeshift } | pos_integer().
-type relative_time() :: time() | -type relative_time() :: time() |
now | now |
......
...@@ -54,6 +54,7 @@ extract_path_and_groupings(G = #{op := get, args := [_,_,_,_,Path]}) ...@@ -54,6 +54,7 @@ extract_path_and_groupings(G = #{op := get, args := [_,_,_,_,Path]})
extract_path_and_groupings(G = #{op := get, args := [_,_,_,_,Path]}) extract_path_and_groupings(G = #{op := get, args := [_,_,_,_,Path]})
when is_binary(Path) -> when is_binary(Path) ->
{dproto:metric_to_list(Path), extract_groupings(G)}; {dproto:metric_to_list(Path), extract_groupings(G)};
extract_path_and_groupings({calc, _, G}) -> extract_path_and_groupings({calc, _, G}) ->
extract_path_and_groupings(G); extract_path_and_groupings(G);
......
...@@ -101,6 +101,12 @@ get_times_({calc, Chain, ...@@ -101,6 +101,12 @@ get_times_({calc, Chain,
{error, E} {error, E}
end; end;
get_times_(TS = #{op := timeshift,
args := [Shift, C]}, T, BucketResolutions) ->
T1 = TS#{args => [Shift, T]},
{ok, C1, BucketResolutions1} = get_times_(C, T1, BucketResolutions),
{ok, C1, BucketResolutions1};
get_times_({calc, Chain, E = #{op := events}}, T, BucketResolutions) -> get_times_({calc, Chain, E = #{op := events}}, T, BucketResolutions) ->
C1 = {calc, Chain, E#{times => T}}, C1 = {calc, Chain, E#{times => T}},
{ok, C1, BucketResolutions}; {ok, C1, BucketResolutions};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment