diff --git a/Graphite/GraphiteTcpClient.cs b/Graphite/GraphiteTcpClient.cs index 1c47378..37d33de 100644 --- a/Graphite/GraphiteTcpClient.cs +++ b/Graphite/GraphiteTcpClient.cs @@ -20,7 +20,7 @@ public GraphiteTcpClient(string hostname, int port = 2003, string keyPrefix = nu _tcpClient = new TcpClient(Hostname, Port); } - public void Send(string path, int value, DateTime timeStamp) + public void Send(string path, double value, DateTime timeStamp) { try { diff --git a/Graphite/GraphiteUdpClient.cs b/Graphite/GraphiteUdpClient.cs index 550c40e..89c5731 100644 --- a/Graphite/GraphiteUdpClient.cs +++ b/Graphite/GraphiteUdpClient.cs @@ -20,7 +20,7 @@ public GraphiteUdpClient(string hostname, int port = 2003, string keyPrefix = nu _udpClient = new UdpClient(Hostname, Port); } - public void Send(string path, int value, DateTime timeStamp) + public void Send(string path, double value, DateTime timeStamp) { try { diff --git a/Graphite/IGraphiteClient.cs b/Graphite/IGraphiteClient.cs index 8c7938b..155dc6a 100644 --- a/Graphite/IGraphiteClient.cs +++ b/Graphite/IGraphiteClient.cs @@ -4,7 +4,7 @@ namespace Graphite { public interface IGraphiteClient { - void Send(string path, int value, DateTime timeStamp); + void Send(string path, double value, DateTime timeStamp); } public static class IGraphiteClientExtensions diff --git a/Graphite/PlaintextMessage.cs b/Graphite/PlaintextMessage.cs index 9b438a9..3596f1c 100644 --- a/Graphite/PlaintextMessage.cs +++ b/Graphite/PlaintextMessage.cs @@ -6,10 +6,10 @@ namespace Graphite public class PlaintextMessage { public string Path { get; private set; } - public int Value { get; private set; } + public double Value { get; private set; } public long Timestamp { get; private set; } - public PlaintextMessage(string path, int value, DateTime timestamp) + public PlaintextMessage(string path, double value, DateTime timestamp) { if(path == null) { @@ -23,7 +23,7 @@ public PlaintextMessage(string path, int value, DateTime timestamp) public byte[] ToByteArray() { - var line = string.Format("{0} {1} {2}\n", Path, Value, Timestamp); + var line = string.Format("{0} {1} {2}\n", Path, Convert.ToString(Value).Replace(",","."), Timestamp); return Encoding.UTF8.GetBytes(line); }