Crate graphyne

Crate graphyne 

Source
Expand description

§Graphyne

A simple, reliable Rust client for sending metrics to Graphite Carbon daemons.

Graphyne provides a straightforward API for sending time-series metrics to Graphite using the plaintext TCP protocol. It features automatic reconnection, configurable retry logic, and an ergonomic builder pattern for easy configuration.

§Quick Start

use graphyne::{GraphiteClient, GraphiteMessage};
use std::time::Duration;

// Create a client
let mut client = GraphiteClient::builder()
    .address("127.0.0.1")
    .port(2003)
    .build()?;

// Send a metric
let message = GraphiteMessage::new("my.metric.path", "42");
client.send_message(&message)?;

§Features

  • Builder Pattern: Intuitive, type-safe configuration
  • Auto-reconnection: Automatic retry and reconnection on failure
  • Zero-copy Writes: Efficient metric transmission
  • Timestamp Generation: Automatic Unix timestamp creation

§Protocol

Graphyne uses the Graphite plaintext protocol over TCP. Each metric is formatted as:

metric.path.name value timestamp\n

For example:

servers.web01.cpu.usage 45.2 1609459200\n

Structs§

GraphiteClient
A client for sending metrics to a Graphite Carbon daemon.
GraphiteClientBuilder
Use builder syntax to set the inputs and finish with build().
GraphiteError
Error type for Graphite client operations.
GraphiteMessage
A metric message to be sent to Graphite.