public class PacingServiceConfig extends Object implements Config
AdCache
.Modifier and Type | Field and Description |
---|---|
static String |
BUDGET_ALLOCATION_STRATEGY_NAIVE
This strategy will allocate money to a current Ad as follows:
Figure out how many
refresh periods there are
between now and end of Ad 's flight.
Divide total remaining budget in the pacing cache by this number, and also by the number
of number of servers servicing this bid stream .
|
static String |
BUDGET_ALLOCATION_STRATEGY_WIN_RATE_BASED
This strategy will allocate the budget as
BUDGET_ALLOCATION_STRATEGY_NAIVE first,
and then calculate the win rate (wins/bids) and divide the budget by the win rate. |
private String |
budgetAllocationStrategy |
static String |
DEFAULT_BUDGET_ALLOCATION_STRATEGY |
static long |
DEFAULT_MESSAGE_TTL_MINUTES |
private double |
effectiveWinRateIfLessThanMin |
private int |
lockExpireSeconds |
private long |
messageTtlMinutes |
private RedisServiceConfig |
redis |
private double |
winRateMin |
private long |
winRateTtlMinutes |
Constructor and Description |
---|
PacingServiceConfig() |
Modifier and Type | Method and Description |
---|---|
String |
getBudgetAllocationStrategy()
How to allocated money from budget.
|
double |
getEffectiveWinRateIfLessThanMin() |
int |
getLockExpireSeconds() |
long |
getMessageTtlMinutes() |
RedisServiceConfig |
getRedis() |
double |
getWinRateMin() |
long |
getWinRateTtlMinutes() |
void |
setBudgetAllocationStrategy(String budgetAllocationStrategy) |
void |
setEffectiveWinRateIfLessThanMin(double effectiveWinRateIfLessThanMin) |
void |
setLockExpireSeconds(int lockExpireSeconds) |
void |
setMessageTtlMinutes(long messageTtlMinutes) |
void |
setRedis(RedisServiceConfig redis) |
void |
setWinRateMin(double winRateMin) |
void |
setWinRateTtlMinutes(long winRateTtlMinutes) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleUnknown
private double winRateMin
private double effectiveWinRateIfLessThanMin
private RedisServiceConfig redis
public static final long DEFAULT_MESSAGE_TTL_MINUTES
private long messageTtlMinutes
private long winRateTtlMinutes
public static final String BUDGET_ALLOCATION_STRATEGY_NAIVE
refresh periods
there are
between now and end of Ad
's flight.number of servers servicing this bid stream
.public static final String BUDGET_ALLOCATION_STRATEGY_WIN_RATE_BASED
BUDGET_ALLOCATION_STRATEGY_NAIVE
first,
and then calculate the win rate (wins/bids) and divide the budget by the win rate. In other
words, if the naive strategy resulted in allocation of micro$ 10000 and the win rate is 20%
(0.2), the new budget will be adjusted to 50000.public static final String DEFAULT_BUDGET_ALLOCATION_STRATEGY
private String budgetAllocationStrategy
private int lockExpireSeconds
public double getWinRateMin()
public void setWinRateMin(double winRateMin)
public double getEffectiveWinRateIfLessThanMin()
public void setEffectiveWinRateIfLessThanMin(double effectiveWinRateIfLessThanMin)
public long getMessageTtlMinutes()
public void setMessageTtlMinutes(long messageTtlMinutes)
public long getWinRateTtlMinutes()
public void setWinRateTtlMinutes(long winRateTtlMinutes)
public String getBudgetAllocationStrategy()
NOTE: This applies to allocating new money from the budget, and does not apply to what
to do with money allocated previously that was unspent. For that, see
getBudgetAllocationStrategy()
.
public void setBudgetAllocationStrategy(String budgetAllocationStrategy)
public RedisServiceConfig getRedis()
public void setRedis(RedisServiceConfig redis)
public int getLockExpireSeconds()
public void setLockExpireSeconds(int lockExpireSeconds)