main.rs 1.59 KB
Newer Older
Ranadeep Biswas's avatar
Ranadeep Biswas committed
1
2
3
4
#![allow(dead_code)]

extern crate clap;
extern crate mysql;
Ranadeep Biswas's avatar
Ranadeep Biswas committed
5
6
extern crate rand;
extern crate time;
Ranadeep Biswas's avatar
Ranadeep Biswas committed
7
8
9
10
11
12
13

mod algo;
mod db;

use clap::{App, Arg};

fn main() {
Ranadeep Biswas's avatar
Ranadeep Biswas committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
    // let matches = App::new("DBcop")
    //     .arg(
    //         Arg::with_name("mysql_ip")
    //             .short("i")
    //             .long("ip")
    //             .help("MySQL ip")
    //             .takes_value(true),
    //     )
    //     .arg(
    //         Arg::with_name("mysql_port")
    //             .short("p")
    //             .long("port")
    //             .help("MySQL port")
    //             .takes_value(true),
    //     )
    //     .arg(
    //         Arg::with_name("mysql_username")
    //             .short("u")
    //             .long("username")
    //             .help("MySQL username")
    //             .required(true)
    //             .takes_value(true),
    //     )
    //     .arg(
    //         Arg::with_name("mysql_secret")
    //             .short("s")
    //             .long("secret")
    //             .help("MySQL secret")
    //             .required(true)
    //             .takes_value(true),
    //     )
    //     .get_matches();
    //
    // let ip = matches.value_of("mysql_ip").unwrap_or("localhost");
    // let port = matches.value_of("mysql_port").unwrap_or("3306");
    // let user = matches.value_of("mysql_username").unwrap();
    // let sec = matches.value_of("mysql_secret").unwrap();
Ranadeep Biswas's avatar
Ranadeep Biswas committed
51
    // println!("{} {} {:?} {:?}", ip, port, user, sec);
Ranadeep Biswas's avatar
Ranadeep Biswas committed
52

Ranadeep Biswas's avatar
Ranadeep Biswas committed
53
    // let conn_str = format!("mysql://{}:{}@{}:{}", user, sec, ip, port);
Ranadeep Biswas's avatar
Ranadeep Biswas committed
54

Ranadeep Biswas's avatar
Ranadeep Biswas committed
55
    // println!("{}", conn_str);
Ranadeep Biswas's avatar
Ranadeep Biswas committed
56

Ranadeep Biswas's avatar
Ranadeep Biswas committed
57
    algo::bench::do_bench();
Ranadeep Biswas's avatar
Ranadeep Biswas committed
58
}