Class Synthetic


  • public final class Synthetic
    extends Object
    A generator of synthetic cache events to simulate different caching patterns.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static LongStream counter​(int start, int events)
      Returns a sequence of unique integers.
      static LongStream exponential​(double mean, int events)
      Returns a sequence of events based on an exponential distribution.
      static TraceReader.KeyOnlyTraceReader generate​(BasicSettings.TraceSettings settings)
      Returns a sequence of events based on the setting's distribution.
      static LongStream hotspot​(int lowerBound, int upperBound, double hotsetFraction, double hotOpnFraction, int events)
      Returns a sequence of events resembling a hotspot distribution where x% of operations access y% of data items.
      static LongStream repeating​(int items, int events)
      Returns a repeating sequence of integers.
      static LongStream scrambledZipfian​(int items, double constant, int events)
      Returns a sequence of events where some items are more popular than others, according to a zipfian distribution.
      static LongStream skewedZipfianLatest​(int items, int events)
      Returns a zipfian sequence with a popularity distribution of items, skewed to favor recent items significantly more than older items.
      static LongStream uniform​(int lowerBound, int upperBound, int events)
      Returns a sequence of events where items are selected uniformly randomly from the interval inclusively.
      static LongStream zipfian​(int items, double constant, int events)
      Returns a sequence of events where some items are more popular than others, according to a zipfian distribution.
    • Method Detail

      • counter

        public static LongStream counter​(int start,
                                         int events)
        Returns a sequence of unique integers.
        Parameters:
        start - the number that the counter starts from
        events - the number of events in the distribution
      • repeating

        public static LongStream repeating​(int items,
                                           int events)
        Returns a repeating sequence of integers.
        Parameters:
        items - the number of items in the distribution
        events - the number of events in the distribution
      • uniform

        public static LongStream uniform​(int lowerBound,
                                         int upperBound,
                                         int events)
        Returns a sequence of events where items are selected uniformly randomly from the interval inclusively.
        Parameters:
        lowerBound - lower bound of the distribution
        upperBound - upper bound of the distribution
        events - the number of events in the distribution
        Returns:
        a stream of cache events
      • exponential

        public static LongStream exponential​(double mean,
                                             int events)
        Returns a sequence of events based on an exponential distribution. Smaller intervals are more frequent than larger ones, and there is no bound on the length of an interval.
        Parameters:
        mean - mean arrival rate of gamma (a half life of 1/gamma)
        events - the number of events in the distribution
      • hotspot

        public static LongStream hotspot​(int lowerBound,
                                         int upperBound,
                                         double hotsetFraction,
                                         double hotOpnFraction,
                                         int events)
        Returns a sequence of events resembling a hotspot distribution where x% of operations access y% of data items. The parameters specify the bounds for the numbers, the percentage of the interval which comprises the hot set and the percentage of operations that access the hot set. Numbers of the hot set are always smaller than any number in the cold set. Elements from the hot set and the cold set are chosen using a uniform distribution.
        Parameters:
        lowerBound - lower bound of the distribution
        upperBound - upper bound of the distribution
        hotsetFraction - percentage of data item
        hotOpnFraction - percentage of operations accessing the hot set
        events - the number of events in the distribution
      • scrambledZipfian

        public static LongStream scrambledZipfian​(int items,
                                                  double constant,
                                                  int events)
        Returns a sequence of events where some items are more popular than others, according to a zipfian distribution. Unlike zipfian(int, double, int), the generated sequence scatters the "popular" items across the item space. Use if you don't want the head of the distribution (the popular items) clustered together.
        Parameters:
        items - the number of items in the distribution
        constant - the skew factor for the distribution
        events - the number of events in the distribution
      • skewedZipfianLatest

        public static LongStream skewedZipfianLatest​(int items,
                                                     int events)
        Returns a zipfian sequence with a popularity distribution of items, skewed to favor recent items significantly more than older items.
        Parameters:
        items - the number of items in the distribution
        events - the number of events in the distribution
      • zipfian

        public static LongStream zipfian​(int items,
                                         double constant,
                                         int events)
        Returns a sequence of events where some items are more popular than others, according to a zipfian distribution.
        Parameters:
        items - the number of items in the distribution
        constant - the skew factor for the distribution
        events - the number of events in the distribution