Git Product home page Git Product logo

hpview's Introduction

hpview README

Build Status

hpview is a GHC's .hp (heap profile) files viewer, implemented in Haskell + Gtk3.

Screenshot

It may be nicer than use of hp2pretty because of the follwing features:

  • No need to convert .hp to .svg and then open .svg with another program, just run hpview file.hp.
  • Areas on plot are higlighted interactively (on mouse-over), and name of selected area is displayed in the statusbar. Statusbar also displays the timestamp pointed by cursor and amount of memory consumed by highlighted item at that moment. Grow ratio of the item being highlited is displayed also; grow ratio is calculated based on time period that is currently shown.
  • Interactive filtering by item name, module or package name (module and package filtering works for -hc mode; for all other modes, only name filtering is useful).
  • Interactive filtering by grow rate. It is possible to ask to show, for example, items that grow faster than 15 KiB/s, or slower than 1 MiB/s. Grow ratio is calculated based on time period that is currently shown.
  • Interactive zoom:
    • Select time interval by dragging mouse with left button held pressed;
    • Zoom selected part of the chart by clicking "Zoom In" button in the bottom right corner;
    • Return to previous zoom level by clicking "Zoom Out" button in the bottom right corner;
    • Return to original zoom level (to fit the whole chart into the window) by clicking "Reset Zoom" button in the bottom right corner.
  • Displaying of "trace elements", i.e. items that occupy very small amounts of memory. Such items are merged into one band called (trace elements), as hp2pretty does. There are several options for such elements:
    • To show or not to show trace elements at all
    • Number of biggest items to show (10 by default)
    • Two modes of trace elements detection:
      • either select items that occupy less than N percents of memory in total, or
      • select items, each of which occupies less than N percents of memory.
    • Percentage of memory for trace elements is configurable.
  • Legend may be enabled (by default) or disabled in preferences dialog; preferences dialog is called with a button in right bottom corner of the window.
  • Highlighting of the area under mouse cursor may be disabled in preferences dialog.
  • Optional downsampling. Downsampling algorithm is very simple (it just takes each N'ths item) and thus not very precise; but downsampling can make the resulting chart much cleaner and more readable, and also it helps with performance. Number of samples to use is specified in the preferences window. By default, downsampling to 500 samples is used; it means that hpview will draw not more than 500 samples along time axis on the screen. You may use interactive zooming on the area of interest if you wish to see more details.
  • It is possible to save currently displayed chart (with current filter, zoom and so on) as PNG or SVG file - see the "save as" button in the top right corner of the window, next to "filter" button.

Other features may be added later.

Performance: it takes about 25 seconds to display a .hp file of 181 Mb in size on my machine (i5 2.8GHz), from start to displayed chart, without downsampling. With downsampling to 500 samples, it takes about 17 seconds. In my practice, usually smaller files give even more insight into what's going on than bigger ones; so I am not going to invest a lot of time into this matter. But PRs are welcome.

Installation

Install it by stack:

$ sudo apt-get install stack
$ git clone https://github.com/portnov/hpview.git
$ cd hpview/
$ stack install

Note: hpview currently depends on master branch of haskell-chart and on master branch of formattable packages; but stack will take care of that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.