Skip to content

Commit

Permalink
changed to nanoseconds for lexmag#6
Browse files Browse the repository at this point in the history
  • Loading branch information
ebostijancic committed Oct 4, 2016
1 parent 13f7868 commit 09abea1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/fluxter/packet.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule Fluxter.Packet do

case is_nil(ts) do
true -> [header, encode_key(name), tags, ?\s, fields]
false -> [header, encode_key(name), tags, ?\s, fields, ?\s, Integer.to_string(DateTime.to_unix(ts, :microseconds))]
false -> [header, encode_key(name), tags, ?\s, fields, ?\s, Integer.to_string(DateTime.to_unix(ts, :nanoseconds))]
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/fluxter_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ defmodule FluxterTest do


Sample.write("foo", [bar: "baz", qux: "baz"], 0, DateTime.from_unix!(1415521167028459, :microseconds))
assert_receive {:echo, "foo,bar=baz,qux=baz value=0i 1415521167028459"}
assert_receive {:echo, "foo,bar=baz,qux=baz value=0i 1415521167028459000"}

refute_receive _any
end
Expand Down

0 comments on commit 09abea1

Please sign in to comment.