-
Notifications
You must be signed in to change notification settings - Fork 2
/
util.py
79 lines (77 loc) · 2.08 KB
/
util.py
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import argparse
def get_args():
"""Argument parser.
Returns:
Dictionary of arguments.
"""
parser = argparse.ArgumentParser()
parser.add_argument(
'--url',
type=str,
help='URL to be called')
parser.add_argument(
'--time-dist',
type=str,
choices=['normal','poisson'],
help='Inter-Request time distribution')
parser.add_argument(
'--mu',
type=float,
help='Mean for Normal distribution')
parser.add_argument(
'--sigma',
type=float,
help='standard deviation for normal distribution')
parser.add_argument(
'--lamb',
type=float,
help='lambda for poisson distribution')
parser.add_argument(
'--iter',
type=int,
help='Number of iterations of URL calls to be done before the program terminates')
parser.add_argument(
'--database',
type=str,
help='Name of the database')
parser.add_argument(
'--api-url',
type=str,
default="http://localhost:70/api/v1.3/subcontainers/docker/",
help='Docker API URL')
parser.add_argument(
'--mongo-client',
type=str,
default="localhost",
help='Mongo DB source client')
parser.add_argument(
'--simulate-load',
type=str,
default="True",
help='Mongo DB source client')
parser.add_argument(
'--write-to-file',
type=str,
default="True",
help='Write collections to file')
parser.add_argument(
'--replicate',
type=int,
default=2,
help='Replication of application')
parser.add_argument(
'--mode',
type=str,
choices=['deploy','display','leave'],
help='mode for the script')
parser.add_argument(
'--init-swarm',
type=str,
default="True",
help='init swarm')
parser.add_argument(
'--mount-mongo',
type=str,
help='mongo db mount path')
args, _ = parser.parse_known_args()
return args