Bug 875207

Summary: [iis] ResponseTime data fails to be collected due to file offset calculation issue
Product: [Other] RHQ Project Reporter: Larry O'Leary <loleary>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.4CC: ajuricic, hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Windows   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=875203
https://bugzilla.redhat.com/show_bug.cgi?id=873495
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 875206 Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 875206    

Description Larry O'Leary 2012-11-09 14:54:27 EST
+++ This bug was initially created as a clone of JBoss ON Bug #875206 +++

Description of problem:
Response time metrics are not being read from the IIS VHost log file due to what appears to be a file offset issue. The agent log contains the following:

INFO  [ResourceContainer.invoker.daemon-2] (org.rhq.plugins.iis.IISResponseTimeDelegate$IISResponseTimeLogParser)- Filesize 702
INFO  [ResourceContainer.invoker.daemon-2] (org.rhq.plugins.iis.IISResponseTimeDelegate$IISResponseTimeLogParser)- Skipping 702
INFO  [ResourceContainer.invoker.daemon-2] (org.rhq.plugins.iis.IISResponseTimeDelegate$IISResponseTimeLogParser)- Results...

Which seems to indicate that previousOffset is always equal to newOffset. The result is not log information appears to be parsed.

Version-Release number of selected component (if applicable):
4.4.0.JON311GA

How reproducible:
Always

Additional info:
Details from the support engineering who did the preliminary investigation:

Checking the IISResponseTimeDelegate class again, I realized that the "parsing" was not being done because the currentLine variable is coming as "null". I think it happens due the Filesize and Skipping have the same value (as we can see in the debug messages above), then the "in" variable is set to "null" or "0" (not sure). Follow a snippet of the code: 
__________________________________________________________________

* parseLog method in IISResponseTimeDelegate class:

 log.info("Filesize " + newOffset);
 log.info("Skipping " + previousOffset);
 in.skip(IISResponseTimeDelegate.this.previousOffset);
 IISResponseTimeDelegate.this.previousOffset = newOffset;

 String currentLine;
 while ((currentLine = in.readLine()) != null) {
    LogEntry logEntry;
    log.info("Parsing line: " + currentLine);
    try {
       logEntry = parseLine(currentLine);
__________________________________________________________________

I performed another test commenting the in.skip... line, then the CallTime was collected correctly.
Comment 1 Amana 2012-11-12 11:40:10 EST

After performing the steps described in https://bugzilla.redhat.com/show_bug.cgi?id=873494 and https://bugzilla.redhat.com/show_bug.cgi?id=875203, I still can not collect Response Time (CallTime) data from IIS7+. I could see the INFO messages about Filesize and Skipping in the agent.log after renaming manually the IIS VHost log file from "u_ex121108" to "ex121108".

To get around that, I just commented the following line in IISReponseTimeDelegate class:

   in.skip(IISResponseTimeDelegate.this.previousOffset);

And imported the iis plug-in again for the agent. After that, the parse was performed properly.