AdamBien / lightfish

Payara / GlassFish Monitoring Utility
121 stars 41 forks source link

Log Gathering and Session Token Authentication #14

Closed rveldpau closed 11 years ago

rveldpau commented 11 years ago

One new feature and one improvement in this pull request

New Feature: Log Gathering

When looking at the information available in Lightfish it is useful to correlate that information with logs from the server. As part of the data collection Lightfish can now also pull new log entries from the time of the last log it received.

Now when using the HTML5 version of Lightview, when you double-click on a snapshot in the "Snapshots" tab, at the bottom of the snapshot details are the logs that were collected with that snapshot. (Currently not working for the combined snapshot, only on specific instances).

Collecting log entries with the snapshots does come with some performance concerns, mainly around bandwidth. It should not be a large concern to gather the logs from the server, but depending on how much you log, maybe it is. My bigger concern is disseminating the information to anyone who may be watching in Lightview. To that end the log records are not transported with the snapshot itself. Instead, a separate call must be made to retrieve the log records for the snapshot. This allows the snapshot data to remain small and quick, but requires an extra Ajax call back to the server to retrieve the logs when required.

There are also two more rest services available for retrieving log records. One retrieves records after a specified time, and one retrieves log records between the specified times. I hope to also make a page to view log entries utilizing these services, but that can wait since calling them directly can suffice for now.

You can disable log collection in the advanced configuration.

Improvement: Session Token Authentication

It occurred to me that re-authenticating with every request may be slower than using a session token for authentication, so I decided to test this theory. In fact, this turned out to be true, and quite considerably. In my test, my data collection originally took on average about 5.4 seconds, when I switched to using session tokens it took an average of 3.6 seconds, thats a whopping 33% faster.

Other minor improvements

AdamBien commented 11 years ago

Thanks, and sorry for the late reaction.