public class Instance extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE |
static String |
JVM_DIRECT |
static String |
PROCESS_NAME_REGEX |
| Constructor and Description |
|---|
Instance(Instance instance,
AppConfig appConfig)
Constructor, instantiates Instance based of a previous instance and appConfig.
|
Instance(Map<String,Object> instanceMap,
Map<String,Object> initConfig,
String checkName,
AppConfig appConfig,
ServiceNameProvider serviceNameProvider)
Default constructor, builds an Instance from the provided instance map and init configs.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
Clean up config and close connection.
|
void |
cleanUpAsync()
Asynchronoush cleanup of instance, including connection.
|
List<String> |
getBeansScopes()
Returns a list of strings listing the bean scopes.
|
boolean |
getCanonicalRateConfig()
Returns a boolean describing if the canonical rate config is enabled.
|
String |
getCheckName()
Returns the check name.
|
Connection |
getConnection(Map<String,Object> connectionParams,
boolean forceNewConnection)
Returns the instance connection, creates one if not already connected.
|
int |
getMaxNumberOfMetrics()
Returns the maximum number of metrics an instance may collect.
|
List<Metric> |
getMetrics()
Returns a map of metrics collected.
|
String |
getName()
Returns the instance name.
|
String |
getServiceCheckPrefix()
Returns the check prefix.
|
String[] |
getServiceCheckTags()
Returns a string array listing the service check tags.
|
void |
init(boolean forceNewConnection)
Initializes the instance.
|
static boolean |
isDirectInstance(Map<String,Object> configInstance) |
boolean |
isLimitReached()
Returns whether or not the instance has reached the maximum bean collection limit.
|
boolean |
isPeriodDue(long refTime,
Integer refPeriod)
Returns whather or not the given period has elapsed since reference time.
|
boolean |
timeToCollect()
Returns whather or not its time to collect metrics for the instance.
|
String |
toString()
Returns a string representation for the instance.
|
public static final String PROCESS_NAME_REGEX
public static final String JVM_DIRECT
public static final String ATTRIBUTE
public Instance(Instance instance, AppConfig appConfig)
public boolean getCanonicalRateConfig()
public Connection getConnection(Map<String,Object> connectionParams, boolean forceNewConnection) throws IOException
IOExceptionpublic void init(boolean forceNewConnection)
throws IOException,
FailedLoginException,
SecurityException
public String toString()
public List<Metric> getMetrics() throws IOException
IOExceptionpublic boolean isPeriodDue(long refTime,
Integer refPeriod)
public boolean timeToCollect()
public List<String> getBeansScopes()
public String[] getServiceCheckTags()
public String getName()
public String getCheckName()
public String getServiceCheckPrefix()
public int getMaxNumberOfMetrics()
public boolean isLimitReached()
public void cleanUp()
public void cleanUpAsync()
Copyright © 2022. All rights reserved.