Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Integers are appended with 'i'. Fixes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
CumpsD committed Sep 9, 2015
1 parent 35bba06 commit 9ecf3c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/InfluxDB.FSharp.UnitTests/Point.fs
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ let ``escaping`` () =
toLine { correct with Tags = Map [ "host name", "server,01" ] } =? @"cpu,host\ name=server\,01 value=3.0 1420070400"

// fields
toLine { correct with Fields = Map [ "key to,escape", Int 1L ] } =? @"cpu,host=server01,region=uwest key\ to\,escape=1 1420070400"
toLine { correct with Fields = Map [ "key to,escape", Int 1L ] } =? @"cpu,host=server01,region=uwest key\ to\,escape=1i 1420070400"
toLine { correct with Fields = Map [ "key", String "double\"quotes" ] } =? "cpu,host=server01,region=uwest key=\"double\\\"quotes\" 1420070400"

// complex examples from influxdb docs
toLine { Measurement = "total disk free"
Tags = Map [ "volumes", "/net,/home,/" ]
Fields = Map [ "value", Int 442221834240L ]
Timestamp = correct.Timestamp } =? @"total\ disk\ free,volumes=/net\,/home\,/ value=442221834240 1420070400"
Timestamp = correct.Timestamp } =? @"total\ disk\ free,volumes=/net\,/home\,/ value=442221834240i 1420070400"

toLine { Measurement = "\"measurement with quotes\""
Tags = Map [ "tag key with spaces", "tag,value,with\"commas\"" ]
Expand Down
2 changes: 1 addition & 1 deletion src/InfluxDB.FSharp/Point.fs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module Point =
|> Seq.map (fun (k, v) ->
let value =
match v with
| Int v -> string v
| Int v -> sprintf "%ii" v
| Float v -> v.ToString("0.0###############", invCulture)
| String v -> sprintf "\"%s\"" v
| Bool true -> "t"
Expand Down

0 comments on commit 9ecf3c2

Please sign in to comment.