Events User Manual: Difference between revisions
No edit summary |
|||
(79 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Internal= | =Internal= | ||
* [[ | * [[events#User_Manual|events]] | ||
=Overview= | |||
"events" is Java library and a set of command line tools that process timed event series. | |||
Its most basic usage is to convert stdout data into a timed event series sent to stdout: | |||
<pre> | |||
events < input-file [global-options] <input-format-specification> | |||
</pre> | |||
This syntax exercise the default command, "parse". For more details, see [[events User Manual - Parse Command|parse Command]]. | |||
Additional commands can be invoked with the syntax: | |||
<pre> | |||
events < input-file [global-options] command [command-arguments] | |||
</pre> | |||
=Commands= | |||
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;"> | |||
:[[events User Manual - Parse Command|parse]] | |||
</blockquote> | |||
<blockquote style="background-color: Tomato; border: solid thin red;"> | |||
:<br>Everything below this line must be reviewed<br><br> | |||
</blockquote> | |||
=Concepts= | |||
==Faults== | |||
A fault is a HTTP request that exhibit some sort of problem, which is not serious enough to indicated corrupted data and stop processing. The faults are shown in statistics. | |||
Common fault types: | |||
* '''NO_JSESSIONID_COOKIE''': the request does not have a JSESSIONID cookie, which means it was sent before authentication and session establishment, or after the session was closed. These requests are reported in summary statistics and usually ignored. | |||
* '''NO_REQUEST_DURATION_INFO''': No request duration information was found in the input data stream. This fault indicates a potentially serious condition, as it won't be possible to calculate request and business scenario durations. A common cause is [[Undertow_WildFly_Subsystem_Configuration#record-request-start-time|omitting to set <tt></tt> in the WildFly configuration]]. | |||
* '''NO_OPEN_BUSINESS_SCENARIO''': these faults are generated by the request arriving "between" scenarios. This is a normal condition and they should be usually ignored. | |||
More details: | |||
<blockquote style="background-color: AliceBlue; border: solid thin LightSteelBlue;"> | |||
:https://github.com/NovaOrdis/events/blob/master/src/main/java/io/novaordis/events/extensions/bscenarios/BusinessScenarioFaultType.java<br> | |||
</blockquote> | |||
==Business Scenarios== | |||
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;"> | |||
:[[Business_Scenario-Based_Performance_Concepts#Business_Scenario|Business Scenario]] | |||
</blockquote> | |||
<tt>events</tt> extracts business scenario statistics and can identify business scenarios in one of these states: | |||
* '''COMPLETE''': the scenario has been closed normally by the occurrence of a STOP marker. If the load was sent sequentially, it is guaranteed that all component HTTP requests have been applied to the scenario. | |||
* '''INCOMPLETE''': we ran out of event data while the scenario was in an OPEN state, usually because we reached the end of the log file, without encountering a STOP marker. This happens when the log generator stops abruptly in the middle of an iteration. | |||
* '''CLOSED_BY_START_MARKER''': we did not encounter the STOP marker, but we did encounter a START marker of a new scenario for the same session. | |||
More details: | |||
<blockquote style="background-color: AliceBlue; border: solid thin LightSteelBlue;"> | |||
:https://github.com/NovaOrdis/events/blob/master/src/main/java/io/novaordis/events/extensions/bscenarios/BusinessScenarioState.java<br> | |||
</blockquote> | |||
==null Events== | |||
Blocking queues do not accept null elements, so we cannot have null events. | |||
=Installation= | |||
Download the latest binary release from: | |||
<blockquote style="background-color: AliceBlue; border: solid thin LightSteelBlue;"> | |||
:<br>https://github.com/NovaOrdis/events/tree/master/releases<br><br> | |||
</blockquote> | |||
Unzip the binary release file into the directory where third party tools are usually installed on your system (<tt>/usr/local</tt>, <tt>/opt</tt>, etc.). Extraction will create a <tt>events-<version></tt> directory. | |||
Create an "event" symbolic link to the newly created directory. Assuming the extraction directory was <tt>/opt</tt>: | |||
<pre> | |||
cd /opt | |||
ln -s events-<version> events | |||
</pre> | |||
where "<version>" should be replaced with the actual value. | |||
If the link exists and points to an older value, first remove the link and then recreated it. | |||
Add /opt/events/bin to your PATH: | |||
<pre> | |||
export PATH=/opt/events/bin:${PATH} | |||
</pre> | |||
Test installation by running: | |||
<pre> | |||
events version | |||
</pre> | |||
=Business Scenario Data Processing= | |||
This section describes the steps required to extract business scenario data from raw httpd access logs. <tt>events</tt> needs the access log and the httpd log format specification that was used when the log was generated. The format is usually collected automatically and placed in an <tt>access_log.def</tt>, which is specified to <tt>events</tt> with the <tt>--input-format-file=</tt> option. However, the format specification can also be provided directly on command line preceded by <tt>--input-format=</tt> option. | |||
Assuming that the access log file is named <tt>access_log.log</tt> and the log specification is stored in <tt>access_log.def</tt> in the same directory, a short sanity check can be performed by running <tt>events</tt> without any command: | |||
<pre> | |||
events < access_log.log --input-format-file=./access_log.def | |||
</pre> | |||
The output consists of parsed HTTP requests data, and any problem with the log data or the format specification will immediately become obvious, either as an error that stops processing or as faults. | |||
If the HTTP request parsing does not cause errors, extract high level scenario statistics with: | |||
<pre> | |||
events < access_log.log --input-format-file=./access_log.def business-scenario --stats | |||
</pre> | |||
The result should be similar to: | |||
<pre> | |||
Counters | |||
business scenarios: 7743 (3 different states) | |||
NORMAL: 7371, duration min/avg/max: 38/13397/33304 ms, reqs/scenario min/avg/max: 30/36.73/37 | |||
INCOMPLETE: 342, duration min/avg/max: 1270/11662/20310 ms, reqs/scenario min/avg/max: 4/20.82/37 | |||
CLOSED_BY_START_MARKER: 30, duration min/avg/max: 5343/18836/32691 ms, reqs/scenario min/avg/max: 48/51.03/52 | |||
faults: 134355 (3 different types) | |||
NO_JSESSIONID_COOKIE: 1017 | |||
NO_ACTIVE_BUSINESS_SCENARIO: 132502 | |||
MISSING_ITERATION_ID: 836 | |||
other events: 1 | |||
HTTP requests: 412922 | |||
HTTP sessions: 434 | |||
</pre> | |||
The <tt>NO_JSESSIONID_COOKIE</tt> and <tt>NO_OPEN_BUSINESS_SCENARIO</tt> faults are normal, they indicate unauthenticated requests and requests that fall outside marked scenarios. | |||
Per-scenarios statistics can be extracted with: | |||
<pre> | |||
events < access_log.log --input-format-file=./access_log.def business-scenario --ignore-faults > business-scenarios.csv | |||
</pre> | |||
Scatter plot the results. | |||
[[Image:sample1.png]] | |||
=Business Scenario Measurement Procedure= | =Business Scenario Measurement Procedure= | ||
==Record the Load Scenarios== | |||
<font color=red>OBSOLETE</font> | |||
<font color=darkgray> | |||
Record interaction with a load generator. This example was based on NeoLoad. | |||
Mark the start of the target business scenarios. | |||
Design -> Virtual User Profiles -> Style Reader -> Actions -> Style - Seasons - Style - Style Sample - Style Gallery -> First Page -> First request in the page -> Advanced -> Request headers: | |||
Add a new header: "Business-Scenario-Start-Marker" (the exact name is available in [https://github.com/NovaOrdis/events/blob/master/src/main/java/io/novaordis/events/extensions/bscenarios/BusinessScenario.java BusinessScenario.java]). The value of the header should be business scenario type. | |||
Mark the end of the target business scenarios. | |||
Design -> Virtual User Profiles -> Style Reader -> Actions -> Style - Seasons - Style - Style Sample - Style Gallery -> RequestHandler_16 -> First request in page -> Advanced -> Request headers: | |||
Add a new header: "Business-Scenario-Start-Marker" (the exact name is available in [https://github.com/NovaOrdis/events/blob/master/src/main/java/io/novaordis/events/extensions/bscenarios/BusinessScenario.java BusinessScenario.java]). '''Do Not use an empty value''' - NeoLoad does not send that or the undertow logging does not log it. Use the same string used to mark the scenario start (the business scenario type). | |||
Save. | |||
</font> | |||
==Prepare the Target Environment== | |||
===Configure the Access Log Output=== | |||
<font color=red>OBSOLETE</font> | |||
<font color=darkgray> | |||
This is necessary to be done once. | |||
Stop the server. | |||
<pre> | |||
cd /c/ovidiu/bin | |||
./environment.sh stop | |||
</pre> | |||
Update the application server configuration file <access-log> section (if you copy and paste, open this in edit mode to correctly copy quots): | |||
<pre> | |||
... | |||
<subsystem xmlns="urn:jboss:domain:undertow:1.1"> | |||
... | |||
<server name="default-server" > | |||
... | |||
<host name="default-host" alias="localhost"> | |||
... | |||
<access-log pattern=""%I" %h %u [%t] "%r" "%q" %s %b %D %{i,Business-Scenario-Start-Marker} %{i,Business-Scenario-Stop-Marker} %{c,JSESSIONID}"/> | |||
... | |||
</host> | |||
</server> | |||
</subsystem> | |||
... | |||
</pre> | |||
</font> | |||
===Start the Environment=== | |||
<font color=red>OBSOLETE</font> | |||
<font color=darkgray> | |||
On the target environment, reset the application server node: | |||
<pre> | |||
cd /c/ovidiu/bin | |||
./environment.sh start | |||
</pre> | |||
The start script will also clean the previous logs. | |||
</font> | |||
==Run the Test== | |||
==Shut Down and Collect Data== | |||
<font color=red>OBSOLETE</font> | |||
<font color=darkgray> | |||
<pre> | |||
cd /c/ovidiu/bin | |||
./environment.sh stop | |||
</pre> | |||
All log data is collected and zipped under /c/ovidiu/data/load-data-yy-mm-dd-hh-mm-ss...zip | |||
Download the test data locally via the QLB-APP02-Redirected-Folder on NOMBP2. | |||
Unzip it in its own separated directory. | |||
The data export script keeps the access log as “access_log.log” and places the definition of the access log fields in access_log.def. | |||
</font> |
Latest revision as of 00:42, 5 November 2016
Internal
Overview
"events" is Java library and a set of command line tools that process timed event series.
Its most basic usage is to convert stdout data into a timed event series sent to stdout:
events < input-file [global-options] <input-format-specification>
This syntax exercise the default command, "parse". For more details, see parse Command.
Additional commands can be invoked with the syntax:
events < input-file [global-options] command [command-arguments]
Commands
Everything below this line must be reviewed
Concepts
Faults
A fault is a HTTP request that exhibit some sort of problem, which is not serious enough to indicated corrupted data and stop processing. The faults are shown in statistics.
Common fault types:
- NO_JSESSIONID_COOKIE: the request does not have a JSESSIONID cookie, which means it was sent before authentication and session establishment, or after the session was closed. These requests are reported in summary statistics and usually ignored.
- NO_REQUEST_DURATION_INFO: No request duration information was found in the input data stream. This fault indicates a potentially serious condition, as it won't be possible to calculate request and business scenario durations. A common cause is omitting to set in the WildFly configuration.
- NO_OPEN_BUSINESS_SCENARIO: these faults are generated by the request arriving "between" scenarios. This is a normal condition and they should be usually ignored.
More details:
Business Scenarios
events extracts business scenario statistics and can identify business scenarios in one of these states:
- COMPLETE: the scenario has been closed normally by the occurrence of a STOP marker. If the load was sent sequentially, it is guaranteed that all component HTTP requests have been applied to the scenario.
- INCOMPLETE: we ran out of event data while the scenario was in an OPEN state, usually because we reached the end of the log file, without encountering a STOP marker. This happens when the log generator stops abruptly in the middle of an iteration.
- CLOSED_BY_START_MARKER: we did not encounter the STOP marker, but we did encounter a START marker of a new scenario for the same session.
More details:
null Events
Blocking queues do not accept null elements, so we cannot have null events.
Installation
Download the latest binary release from:
Unzip the binary release file into the directory where third party tools are usually installed on your system (/usr/local, /opt, etc.). Extraction will create a events-<version> directory.
Create an "event" symbolic link to the newly created directory. Assuming the extraction directory was /opt:
cd /opt ln -s events-<version> events
where "<version>" should be replaced with the actual value.
If the link exists and points to an older value, first remove the link and then recreated it.
Add /opt/events/bin to your PATH:
export PATH=/opt/events/bin:${PATH}
Test installation by running:
events version
Business Scenario Data Processing
This section describes the steps required to extract business scenario data from raw httpd access logs. events needs the access log and the httpd log format specification that was used when the log was generated. The format is usually collected automatically and placed in an access_log.def, which is specified to events with the --input-format-file= option. However, the format specification can also be provided directly on command line preceded by --input-format= option.
Assuming that the access log file is named access_log.log and the log specification is stored in access_log.def in the same directory, a short sanity check can be performed by running events without any command:
events < access_log.log --input-format-file=./access_log.def
The output consists of parsed HTTP requests data, and any problem with the log data or the format specification will immediately become obvious, either as an error that stops processing or as faults.
If the HTTP request parsing does not cause errors, extract high level scenario statistics with:
events < access_log.log --input-format-file=./access_log.def business-scenario --stats
The result should be similar to:
Counters business scenarios: 7743 (3 different states) NORMAL: 7371, duration min/avg/max: 38/13397/33304 ms, reqs/scenario min/avg/max: 30/36.73/37 INCOMPLETE: 342, duration min/avg/max: 1270/11662/20310 ms, reqs/scenario min/avg/max: 4/20.82/37 CLOSED_BY_START_MARKER: 30, duration min/avg/max: 5343/18836/32691 ms, reqs/scenario min/avg/max: 48/51.03/52 faults: 134355 (3 different types) NO_JSESSIONID_COOKIE: 1017 NO_ACTIVE_BUSINESS_SCENARIO: 132502 MISSING_ITERATION_ID: 836 other events: 1 HTTP requests: 412922 HTTP sessions: 434
The NO_JSESSIONID_COOKIE and NO_OPEN_BUSINESS_SCENARIO faults are normal, they indicate unauthenticated requests and requests that fall outside marked scenarios.
Per-scenarios statistics can be extracted with:
events < access_log.log --input-format-file=./access_log.def business-scenario --ignore-faults > business-scenarios.csv
Scatter plot the results.
Business Scenario Measurement Procedure
Record the Load Scenarios
OBSOLETE
Record interaction with a load generator. This example was based on NeoLoad.
Mark the start of the target business scenarios.
Design -> Virtual User Profiles -> Style Reader -> Actions -> Style - Seasons - Style - Style Sample - Style Gallery -> First Page -> First request in the page -> Advanced -> Request headers:
Add a new header: "Business-Scenario-Start-Marker" (the exact name is available in BusinessScenario.java). The value of the header should be business scenario type.
Mark the end of the target business scenarios.
Design -> Virtual User Profiles -> Style Reader -> Actions -> Style - Seasons - Style - Style Sample - Style Gallery -> RequestHandler_16 -> First request in page -> Advanced -> Request headers:
Add a new header: "Business-Scenario-Start-Marker" (the exact name is available in BusinessScenario.java). Do Not use an empty value - NeoLoad does not send that or the undertow logging does not log it. Use the same string used to mark the scenario start (the business scenario type).
Save.
Prepare the Target Environment
Configure the Access Log Output
OBSOLETE
This is necessary to be done once.
Stop the server.
cd /c/ovidiu/bin ./environment.sh stop
Update the application server configuration file <access-log> section (if you copy and paste, open this in edit mode to correctly copy quots):
... <subsystem xmlns="urn:jboss:domain:undertow:1.1"> ... <server name="default-server" > ... <host name="default-host" alias="localhost"> ... <access-log pattern=""%I" %h %u [%t] "%r" "%q" %s %b %D %{i,Business-Scenario-Start-Marker} %{i,Business-Scenario-Stop-Marker} %{c,JSESSIONID}"/> ... </host> </server> </subsystem> ...
Start the Environment
OBSOLETE
On the target environment, reset the application server node:
cd /c/ovidiu/bin ./environment.sh start
The start script will also clean the previous logs.
Run the Test
Shut Down and Collect Data
OBSOLETE
cd /c/ovidiu/bin ./environment.sh stop
All log data is collected and zipped under /c/ovidiu/data/load-data-yy-mm-dd-hh-mm-ss...zip
Download the test data locally via the QLB-APP02-Redirected-Folder on NOMBP2.
Unzip it in its own separated directory.
The data export script keeps the access log as “access_log.log” and places the definition of the access log fields in access_log.def.