public class FaultInjectionUtil extends Object
| Constructor and Description |
|---|
FaultInjectionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,AtomicInteger> |
getConfigCenterMap()
Returns the map of config parameter key and values.
|
static int |
getFaultInjectionConfig(Invocation invocation,
String key)
Handles the reading fault injection configuration.
|
static AtomicLong |
getOperMetTotalReq(String key)
Returns total requests per provider for operational level.
|
static boolean |
isFaultNeedToInject(long reqCount,
int percentage)
It will check the delay/abort condition based on request count and percentage
received.
|
static void |
setConfigCenterValue(String key,
AtomicInteger value)
Sets the value for given config parameter.
|
public static AtomicLong getOperMetTotalReq(String key)
key - transport+operational namepublic static Map<String,AtomicInteger> getConfigCenterMap()
public static void setConfigCenterValue(String key, AtomicInteger value)
key - value - public static int getFaultInjectionConfig(Invocation invocation, String key)
invocation - invocation of requestkey - configuration keypublic static boolean isFaultNeedToInject(long reqCount,
int percentage)
reqCount - percentage - Copyright © 2017–2019 The Apache Software Foundation. All rights reserved.