Skip to content

Commit

Permalink
Enable remote profiling with YourKit
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Woods committed Jun 13, 2013
1 parent 943a4b9 commit 92c74e2
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/tomcat7/manifests/init.pp
Expand Up @@ -41,6 +41,10 @@
$install_admin = true,
$data_dir = '/opt/fcrepo4-data',
) {

include yourkit

$yourkitdir = "$yourkit::yourkit"
$jre_package = "${jre}-jre-headless"

package { 'tomcat7':
Expand Down Expand Up @@ -86,6 +90,7 @@
require => [Package['tomcat7'],
File[$data_dir],
File['/etc/default/tomcat7'],
Exec['untar yourkit'],
],
}

Expand Down
4 changes: 4 additions & 0 deletions modules/tomcat7/templates/default-tomcat7.erb
Expand Up @@ -39,6 +39,10 @@ JAVA_OPTS="${JAVA_OPTS} -Dfcrepo.infinispan.cache_configuration=config/infinispa
#JAVA_OPTS="${JAVA_OPTS} -Djgroups.tcpping.initial_hosts='10.46.63.200[7800],10.151.125.215[7800],10.151.53.165[7800]' -Dfcrepo.ispn.numOwners=2 -Djava.net.PreferIPv4Stack=true"


# YourKit Profiling
JAVA_OPTS="${JAVA_OPTS} -agentpath:/opt/<%= yourkitdir %>/bin/linux-x86-64/libyjpagent.so"


#setup logging config
JAVA_OPTS="${JAVA_OPTS} -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties"

Expand Down
42 changes: 42 additions & 0 deletions modules/yourkit/manifests/init.pp
@@ -0,0 +1,42 @@
# = Class: yourkit
#
# This class downloads and installs YourKit JVM profiler.
#
# == Parameters:
#
# $url:: URL base from whence to download yourkit.
# $yourkit:: Name of the YourKit package minus the extension
#
# == Requires:
#
# Nothing.
#
# == Sample Usage:
#
# class {'yourkit':
# url => 'http://www.yourkit.com/download',
# yourkit => 'yjp-12.0.5',
# }
#

class yourkit (
$url = "http://www.yourkit.com/download",
$yourkit = "yjp-12.0.5",
) {

$yourkit_tar = "${yourkit}-linux.tar.bz2"
$yourkit_tar_dest = "/opt/${yourkit_tar}"

exec { 'download yourkit':
command => "/usr/bin/wget ${url}/${yourkit_tar} -O ${yourkit_tar_dest}",
creates => "${yourkit_tar_dest}",
}

exec { 'untar yourkit':
command => "/bin/tar xfj ${yourkit_tar_dest}",
cwd => "/opt",
creates => "/opt/${yourkit}",
require => Exec['download'],
}

}

0 comments on commit 92c74e2

Please sign in to comment.