Package com.saxonica.ee.bytecode

## Class ByteCodeMonitor

- java.lang.Object
- - com.saxonica.ee.bytecode.ByteCodeMonitor

-     public class ByteCodeMonitor
      extends java.lang.Object

  Class to accumulate statistics on the effectiveness of byte code generation. Enabled by setting the configuration property `Feature.MONITOR_HOT_SPOT_BYTE_CODE`

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `IntHashMap<com.saxonica.ee.bytecode.ByteCodeMonitor.ByteCodeDetails>` | `stats` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ByteCodeMonitor()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `logCompilation​(ByteCodeCandidate candidate, long time)` |
    `void` | `logExecution​(ByteCodeCandidate candidate, java.lang.String evalMode, long time)` |
    `void` | `report​(java.io.PrintWriter w)` | Generate an XML report of the collected statistics.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### stats

          public IntHashMap<com.saxonica.ee.bytecode.ByteCodeMonitor.ByteCodeDetails> stats

  - ### Constructor Detail

    - #### ByteCodeMonitor

          public ByteCodeMonitor()

  - ### Method Detail

    - #### logCompilation

          public void logCompilation​(ByteCodeCandidate candidate,
                                     long time)

    - #### logExecution

          public void logExecution​(ByteCodeCandidate candidate,
                                   java.lang.String evalMode,
                                   long time)

    - #### report

          public void report​(java.io.PrintWriter w)

      Generate an XML report of the collected statistics.

      The following attributes are output for each candidate expression. Timings are in microseconds:

      - `text` Abbreviated text of the expression
      - `intCount` Number of times the expression was evaluated in the interpreter
      - `intTime` Cumulative time spent evaluating the expression (including subexpressions) in the interpreter
      - `bcCount` Number of times the expression was evaluated as byte-code
      - `bcTime` Cumulative time spent evaluating the expression (including subexpressions) as byte-code
      - `compileTime` Time spent generating bytecode for the expression
      - `ratio` Average byte-code execution time as a proportion of average interpreted execution time
      - `ebv` Number of evaluations of the expressions `effectiveBooleanValue()` method
      - `eval` Number of evaluations of the expressions `evaluateItem()` method
      - `iterate` Number of evaluations of the expressions `iterate()` method
      - `process` Number of evaluations of the expressions `process()` method
      - `module` URI of the module containing the expression
      - `line` Line number of the expression within this module
      Parameters:
        `w` - the destination to which the generated XML will be written