Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
cf40b0fb
Commit
cf40b0fb
authored
Aug 23, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
memory plot script
parent
b49a7a97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
benchmarks/record_mem_usage.sh
benchmarks/record_mem_usage.sh
+38
-0
No files found.
benchmarks/record_mem_usage.sh
0 → 100755
View file @
cf40b0fb
#!/bin/bash
usage
=
"
\
Usage:
$0
INTERVAL CMD
example:
$0
0.5
\"
my_benchmark_program arg0 arg1 arg2
\"
"
if
[
"$#"
!=
"2"
]
;
then
echo
"
${
usage
}
"
1>&2
exit
fi
runtime
=
""
line
=
$(
cat
/proc/1/status |
grep
"^Vm"
|
awk
'BEGIN {printf "%-10s", "elapsed"} {printf "%-20s", $1} END {print ""}'
)
exec
$2
&
pid
=
$!
interval
=
$1
dtime
=
$(
date
"+%s%N"
)
time0
=
$(
echo
"
$dtime
/ 1000000"
| bc
-q
)
fields
=
$(
echo
"
$line
"
|
wc
-w
)
while
[
"
$fields
"
-gt
"1"
]
;
do
echo
"
$line
"
if
[
-n
"
$runtime
"
]
;
then
sleep
$interval
runtime
=
$(
echo
$runtime
+
$interval
| bc
-q
)
else
runtime
=
0
fi
dtime
=
$(
date
"+%s%N"
)
timeN
=
$(
echo
"(
$dtime
/ 1000000 ) -
$time0
"
| bc
-q
)
timeN_sec
=
$(
echo
"scale=2;
$timeN
/ 1000"
| bc
)
line
=
$(
cat
/proc/
${
pid
}
/status 2>/dev/null |
grep
"^Vm"
|
awk
-v
rt
=
$timeN_sec
'BEGIN {printf "%-10s", rt} {printf "%-20s", ($2 " " $3)} END {print ""}'
)
fields
=
$(
echo
"
$line
"
|
wc
-w
)
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment