KeyChooser

class KeyChooser(val distribution: String, val accounts: Int, seed: Long, zipfExponent: Double = DEFAULT_ZIPF_EXPONENT, hotFraction: Double = DEFAULT_HOT_FRACTION, hotKeys: Int = 1)

Which of the accounts seeded accounts a request targets: uniform, zipf (rank k drawn with a probability proportional to 1 / k^s, s = 1.1 by default), hot (a share hotFraction of the requests to the first hotKeys accounts, the rest uniform over all) or single (every request to the first account: the load of one aggregate, whose published stream is one partition's, #7109). Draws come from a seeded generator, so a run's sequence of keys is the same on both versions.

Constructors

Link copied to clipboard
constructor(distribution: String, accounts: Int, seed: Long, zipfExponent: Double = DEFAULT_ZIPF_EXPONENT, hotFraction: Double = DEFAULT_HOT_FRACTION, hotKeys: Int = 1)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

What describes the distribution in the results.

Link copied to clipboard
fun next(): Int

The next account's index, 0 to accounts - 1. Not thread-safe: the scheduler draws on its own thread.

Link copied to clipboard
fun nextOtherThan(index: Int): Int

An account other than index, drawn the same way: a transfer's target. A distribution of one account draws it uniformly among the others, as no draw of its own would ever give one.