#[macro_use] extern crate serde_json; #[macro_use] extern crate maplit; extern crate libhoney; use libhoney::Libhoney; use libhoney::builder_trait::BuilderT; #[test] fn send_event() { let hny = Libhoney::configure() .api_host("http://localhost:8081") .write_key("7aefa39399a474bd9f414a8e3f8d9691") .dataset("TestingDataset") .build(); let mut builder = hny.new_builder(); builder.add_field("key", json!("value")) .add_field("key2", json!("value2")) .add_field("key3", json!("value3")); let mut ev = builder.new_event(); ev.send(); } #[test] fn test_add_maplit() { let hny = Libhoney::configure() .api_host("http://localhost:8081") .write_key("7aefa39399a474bd9f414a8e3f8d9691") .dataset("TestingDataset") .build(); let mut builder = hny.new_builder(); builder.add(hashmap!{ "a".to_string() => json!(1), "b".to_string() => json!(2), }); let mut ev = builder.new_event(); ev.send(); }