unloggedio / unlogged-sdk

Unlogged SDK for recording JAVA code execution
https://unlogged.io
Apache License 2.0
181 stars 18 forks source link

Adding support for frequency logging #21

Closed kartikeytewari-ul closed 5 months ago

kartikeytewari-ul commented 11 months ago

Frequency Logging Enhancement

Overview

Introducing the Frequency Logging feature, which enables frequency based stack call logging in Java programs at pre-defined intervals. This flexibility is achieved by setting the logging frequency at compile time, with options available at the program, class, and method level.

Annotation Options

The logging frequency can be easily specified using annotations. The new annotation options are:

Method Compilation States:

A compiled method falls into one of three states:

  1. Always probed: only methodVisitorProbed is called
  2. Never probed: no method visitor is invoked
  3. Conditionally probed: both methodVisitorProbed and methodVisitorWithoutProbe are called

Implementation Details

The feature is implemented as follows:

By following these implementation details, the Frequency Logging enhancement ensures precise control over stack call logging in Java programs.

Sanity Testing

  1. version 0.2.0

    • Project: branch main of unlogged-spring-maven-demo
    • Total number of cases run : 368
    • Number of Passing cases : 112
    • Number of Failing cases : 256
  2. version freq_logging

    • Project: branch test_freq_logging of unlogged-spring-maven-demo
    • Total number of cases run : 368
    • Number of Passing cases : 112
    • Number of Failing cases : 256
    • The tests that were failing/passing were identical for both the sdks.
kartikeytewari-ul commented 5 months ago

The replay_target pipeline is failing because the tests defined in the python file are not present in the project test resources. Once, updated this test needs to run again.