<commit_before>// build_options: 
Java Performance Tuning - Workshop 0
====================================
<NAME> <<EMAIL>>
v1.2, 18-Nov-2015: Initial version, including small corrections
:backend: slidy
//:theme: volnitsky
:data-uri:
:copyright: Creative-Commons-Zero (<NAME>)
:icons:
:br: pass:[<br>]


Content
-------

*****
Installing the training toolsuite
*****

Part 1::
* <<_part_1_prerequisites,Prerequisites>>
* <<_part_1_installation,Installation>>
* <<_part_1_verification_init,Verification>>
Part 2::
* Simple benchmarking
* <<_part_2_simple_benchmarking_launch_app,Simple benchmarking>>

_(link:../0-extra/1-training_plan.html#_workshops[back to course plan])_


Part 1: Prerequisites
---------------------

Installing the kit requires an unzipper (+WinZip+, +7-zip+...).

Using the kit requires one of the following command-line interpreter (CLI):

* preferred: +bash+ (Windows and OSX)
* also supported: +CMD.EXE+ (Windows)

For the next workshops, you will also need:

* a decent browser, with a developer mode (e.g. Google Chrome)
* a cool text editor (programmer friendly, like: VI, SublimeText, Notepad++...)

Part 1: Installation
--------------------

* Copy the kit from one of the following locations:
** +\\AVM-PC\Public\JPT+
** https://github.com/arnauldvm/jpt-exercises/blob/master/download.md[GitHub / Dropbox]: jpt-exercises
** USB key
* Choose appropriate platform:
** +jpt-kit-win32-x64.zip+ (269M)
** +jpt-kit-osx.zip+ (99M)
* Extract to your favorite location (e.g. +C:\javadev\jpt+)
* Download the exercices from the same location: +jpt-apps.zip+
* Extract to the same location
* Your install location should look like this:
----
app00/   app01/   exercise12/   local/   setenv.bat   setenv.sh
----


Part 1: Verification (init)
---------------------------

* Start your preferred CLI (bash or CMD) and CD to your install location
* Execute +. setenv.sh+ (bash) or +setenv.bat+ (CMD)
** Your CLI environment is updated

WARNING: This command must be executed each time you start a new CLI!

* A message gives you the list of available tools:

[horizontal]
java:: Oracle Java 8 SDK (runtime, compiler, profiler...)
jmeter _or_ jm:: benchmarking tool
mat:: Memory Analyzer Tool
gcviewer:: Garbage Collector Logs Analyzer
threadlogic:: Threads Dump Analyzer for Weblogic
curl:: HTTP client in CLI mode
perf:: OS resources performance monitoring in CLI mode
(gatling):: alternative benchmarking tool


Part 1: Verification (run)
--------------------------

Verify that each of the following commands brings the expected result:

----
$ java -version
$ javac -version
$ jps -v # lists the java processes
$ jstat -help # JVM monitoring
$ jstack -help # thread dump
$ jmap -help # heap dump
$ jconsole # Graphical tool to monitor the JVM
$ jmeter # launches the JMeter GUI (use "jm" under CMD.EXE)
$ gcviewer # launches the GC Logs Analyzer
$ mat # launches the Memory Analyzer Tool
$ threadlogic # launches the Threads Dump Analyzer
$ curl -I http://jira.smals.be # Simple HTTP request
$ perf # Shows system activity metrics every second, hit Ctrl+C to halt
$      # (might fail on Windows, depending on your privileges)
^C
$ recorder.sh or recorder.bat # launches the Gatling recorder
$ gatling.sh or gatling.bat # launches the Gatling injector, hit Ctrl+C to halt
^C
----


Part 2: Simple benchmarking (launch app)<commit_msg>add(workshop 0): do not read the code<commit_after>// build_options: 
Java Performance Tuning - Workshop 0
====================================
<NAME> <<EMAIL>>
v1.2, 18-Nov-2015: Initial version, including small corrections
:backend: slidy
//:theme: volnitsky
:data-uri:
:copyright: Creative-Commons-Zero (Arnauld Van Muysewinkel)
:icons:
:br: pass:[<br>]


Content
-------

*****
Installing the training toolsuite
*****

Part 1::
* <<_part_1_prerequisites,Prerequisites>>
* <<_part_1_installation,Installation>>
* <<_part_1_verification_init,Verification>>
Part 2::
* Simple benchmarking
* <<_part_2_simple_benchmarking_launch_app,Simple benchmarking>>

_(link:../0-extra/1-training_plan.html#_workshops[back to course plan])_


Part 1: Prerequisites
---------------------

Installing the kit requires an unzipper (+WinZip+, +7-zip+...).

Using the kit requires one of the following command-line interpreter (CLI):

* preferred: +bash+ (Windows and OSX)
* also supported: +CMD.EXE+ (Windows)

For the next workshops, you will also need:

* a decent browser, with a developer mode (e.g. Google Chrome)
* a cool text editor (programmer friendly, like: VI, SublimeText, Notepad++...)

Part 1: Installation
--------------------

* Copy the kit from one of the following locations:
** +\\AVM-PC\Public\JPT+
** https://github.com/arnauldvm/jpt-exercises/blob/master/download.md[GitHub / Dropbox]: jpt-exercises
** USB key
* Choose appropriate platform:
** +jpt-kit-win32-x64.zip+ (269M)
** +jpt-kit-osx.zip+ (99M)
* Extract to your favorite location (e.g. +C:\javadev\jpt+)
* Download the exercices from the same location: +jpt-apps.zip+
* Extract to the same location
* Your install location should look like this:
----
app00/   app01/   exercise12/   local/   setenv.bat   setenv.sh
----


Part 1: Verification (init)
---------------------------

* Start your preferred CLI (bash or CMD) and CD to your install location
* Execute +. setenv.sh+ (bash) or +setenv.bat+ (CMD)
** Your CLI environment is updated

WARNING: This command must be executed each time you start a new CLI!

* A message gives you the list of available tools:

[horizontal]
java:: Oracle Java 8 SDK (runtime, compiler, profiler...)
jmeter _or_ jm:: benchmarking tool
mat:: Memory Analyzer Tool
gcviewer:: Garbage Collector Logs Analyzer
threadlogic:: Threads Dump Analyzer for Weblogic
curl:: HTTP client in CLI mode
perf:: OS resources performance monitoring in CLI mode
(gatling):: alternative benchmarking tool


Part 1: Verification (run)
--------------------------

Verify that each of the following commands brings the expected result:

----
$ java -version
$ javac -version
$ jps -v # lists the java processes
$ jstat -help # JVM monitoring
$ jstack -help # thread dump
$ jmap -help # heap dump
$ jconsole # Graphical tool to monitor the JVM
$ jmeter # launches the JMeter GUI (use "jm" under CMD.EXE)
$ gcviewer # launches the GC Logs Analyzer
$ mat # launches the Memory Analyzer Tool
$ threadlogic # launches the Threads Dump Analyzer
$ curl -I http://jira.smals.be # Simple HTTP request
$ perf # Shows system activity metrics every second, hit Ctrl+C to halt
$      # (might fail on Windows, depending on your privileges)
^C
$ recorder.sh or recorder.bat # launches the Gatling recorder
$ gatling.sh or gatling.bat # launches the Gatling injector, hit Ctrl+C to halt
^C
----


Warning
-------

[WARNING]
=====
Do not read the code until you're told to!
=====


Part 2: Simple benchmarking (launch app)
{'fraction_non_alphanumeric': 0.1483106625713032, 'fraction_numerical': 0.011554775486324411, 'mean_word_length': 3.7851644506648006, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1197607', 'n_tokens_mistral': 2270, 'n_tokens_neox': 2088, 'n_words': 784}