Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To the package "org.apache.ignite.metric" we add:

  • BooleanValueMetric
  • IntValueMetric
  • LongValueMetric
  • LongSumMetric (a long adder)
  • DoubleValueMetric
  • AnyValueMetric<T> (an object metric)(an object metric)

Names like "LongMetric" or "ObjectMetric" we already have in the package "org.apache.ignite.spi.metric".


3.3 Examples of new  writeable metric intefraces

package org.apache.ignite.metric;

/** Updatable object value metric. */
@IgniteExperimental
public interface AnyValueMetric<T> extends ObjectMetric<T> {
/** Sets object metric value./
void value(T value);
}

/** Updatable simple double value metric. */
@IgniteExperimental
public interface DoubleValueMetric extends DoubleMetric {
/** Raises metric value. */
void add(double value);

/** Sets double metric value. */
void value(double value);
}

/** Updatable long metric which is efficient with adding values. Calculates sum in {@link LongMetric#value()}. */
@IgniteExperimental
public interface LongSumMetric extends LongMetric {
/** Raises metric value. */
void add(long value);

/** Increments metric value with 1L. */
void increment();

/** Decrements metric value with -1L. */
void decrement();
}

/** Updatable simple long value metric. */
@IgniteExperimental
public interface LongValueMetric extends LongSumMetric {
/** Sets long metric value. */
void value(long value);
}

4. Minimal Custom Metric interface

...