aboutsummaryrefslogtreecommitdiff
path: root/scripts/histogram.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-05-11 14:30:39 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-06-02 11:18:47 +0200
commitffacbbece6af0f84d4bc7c8c4365797e8a433ef7 (patch)
tree57ad32954b0e3903b3c9472090f2f414efd8dfc5 /scripts/histogram.py
parentf2ebd50f099af160bc39584afa95f812215630d1 (diff)
downloadallocbench-ffacbbece6af0f84d4bc7c8c4365797e8a433ef7.tar.gz
allocbench-ffacbbece6af0f84d4bc7c8c4365797e8a433ef7.zip
format the source code using yapf
Diffstat (limited to 'scripts/histogram.py')
-rwxr-xr-xscripts/histogram.py27
1 files changed, 19 insertions, 8 deletions
diff --git a/scripts/histogram.py b/scripts/histogram.py
index 2bf6779..f1f8464 100755
--- a/scripts/histogram.py
+++ b/scripts/histogram.py
@@ -16,7 +16,6 @@
#
# You should have received a copy of the GNU General Public License
# along with allocbench. If not, see <http://www.gnu.org/licenses/>.
-
"""Plot an interactive histogram from malt or chattymalloc output file"""
import argparse
@@ -28,17 +27,29 @@ import sys
import matplotlib.pyplot as plt
-currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
+currentdir = os.path.dirname(
+ os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
def main():
- parser = argparse.ArgumentParser(description="Plot histograms using a malt or chattymalloc output file")
- parser.add_argument("input_file", help="path to malt or chattymalloc output file", type=str)
- parser.add_argument("-e", "--export", help="export to csv", action="store_true")
- parser.add_argument("-n", "--no-ascii", help="don't output a ascii histogram", action="store_true")
- parser.add_argument("-i", "--interactive", help="open interactive matplotlib histogram plots",
+ parser = argparse.ArgumentParser(
+ description="Plot histograms using a malt or chattymalloc output file")
+ parser.add_argument("input_file",
+ help="path to malt or chattymalloc output file",
+ type=str)
+ parser.add_argument("-e",
+ "--export",
+ help="export to csv",
+ action="store_true")
+ parser.add_argument("-n",
+ "--no-ascii",
+ help="don't output a ascii histogram",
+ action="store_true")
+ parser.add_argument("-i",
+ "--interactive",
+ help="open interactive matplotlib histogram plots",
action="store_true")
args = parser.parse_args()
@@ -87,7 +98,6 @@ def main():
else:
sizes_bigger_32K.append(size * amount)
-
plt.figure(0)
plt.hist(sizes_smaller_4K, 200)
plt.title("Sizes smaller than 4K")
@@ -105,5 +115,6 @@ def main():
plt.title("All sizes")
plt.show()
+
if __name__ == "__main__":
main()