Article Index
Tutorial
Part 1: Tutorial Setup
Part 2: Install Beet
Part 3: Examine the data
Part 4: JMX Administration
Part 4 Continued: Performance Statistics
Part 5: Log analysis with beet-util
Following Up
All Pages

Part 3: Examine the data

Start your Tomcat server back up.  Wait about 30 seconds to 1 minute, and then open up [TOMCAT]/logs/beet-hello-perf.xml.  You should already see some data (formatted here for legibility):

<event id="6dc8bd6c-c63c-4ecc-803c-9a1bc7dcf4c7"><type>jdbc</type><name>executeUpdate</name>
<application>beet-hello</application><start>2009-04-23T12:40:03.547-07:00</start><duration-ns>0</duration-ns>
<event-data><sql>drop table HelloData if exists</sql></event-data>
</event>
<event id="a3085baf-49a0-4a5b-90c1-d210e4524786"><type>jdbc</type><name>executeUpdate</name>
<application>beet-hello</application><start>2009-04-23T12:40:03.547-07:00</start><duration-ns>0</duration-ns>
<event-data><sql>create table HelloData (id bigint generated by default as identity (start with 1), AField varchar(255), anotherField varchar(255), primary key (id))</sql></event-data>
</event>

We're using the Hibernate "schema create" feature to create our backend database at system startup.  Hibernate used the Spring dataSource bean for data access, so those statements were logged.

Point your browser again at http://localhost:8080/beet-hello. As before, click 'create', delete some records, add some records.  Wait at least another 30 seconds, and revisit the beet log.  It should have a host of new data.   Here's some data for a single press of the 'delete' button, again formatted for legibility:

<event id="244f5f4e-21d0-4044-b71f-ba39bb96cfbd" parent-id="778e4a40-48a8-4386-b93c-72e322663a90">
<type>jdbc</type><name>executeBatch</name><application>beet-hello</application>
<start>2009-04-23T13:50:37.625-07:00</start><duration-ns>0</duration-ns>
<session-id>53FAB2406DB3CFAE8BD4201D6DD60D73</session-id>
<event-data><sql>delete from HelloData where id=?</sql>
<batch><parameters><param>1</param></parameters></batch>
</event-data>
</event>
<event id="778e4a40-48a8-4386-b93c-72e322663a90" parent-id="9d2f5856-193f-4fe7-a7d5-51b5a355e4cf">
<type>method</type><name>com.mtgi.analytics.example.service.HelloService.delete</name><application>beet-hello</application>
<start>2009-04-23T13:50:37.531-07:00</start><duration-ns>109</duration-ns>
<session-id>53FAB2406DB3CFAE8BD4201D6DD60D73</session-id>
<event-data><parameters><param>{object}</param></parameters><result/></event-data>
</event>
<event id="a80fa0c7-5902-4905-a785-8a7420d98b67" parent-id="607e7fb6-6c11-4c54-ae25-a2aac1ab9336">
<type>jdbc</type><name>executeQuery</name><application>beet-hello</application>
<start>2009-04-23T13:50:37.640-07:00</start><duration-ns>0</duration-ns>
<session-id>53FAB2406DB3CFAE8BD4201D6DD60D73</session-id>
<event-data><sql>select hellodata0_.id as id0_, hellodata0_.AField as AField0_, hellodata0_.anotherField as anotherF3_0_ from HelloData hellodata0_ order by hellodata0_.id</sql></event-data>
</event>
<event id="607e7fb6-6c11-4c54-ae25-a2aac1ab9336" parent-id="9d2f5856-193f-4fe7-a7d5-51b5a355e4cf">
<type>method</type><name>com.mtgi.analytics.example.service.HelloService.list</name><application>beet-hello</application>
<start>2009-04-23T13:50:37.640-07:00</start><duration-ns>0</duration-ns>
<session-id>53FAB2406DB3CFAE8BD4201D6DD60D73</session-id>
<event-data><parameters><param>id</param></parameters>
<result type="java.util.ArrayList">{object}</result></event-data>
</event>
<event id="9d2f5856-193f-4fe7-a7d5-51b5a355e4cf">
<type>http-request</type><name>/beet-hello/</name><application>beet-hello</application>
<start>2009-04-23T13:50:37.515-07:00</start><duration-ns>157</duration-ns>
<event-data uri="/beet-hello/" protocol="HTTP/1.1" method="POST" remote-address="127.0.0.1" remote-host="127.0.0.1">
<parameters><param name="command"><value>delete</value></param></parameters>
</event-data>
</event>

A few things are worth calling out:

  1. Each event has a globally unique ID (the "id" attribute), and if it is a nested event, a parent ID. 

    For example, the first event is the SQL statement "delete from HelloData where id=?" with parent-id="778e4a40-48a8-4386-b93c-72e322663a90".  Further down the log we can find the parent event, which was the method call "com.mtgi.analytics.example.service.HelloService.delete".

  2. Events are persisted in the order in which they are completed, so child events appear before parent events.  Therefore the root of all these events, the "http-request" event with name "/beet-hello/", appears at the bottom of the log snippet.

  3. Each event is identified by type, name, and application.  All of our events are in the "beet-hello" application.  We have three types of events, "method", "jdbc", and "http-request".  The meaning of name depends on type. 
    1. The name for "method" events is "package.class.methodName". 
    2. The name for "http-request" events is "/context-relative-uri". 
    3. The name for "jdbc" events is the JDBC Statement method used to execute the SQL, e.g. "executeBatch", "executeQuery", etc.  The actual SQL statement can be found in the nested <event-data> element.