-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathOptions.h
50 lines (39 loc) · 1020 Bytes
/
Options.h
1
2
3
4
5
6
7
8
9
10
11
12
13
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
//
// Created by Kosho Owa on 2016/08/19.
//
#ifndef ESPERF_OPTIONS_H
#define ESPERF_OPTIONS_H
#include <curl/curl.h>
#include <iostream>
#include <fstream>
#include <unistd.h>
#include <sys/poll.h>
#include <iomanip>
#include <vector>
using namespace std;
class Options {
public:
u_int num_threads_ = 1;
u_int num_recurrence_ = 1;
u_int interval_sec_ = 1;
u_int warmup_sec_;
u_int timeout_sec_;
vector<string> dict_;
string dict_filename_;
string http_method_ = "GET";
string http_user_;
string http_header_;
string request_body_;
string request_url_;
bool verbose_ = false;
// timeout msec to check if stdin is available
u_int poll_timeout = 100;
int Parse(int argc, char **argv);
void Print();
private:
bool IsStdinAvailable();
void PrintLine(const string otion, const u_int value);
void PrintLine(const string otion, const string value);
void PrintLine(const string otion, const bool value);
};
#endif //ESPERF_OPTIONS_H