Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions mprof
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ def run_action():
parser.add_argument("--multiprocess", "-M", dest="multiprocess", action="store_true",
help="""Monitors forked processes creating individual plots for each child (disables --python features)""")
parser.add_argument("--output", "-o", dest="filename",
default="mprofile_<YYYYMMDDhhmmss>.dat",
help="""File to store results in, defaults to 'mprofile_<YYYYMMDDhhmmss>.dat',
(where <YYYYMMDDhhmmss> is the date-time of the program start)""")
default="mprofile_%s.dat" % time.strftime("%Y%m%d%H%M%S", time.localtime()),
help="""File to store results in, defaults to 'mprofile_<YYYYMMDDhhmmss>.dat' in the current directory,
(where <YYYYMMDDhhmmss> is the date-time of the program start).
This file contains the process memory consumption, in Mb (one value per line).""")
parser.add_argument("program", nargs=REMAINDER,
help='Option 1: "<EXECUTABLE> <ARG1> <ARG2>..." - profile executable\n'
'Option 2: "<PYTHON_SCRIPT> <ARG1> <ARG2>..." - profile python script\n'
Expand All @@ -206,16 +207,7 @@ def run_action():
print("{1}: Sampling memory every {0}s".format(
args.interval, osp.basename(sys.argv[0])))

if args.filename is None:
## Output results in a file called "mprofile_<YYYYMMDDhhmmss>.dat" (where
## <YYYYMMDDhhmmss> is the date-time of the program start) in the current
## directory. This file contains the process memory consumption, in Mb (one
## value per line). Memory is sampled twice each second."""

suffix = time.strftime("%Y%m%d%H%M%S", time.localtime())
mprofile_output = "mprofile_%s.dat" % suffix
else:
mprofile_output = args.filename
mprofile_output = args.filename

# .. TODO: more than one script as argument ? ..
program = args.program
Expand Down