Sha256: e729ecbc67e1bf6454914dc308066fcf13bac5eca1212e63b5e3a88150cc4f99

Contents?: true

Size: 936 Bytes

Versions: 58

Compression:

Stored size: 936 Bytes

Contents

#!/usr/bin/env bash
SVG_FILENAME="dev/flamegraph.svg"
PROFILE_FILENAME="dev/profile"
FLAMEGRAPH_PL="dev/flamegraph.pl"

if [[ -z $1 ]]; then
  echo "Usage: `basename "$0"` TEST_NAME_OR_REGEX"
  exit 1
fi

if ! [[ -s $FLAMEGRAPH_PL ]]; then
  echo "Downloading flamegraph.pl"
  curl -Lo $FLAMEGRAPH_PL https://raw.githubusercontent.com/brendangregg/FlameGraph/master/flamegraph.pl
fi

if [[ -f $SVG_FILENAME ]]; then
  rm $SVG_FILENAME
fi

if [[ -f $PROFILE_FILENAME ]]; then
  rm $PROFILE_FILENAME
fi

echo "Running test(s) with profiling"
PROFILE=1 bundle exec ruby -I test test/integration/krane_deploy_test.rb -n /$1/ > /dev/null

echo "Processing profile"
cat $PROFILE_FILENAME | perl -w $FLAMEGRAPH_PL --countname=ms --width=1500 --title=$1 > $SVG_FILENAME

if [[ -f $SVG_FILENAME ]]; then
  echo "Done. Opening ${SVG_FILENAME}"
  open $SVG_FILENAME
else
  echo "Done, but ${SVG_FILENAME} does not exist. Something went wrong."
fi

Version data entries

58 entries across 58 versions & 3 rubygems

Version Path
krane-3.7.0 dev/flamegraph-from-tests
krane-3.6.2 dev/flamegraph-from-tests
krane-3.6.1 dev/flamegraph-from-tests
krane-3.5.2 dev/flamegraph-from-tests
krane-3.5.1 dev/flamegraph-from-tests
krane-3.5.0 dev/flamegraph-from-tests
krane-3.4.2 dev/flamegraph-from-tests
krane-3.4.1 dev/flamegraph-from-tests
krane-3.4.0 dev/flamegraph-from-tests
krane-3.3.0 dev/flamegraph-from-tests
krane-3.2.0 dev/flamegraph-from-tests
krane-3.1.0 dev/flamegraph-from-tests
krane-3.0.1 dev/flamegraph-from-tests
krane-3.0.0 dev/flamegraph-from-tests
krane-2.4.9 dev/flamegraph-from-tests
krane-2.4.8 dev/flamegraph-from-tests
krane-2.4.7 dev/flamegraph-from-tests
krane-2.4.6 dev/flamegraph-from-tests
krane-2.4.5 dev/flamegraph-from-tests
krane-2.4.4 dev/flamegraph-from-tests