Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double Value Support #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Double Value Support #5

wants to merge 1 commit into from

Conversation

tux1337
Copy link

@tux1337 tux1337 commented Aug 25, 2018

Graphite API supports int and double values as input.
The changes are necessary that this implementation does also support double values and are able to send them to Graphite.

Support for "," and "." as decimal delimiter is a little bit dirty....

Support Double as input for Graphite Client
Copy link

@kirpigiller kirpigiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x

@@ -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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, it would be better to save int-methods also

@@ -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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think that target graphite server support dots?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants