Socket
Socket
Sign inDemoInstall

perf-cascade

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perf-cascade

Har file visualizer


Version published
Weekly downloads
1.3K
decreased by-44.93%
Maintainers
1
Weekly downloads
 
Created
Source

PerfCascade

Extensible waterfall-viewer that works with HAR and other formats (in the future).

Live example at: https://micmro.github.io/PerfCascade/

example screenshot

How to use PerfCascade

PerfCascade is exported with UMD, so you can use it as global object, via AMD (e.g. requireJS) or commonJS (internally it uses ES6 modules).

If using it without any module system it exports as a global object perfCascade, you can use as following:

/** options for PerfCascade (all have defaults) */
var options = {
  rowHeight: 23, //default: 23
  showAlignmentHelpers : true, //default: true
  showIndicatorIcons: true, //default: true
  leftColumnWith: 25 //default: 25
}

/** pass HAR and options to `newPerfCascadeHar` to generate the SVG element*/
var perfCascadeSvg =  perfCascade.fromHar(harData.log, options)

You can find the compiled (and minified) JS in src/dist. Yor the basic version without zHAR support you need perf-cascade.min.js and some basic CSS styles perf-cascade.css.

Use via npm

As of 2.0.5 you can install PerfCascade via NPM as well:

npm install perf-cascade

Directories:

  • node_modules/perf-cascade/dist/: bundled UMD modules and the css file in the directory.
  • node_modules/perf-cascade/lib: contains the full project exported as seperate ES6 modules
  • node_modules/perf-cascade/types: Typescript typings

Options

see options.d.ts for source

rowHeight

number, default: 23 Height of every request bar block plus spacer pixel (in px) default: 23

showAlignmentHelpers

boolean, default: true Show verticale lines to easier spot potential dependencies/blocking between requests

showIndicatorIcons

boolean, default: true Show warning icons for potential issues on the left

leftColumnWith

number default: 25 Relative width of the info column on the left (in percent)

*.zhar - zipped HAR files

By loading /perf-cascade-file-reader.min.js as in this example you can use perfCascadeFileReader.readFile to read a gzip and convert it to a JSON HAR object.

perfCascadeFileReader.readFile(fileFromTheFileInput, fileName, function(data){
  if(!data){
    // handle error
    console.error("Can't read file")
  }else{
    // handle success
    renderPerfCascadeChart(data)
  }
})

Dev

  • Start live-reload server and Typescript compiler with watch: npm run watch
  • Create uglified version: npm run build (not tracked ITM)
  • Build and publish assets to Github Page npm run ghPages (pushes to gh-pages branch) (contributers only)

See package.json for other useful tasks like linting etc.

Specs and ressources

FAQs

Package last updated on 19 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc