Packages

package util

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. abstract class Clock extends java.time.Clock

    Extension on Java's Clock that exposes additional APIs to work with nanoTime values.

  2. class DynamicAccess extends AnyRef

    Utility class for creating instances from a FQCN, see [1] for the original source.

    Utility class for creating instances from a FQCN, see [1] for the original source. It uses reflection to turn fully-qualified class names into a Class[_] from which instances can be created. All methods in this class are unsafe and might throw exceptions that should be handled by users if this class.

    [1] https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/actor/ReflectiveDynamicAccess.scala

  3. class EWMA extends AnyRef

    Exponentially Weighted Moving Average implementation with thread safety guarantees.

    Exponentially Weighted Moving Average implementation with thread safety guarantees. Users of this class should periodically record values on the structure and are free to read the current average at any time. This implementation does not make any assumptions regarding the time between recordings and leaves the responsibility of deciding when to record values to the user.

    The only required parameter is the weighting factor, which effectively determines how quickly the moving average will adapt to new data. The weighting factor is a number between 0 and 1 (exclusive). The closer the weighting factor is to 0, the more influence new values will have over the moving average and thus the moving average is more responsive; conversely, if the weighting factor is closer to 1, the moving average will take more iterations to adapt to new data.

  4. trait Filter extends AnyRef

    Decides whether a given String satisfy a group of includes and excludes patterns.

  5. class UnifiedMap[K, V] extends Map[K, V]

    This is a stripped down version of UnifiedMap in Eclipse Collections [1].

    This is a stripped down version of UnifiedMap in Eclipse Collections [1]. Even though in general, Eclipse Collections are pretty neat, we only needed the UnifiedMap, not the entire 10+ MB of jar files that come with it and sadly, we could not find an efficient way to shade the dependency so ended up copying the necessary parts of it.

    UnifiedMap stores key/value pairs in a single array, where alternate slots are keys and values. This is nicer to CPU caches as consecutive memory addresses are very cheap to access. Entry objects are not stored in the table like in java.util.HashMap. Instead of trying to deal with collisions in the main array using Entry objects, we put a special object in the key slot and put a regular Object[] in the value slot. The array contains the key value pairs in consecutive slots, just like the main array, but it's a linear list with no hashing.

    The final result is a Map implementation that's leaner than java.util.HashMap and faster than Trove's THashMap. The best of both approaches unified together, and thus the name UnifiedMap.

    [1] https://github.com/eclipse/eclipse-collections

  6. class UnitConverter extends AnyRef

    Utility class that converts values and distributions to a desired unit.

    Utility class that converts values and distributions to a desired unit. This class provides a convenient way to keep fixed preferences regarding what time and information units to expect on the output and apply those conversion when possible.

Value Members

  1. object CallingThreadExecutionContext extends ExecutionContext

    Execution Context that runes any submitted task on the calling thread.

    Execution Context that runes any submitted task on the calling thread. This is meant to be used for small code blocks like recording or finishing a Span that usually happen after completing a Future.

  2. object Clock
  3. object EWMA
  4. object EnvironmentTags

    Utility class for creating TagSet instances out of Environment instances.

    Utility class for creating TagSet instances out of Environment instances. When an Environment is turned into tags it will generate the following pairs:

    • "service", with the service name from the Environment
    • "host", with the host name from the Environment
    • "instance", with the instance name from the Environment
    • One additional pair for each Environment tag, unless exclusions are provided when transforming.

    Most uses of this class are expected to happen in reporter modules, where the Environment information should usually be exposed along with the metrics and spans.

  5. object Filter
  6. object HexCodec

Ungrouped