| 172 | |
| 173 | |
| 174 | def parseargs(): |
| 175 | parser = argparse.ArgumentParser(description=_help) |
| 176 | |
| 177 | parser.add_argument('--version', action='version', version='1.0') |
| 178 | parser.add_argument("--logFile", default="", |
| 179 | help="GPDB log file saved from a run with debug event counters enabled (default is to search " |
| 180 | "GPDB master log directory)") |
| 181 | parser.add_argument("--allRuns", action="store_true", |
| 182 | help="Record all runs, instead of just the last one, use this if you had several psql runs") |
| 183 | parser.add_argument("--sql", action="store_true", |
| 184 | help="Instead of printing the results on stdout, record them in an SQL database") |
| 185 | parser.add_argument("--host", default="localhost", |
| 186 | help="Host to connect to (default is localhost).") |
| 187 | parser.add_argument("--port", type=int, default="0", |
| 188 | help="Port on the host to connect to") |
| 189 | parser.add_argument("--dbName", default="", |
| 190 | help="Database name to connect to") |
| 191 | parser.add_argument("--recreateTable", action="store_true", |
| 192 | help="Drop and recreate the debug_counters table, erasing any pre-existing data") |
| 193 | parser.add_argument("--raw", action="store_true", |
| 194 | help="Just print out the log data, to be used later as a log file for this script") |
| 195 | |
| 196 | parser.set_defaults(verbose=False, filters=[], slice=(None, None)) |
| 197 | |
| 198 | # Parse the command line arguments |
| 199 | args = parser.parse_args() |
| 200 | return args, parser |
| 201 | |
| 202 | |
| 203 | def main(): |