Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup RunningAverage implementations #989

Open
wants to merge 4 commits into
base: next
Choose a base branch
from

Commits on Oct 13, 2024

  1. RunningAverage: replace synchronization with immutable state

    Simplify the implementations of the RunningAverage interface by
    separating the data being kept into an immutable object. This way we no
    longer have to synchronize on everything, but rather update the data
    object using compare-and-set.
    
    MedianMeanRunningAverage is not included in this effort because that
    performance would be hurt due to the large amount of data kept.
    bertm committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    fd88815 View commit details
    Browse the repository at this point in the history
  2. RunningAverage: reduce bookkeeping in SimpleRunningAverage

    The variables nextSlotPtr and curLen can trivially be derived from
    totalReports, remove the former variables.
    
    Additionally, synchronize on the internal array rather than on the
    instance itself to prevent potential locking issues.
    bertm committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    9a09bb3 View commit details
    Browse the repository at this point in the history
  3. RunningAverage: basic cleanup of MedianMeanRunningAverage

    This fixes lack of synchronization in the copy constructor, removes
    all the empty javadoc and generally improves code style.
    bertm committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    8b78902 View commit details
    Browse the repository at this point in the history
  4. RunningAverage: deprecate MedianMeanRunningAverage and replace its uses

    Replace all uses of MedianMeanRunningAverage with TrivialRunningAverage
    which does not eat an unbounded amount of RAM. This class was only used
    for debug purposes under the logMINOR flag. Having the median value in
    addition to mean value does likely not warrant the additional RAM and
    CPU consumption.
    
    Deprecate the class so that it can eventually be removed.
    bertm committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    ea3b8e4 View commit details
    Browse the repository at this point in the history