7
7
# environment variables
8
8
import datetime
9
9
10
- from redisbench_admin .run .args import TRIGGERING_ENV
11
- from redisbench_admin .run .common import get_start_time_vars
10
+ from redisbench_admin .run .common import get_start_time_vars , PERFORMANCE_GH_TOKEN
12
11
from redisbench_admin .utils .remote import (
13
12
PERFORMANCE_RTS_HOST ,
14
13
PERFORMANCE_RTS_PORT ,
27
26
) = extract_git_vars ()
28
27
29
28
_ , NOW_UTC , _ = get_start_time_vars ()
30
- LAST_WEEK_UTC = NOW_UTC - (7 * 24 * 60 * 60 * 1000 )
29
+ LAST_MONTH_UTC = NOW_UTC - (31 * 24 * 60 * 60 * 1000 )
31
30
START_TIME_NOW_UTC , _ , _ = get_start_time_vars ()
32
- START_TIME_LAST_WEEK_UTC = START_TIME_NOW_UTC - datetime .timedelta (days = 7 )
31
+ START_TIME_LAST_MONTH_UTC = START_TIME_NOW_UTC - datetime .timedelta (days = 30 )
33
32
34
33
35
34
def create_compare_arguments (parser ):
@@ -39,26 +38,45 @@ def create_compare_arguments(parser):
39
38
default = "" ,
40
39
help = "specify a test (or a comma separated list of tests) to use for comparison. If none is specified by default will use all of them." ,
41
40
)
41
+ parser .add_argument (
42
+ "--defaults_filename" ,
43
+ type = str ,
44
+ default = "defaults.yml" ,
45
+ help = "specify the defaults file containing spec topologies, common metric extractions,etc..." ,
46
+ )
42
47
parser .add_argument ("--github_repo" , type = str , default = GITHUB_REPO )
43
48
parser .add_argument ("--github_org" , type = str , default = GITHUB_ORG )
44
- parser .add_argument ("--triggering_env" , type = str , default = TRIGGERING_ENV )
49
+ parser .add_argument ("--triggering_env" , type = str , default = "circleci" )
50
+ parser .add_argument ("--github_token" , type = str , default = PERFORMANCE_GH_TOKEN )
51
+ parser .add_argument ("--pull-request" , type = str , default = None , nargs = "?" , const = "" )
45
52
parser .add_argument ("--deployment_name" , type = str , default = "oss-standalone" )
46
53
parser .add_argument ("--deployment_type" , type = str , default = "oss-standalone" )
47
54
parser .add_argument ("--baseline_deployment_name" , type = str , default = "" )
48
55
parser .add_argument ("--comparison_deployment_name" , type = str , default = "" )
49
- parser .add_argument ("--metric_name" , type = str , default = "Tests.Overall.rps" )
56
+ parser .add_argument ("--metric_name" , type = str , default = None )
50
57
parser .add_argument ("--extra-filter" , type = str , default = None )
51
58
parser .add_argument (
52
59
"--last_n" ,
53
60
type = int ,
54
61
default = - 1 ,
55
62
help = "Use the last N samples for each time-serie. by default will use all available values" ,
56
63
)
64
+ parser .add_argument (
65
+ "--last_n_baseline" ,
66
+ type = int ,
67
+ default = 7 ,
68
+ help = "Use the last N samples for each time-serie. by default will use last 7 available values" ,
69
+ )
70
+ parser .add_argument (
71
+ "--last_n_comparison" ,
72
+ type = int ,
73
+ default = 1 ,
74
+ help = "Use the last N samples for each time-serie. by default will use last value only" ,
75
+ )
57
76
parser .add_argument (
58
77
"--from-date" ,
59
78
type = lambda s : datetime .datetime .strptime (s , "%Y-%m-%d" ),
60
- default = START_TIME_LAST_WEEK_UTC ,
61
- help = "Only consider regressions with a percentage over the defined limit. (0-100)" ,
79
+ default = START_TIME_LAST_MONTH_UTC ,
62
80
)
63
81
parser .add_argument (
64
82
"--to-date" ,
@@ -105,4 +123,17 @@ def create_compare_arguments(parser):
105
123
help = "The minimum period to use for the the value fetching" ,
106
124
)
107
125
parser .add_argument ("--to_timestamp" , default = None )
126
+
127
+ parser .add_argument (
128
+ "--grafana_base_dashboard" ,
129
+ type = str ,
130
+ default = "https://benchmarksrediscom.grafana.net/d/" ,
131
+ )
132
+ parser .add_argument (
133
+ "--auto-approve" ,
134
+ required = False ,
135
+ default = False ,
136
+ action = "store_true" ,
137
+ help = "Skip interactive approval of changes to github before applying." ,
138
+ )
108
139
return parser
0 commit comments