public void Send(Metric metric) { var datagram = new Dgram(DatagramSize); if(!datagram.TryAppend(metric, Encoding)) throw new ArgumentException(); datagram.SendTo(socket, target); }
public static bool TryParse(string input, out Metric result) { var m = MetricPattern.Match(input); if(!m.Success) { result = new Metric(); return false; } result = new Metric( m.Groups["name"].Value, ParseValue(m.Groups["value"].Value, m.Groups["unit"].Value) ); return true; }
public void Send(Metric metric) { }
public void Send(Metric metric) => inner.Send(new Metric(prefix + metric.Name, metric.Value));