Tabnine Logo
HystrixRollingNumber$CumulativeSum
Code IndexAdd Tabnine to your IDE (free)

How to use
HystrixRollingNumber$CumulativeSum
in
com.netflix.hystrix.util

Best Java code snippets using com.netflix.hystrix.util.HystrixRollingNumber$CumulativeSum (Showing top 8 results out of 315)

origin: PipelineAI/pipeline

cumulativeSum.addBucket(lastBucket);
origin: com.netflix.hystrix/hystrix-core

cumulativeSum.addBucket(lastBucket);
origin: com.netflix.hystrix/hystrix-core

/**
 * Get the cumulative sum of all buckets ever since the JVM started without rolling for the given {@link HystrixRollingNumberEvent} type.
 * <p>
 * See {@link #getRollingSum(HystrixRollingNumberEvent)} for the rolling sum.
 * <p>
 * The {@link HystrixRollingNumberEvent} must be a "counter" type <code>HystrixRollingNumberEvent.isCounter() == true</code>.
 * 
 * @param type HystrixRollingNumberEvent defining which counter to retrieve values from
 * @return cumulative sum of all increments and adds for the given {@link HystrixRollingNumberEvent} counter type
 */
public long getCumulativeSum(HystrixRollingNumberEvent type) {
  // this isn't 100% atomic since multiple threads can be affecting latestBucket & cumulativeSum independently
  // but that's okay since the count is always a moving target and we're accepting a "point in time" best attempt
  // we are however putting 'getValueOfLatestBucket' first since it can have side-affects on cumulativeSum whereas the inverse is not true
  return getValueOfLatestBucket(type) + cumulativeSum.get(type);
}
origin: com.netflix.hystrix/hystrix-core

/**
 * Force a reset of all rolling counters (clear all buckets) so that statistics start being gathered from scratch.
 * <p>
 * This does NOT reset the CumulativeSum values.
 */
public void reset() {
  // if we are resetting, that means the lastBucket won't have a chance to be captured in CumulativeSum, so let's do it here
  Bucket lastBucket = buckets.peekLast();
  if (lastBucket != null) {
    cumulativeSum.addBucket(lastBucket);
  }
  // clear buckets so we start over again
  buckets.clear();
}
origin: com.netflix.hystrix/hystrix-core

public void addBucket(Bucket lastBucket) {
  for (HystrixRollingNumberEvent type : HystrixRollingNumberEvent.values()) {
    if (type.isCounter()) {
      getAdder(type).add(lastBucket.getAdder(type).sum());
    }
    if (type.isMaxUpdater()) {
      getMaxUpdater(type).update(lastBucket.getMaxUpdater(type).max());
    }
  }
}
origin: PipelineAI/pipeline

/**
 * Get the cumulative sum of all buckets ever since the JVM started without rolling for the given {@link HystrixRollingNumberEvent} type.
 * <p>
 * See {@link #getRollingSum(HystrixRollingNumberEvent)} for the rolling sum.
 * <p>
 * The {@link HystrixRollingNumberEvent} must be a "counter" type <code>HystrixRollingNumberEvent.isCounter() == true</code>.
 * 
 * @param type HystrixRollingNumberEvent defining which counter to retrieve values from
 * @return cumulative sum of all increments and adds for the given {@link HystrixRollingNumberEvent} counter type
 */
public long getCumulativeSum(HystrixRollingNumberEvent type) {
  // this isn't 100% atomic since multiple threads can be affecting latestBucket & cumulativeSum independently
  // but that's okay since the count is always a moving target and we're accepting a "point in time" best attempt
  // we are however putting 'getValueOfLatestBucket' first since it can have side-affects on cumulativeSum whereas the inverse is not true
  return getValueOfLatestBucket(type) + cumulativeSum.get(type);
}
origin: PipelineAI/pipeline

/**
 * Force a reset of all rolling counters (clear all buckets) so that statistics start being gathered from scratch.
 * <p>
 * This does NOT reset the CumulativeSum values.
 */
public void reset() {
  // if we are resetting, that means the lastBucket won't have a chance to be captured in CumulativeSum, so let's do it here
  Bucket lastBucket = buckets.peekLast();
  if (lastBucket != null) {
    cumulativeSum.addBucket(lastBucket);
  }
  // clear buckets so we start over again
  buckets.clear();
}
origin: PipelineAI/pipeline

public void addBucket(Bucket lastBucket) {
  for (HystrixRollingNumberEvent type : HystrixRollingNumberEvent.values()) {
    if (type.isCounter()) {
      getAdder(type).add(lastBucket.getAdder(type).sum());
    }
    if (type.isMaxUpdater()) {
      getMaxUpdater(type).update(lastBucket.getMaxUpdater(type).max());
    }
  }
}
com.netflix.hystrix.utilHystrixRollingNumber$CumulativeSum

Javadoc

Cumulative counters (from start of JVM) from each Type

Most used methods

  • addBucket
  • get
  • getAdder
  • getMaxUpdater

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now