extern crate redrock; extern crate uuid; extern crate time; // use uuid::Uuid; use time::PreciseTime; fn main() { // println!("Hello, world!"); let db = redrock::open_db("test-7.db"); println!("{:?}", redrock::lexists(&db, "lististä-1").unwrap()); redrock::lpush(&db, "lististä-1", "A").unwrap(); println!("{:?}", redrock::lexists(&db, "lististä-1").unwrap()); redrock::ldel(&db, "lististä-1").unwrap(); println!("{:?}", redrock::lexists(&db, "lististä-1").unwrap()); //lpush(&db, "l-1", "B").unwrap(); //lpush(&db, "l-1", "C").unwrap(); // sadd(&db, "nimet", "Teemu"); // sadd(&db, "nimet", "Matias"); // sadd(&db, "nimet", "Kalle"); // sadd(&db, "nimet", "Kille"); // smembers(&db, "nimet"); // srem(&db, "nimet", "Kille"); // println!("------"); // smembers(&db, "nimet"); for h in 0..30 { // let start = PreciseTime::now(); for i in 0..200_000 { redrock::lpush(&db, &format!("buck-{}", h), &format!("asdkjahdahksdkjasdkhjashkdhkahkdakshjdhkjahksdhkaskdhjaskhjd {}", i)).unwrap(); redrock::set_i64(&db, &format!("last_updated:a-{}", h), i).unwrap(); } // for i in 0..1_000_000 { // } let hm = redrock::prefix_search(&db, "last_updated"); println!("L: {}", hm.len()); let end = PreciseTime::now(); println!("[{}] {} seconds for whatever you did.", redrock::get_u64(&db, "test-v-1"), start.to(end)); } // //db.delete(b"my key").unwrap(); // for it in lget(&db, "l-1") { // println!("{}", it); // } }