code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
public static Serializer getINSTANCE() { return INSTANCE; }
Deserialize nested collection @param json json string @param collectionType type name eg: java.util.HashSet-java.util.HashSet,java.lang.String,java.lang.String @param serializer serializer
getINSTANCE
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
Apache-2.0
public Map<String, StringSerializable> getSerializers() { return serializers; }
Deserialize nested collection @param json json string @param collectionType type name eg: java.util.HashSet-java.util.HashSet,java.lang.String,java.lang.String @param serializer serializer
getSerializers
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
Apache-2.0
public StringSerializable getSerializer() { return defaultSerializer; }
Deserialize nested collection @param json json string @param collectionType type name eg: java.util.HashSet-java.util.HashSet,java.lang.String,java.lang.String @param serializer serializer
getSerializer
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
Apache-2.0
public StringSerializable getSerializer(String name) { if (name == null) { return defaultSerializer; } return serializers.get(name); }
Deserialize nested collection @param json json string @param collectionType type name eg: java.util.HashSet-java.util.HashSet,java.lang.String,java.lang.String @param serializer serializer
getSerializer
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
Apache-2.0
public Builder addSerializer(String name, StringSerializable serializable) { serializers.put(name, serializable); return this; }
Deserialize nested collection @param json json string @param collectionType type name eg: java.util.HashSet-java.util.HashSet,java.lang.String,java.lang.String @param serializer serializer
addSerializer
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
Apache-2.0
public void build() { if (defaultSerializer == null) { LOGGER.error("Default serializer is not set"); return; } Serializer.INSTANCE = new Serializer(defaultSerializer, Collections.unmodifiableMap(serializers)); }
Deserialize nested collection @param json json string @param collectionType type name eg: java.util.HashSet-java.util.HashSet,java.lang.String,java.lang.String @param serializer serializer
build
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java
Apache-2.0
default boolean isDefault() { return false; }
regenerate the serializer object and reload the serialization configuration @return StringSerializable example: jacksonSerializer/GsonSerializer
isDefault
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/StringSerializable.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/StringSerializable.java
Apache-2.0
default void addMapSerializer(Class<?> clazz) { addTypeSerializer(clazz, null); }
Method for adding serializer to handle values of Map type.
addMapSerializer
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/StringSerializable.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/StringSerializable.java
Apache-2.0
public static String regenerateOperationName(String dbName, String operationName, String sqlText) { if (disableSqlParse() || StringUtil.isEmpty(sqlText) || operationName.contains(DELIMITER)) { return operationName; } String[] sqlArray = StringUtil.split(sqlText, ';'); List<S...
format: dbName@tableNames@action@operationName eg: db1@table1,table2@select@operation1;db2@table3,table4@select@operation2;
regenerateOperationName
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/DatabaseUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/DatabaseUtils.java
Apache-2.0
private static String regenerateOperationName(TableSchema tableSchema, String originOperationName) { return new StringBuilder(100).append(StringUtil.defaultString(tableSchema.getDbName())).append(DELIMITER) .append(StringUtil.defaultString(StringUtil.join(tableSchema.getTableNames(), ","))).appe...
format: dbName@tableNames@action@operationName eg: db1@table1,table2@select@operation1;db2@table3,table4@select@operation2;
regenerateOperationName
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/DatabaseUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/DatabaseUtils.java
Apache-2.0
public static boolean disableSqlParse() { return Config.get().getBoolean(ArexConstants.DISABLE_SQL_PARSE, Boolean.getBoolean(ArexConstants.DISABLE_SQL_PARSE)); }
format: dbName@tableNames@action@operationName eg: db1@table1,table2@select@operation1;db2@table3,table4@select@operation2;
disableSqlParse
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/DatabaseUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/DatabaseUtils.java
Apache-2.0
public static boolean ignoreMockResult(String serviceKey, String operationKey) { if (StringUtil.isEmpty(serviceKey)) { return false; } ArexContext context = ContextManager.currentContext(); if (context == null || context.getExcludeMockTemplate() == null) { return ...
operation cache: can not serialize args or response
ignoreMockResult
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
Apache-2.0
public static boolean includeOperation(String targetName) { if (StringUtil.isEmpty(targetName) || Config.get() == null) { return false; } Set<String> includeServiceOperations = Config.get().getIncludeServiceOperations(); return operationMatched(targetName, includeServiceOper...
Include the operation that need to record or replay
includeOperation
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
Apache-2.0
public static boolean excludeOperation(String targetName) { if (StringUtil.isEmpty(targetName) || Config.get() == null) { return false; } Set<String> excludeServiceOperations = Config.get().excludeServiceOperations(); boolean isOperationMatched = operationMatched(targetName, ...
Exclude the operation that not need to record or replay
excludeOperation
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
Apache-2.0
public static boolean excludeEntranceOperation(String targetName) { if (Config.get() != null && CollectionUtil.isNotEmpty(Config.get().getIncludeServiceOperations())) { return !includeOperation(targetName); } return excludeOperation(targetName); }
Exclude entrance operation by includeServiceOperations and excludeServiceOperations. First if includeServiceOperations is not empty, only use excludeServiceOperations to judge. Second if includeServiceOperations is empty, use excludeServiceOperations to jude.
excludeEntranceOperation
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
Apache-2.0
private static boolean operationMatched(String targetName, Set<String> searchOperations) { if (CollectionUtil.isEmpty(searchOperations)) { return false; } for (String searchOperation : searchOperations) { if (searchOperation.equalsIgnoreCase(targetName)) { ...
targetName match searchOperations @param searchOperations: includeServiceOperations or excludeServiceOperations. @return includeServiceOperations: true -> notNeedIgnore, excludeServiceOperations: true -> needIgnore
operationMatched
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
Apache-2.0
public static boolean invalidOperation(String operationSignature) { return INVALID_OPERATION_HASH_CACHE.contains(StringUtil.encodeAndHash(operationSignature)); }
targetName match searchOperations @param searchOperations: includeServiceOperations or excludeServiceOperations. @return includeServiceOperations: true -> notNeedIgnore, excludeServiceOperations: true -> needIgnore
invalidOperation
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/IgnoreUtils.java
Apache-2.0
public static void mergeRecord(Mocker requestMocker) { List<List<Mocker>> mergeList = merge(requestMocker); for (List<Mocker> mergeRecords : mergeList) { MockUtils.executeRecord(mergeRecords); } }
To solve the problem of insufficient consume capacity of downstream DataServices. by controlling the speed at which producers produce mockers. multiple producer -> single consumer
mergeRecord
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/MergeRecordUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/MergeRecordUtil.java
Apache-2.0
public static List<Mocker> queryMockers(QueryAllMockerDTO requestMocker) { String postJson = Serializer.serialize(requestMocker); long startTime = System.currentTimeMillis(); String data = DataService.INSTANCE.queryAll(postJson); String cost = String.valueOf(System.currentTimeMillis() - ...
get all mockers under current one case
queryMockers
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/MockUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/MockUtils.java
Apache-2.0
private static boolean enableMergeRecord() { return !Boolean.getBoolean(ArexConstants.DISABLE_MERGE_RECORD); }
get all mockers under current one case
enableMergeRecord
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/MockUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/MockUtils.java
Apache-2.0
public static void queryMockers() { if (!ContextManager.needReplay()) { return; } try { QueryAllMockerDTO requestMocker = new QueryAllMockerDTO(); requestMocker.setRecordId(ContextManager.currentContext().getCaseId()); requestMocker.setReplayId(Con...
init replay all mocker under case and cached replay result
queryMockers
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
Apache-2.0
private static void filterMergeMocker(List<Mocker> allMockerList) { List<Mocker> splitMockerList = new ArrayList<>(); for (Mocker mergeMocker : allMockerList) { if (!FILTER_MERGE_RECORD.test(mergeMocker)) { continue; } List<MergeDTO> mergeReplayList = ...
compatible with merge record, after batchSave published can be removed
filterMergeMocker
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
Apache-2.0
private static List<Mocker> convertMergeMocker(List<MergeDTO> mergeReplayList) { List<Mocker> convertMockerList = new ArrayList<>(); for (MergeDTO mergeDTO : mergeReplayList) { if (mergeDTO == null || FILTER_MERGE_TYPE.test(mergeDTO)) { continue; } Are...
compatible with merge record, after batchSave published can be removed
convertMergeMocker
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
Apache-2.0
private static void buildReplayResultMap(List<Mocker> replayMockers, Map<Integer, List<Mocker>> cachedReplayResultMap) { for (Mocker replayMocker : replayMockers) { if (replayMocker == null) { continue; } // replay match need methodRequestTypeHash and methodSi...
compatible with merge record, after batchSave published can be removed
buildReplayResultMap
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
Apache-2.0
private static void ascendingSortByCreationTime(Map<Integer, List<Mocker>> cachedReplayResultMap) { for (List<Mocker> mergeReplayList : cachedReplayResultMap.values()) { if (mergeReplayList.size() == 1) { continue; } mergeReplayList.sort((o1, o2) -> { ...
compatible with merge record, after batchSave published can be removed
ascendingSortByCreationTime
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/ReplayUtil.java
Apache-2.0
public static Type forName(String typeName) { if (StringUtil.isEmpty(typeName) || HORIZONTAL_LINE_STR.equals(typeName)) { return null; } Type type = TYPE_NAME_CACHE.get(typeName); if (type != null) { return type; } String[] types = StringUtil.spl...
Suppresses default constructor, ensuring non-instantiability.
forName
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static boolean needUseDefaultCollection(Class<?> raw, String type, int typeParametersLength) { if (typeParametersLength != 0 || !Collection.class.isAssignableFrom(raw)) { return false; } Class<?> tempClass = raw; while (Object.class != tempClass) { Type g...
If the parent class explicitly specifies generics, the serialization framework will process it and not need use default collection. eg: class WrappedList extends WrappedCollection implements List<V> return true eg: class exampleCollection extends ArrayList<String> return false
needUseDefaultCollection
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static Type forNameWithOneGenericType(Class<?> rawClass, String genericType, String typeName) { final Type[] args = new Type[]{forName(genericType)}; final ParameterizedTypeImpl parameterizedType = ParameterizedTypeImpl.make(rawClass, args, null); TYPE_NAME_CACHE.put(typeName, parameteri...
If the parent class explicitly specifies generics, the serialization framework will process it and not need use default collection. eg: class WrappedList extends WrappedCollection implements List<V> return true eg: class exampleCollection extends ArrayList<String> return false
forNameWithOneGenericType
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static String getName(Object result) { if (result == null) { return null; } if (result instanceof Map) { return mapToString((Map<?, ?>) result); } // Optional GSON if (result instanceof Optional) { return optionalToString((Opti...
If the parent class explicitly specifies generics, the serialization framework will process it and not need use default collection. eg: class WrappedList extends WrappedCollection implements List<V> return true eg: class exampleCollection extends ArrayList<String> return false
getName
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static String genericTypeToString(Object result) { final Class<?> rawClass = result.getClass(); StringBuilder builder = new StringBuilder(); String rawClassName = rawClass.getName(); builder.append(rawClassName).append(HORIZONTAL_LINE); final Type[] typeParameters = rawCl...
If the parent class explicitly specifies generics, the serialization framework will process it and not need use default collection. eg: class WrappedList extends WrappedCollection implements List<V> return true eg: class exampleCollection extends ArrayList<String> return false
genericTypeToString
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static Field getGenericFieldFromClass(Class<?> rawClass, String typeName) { if (rawClass == null) { return null; } for (Field declaredField : rawClass.getDeclaredFields()) { final String fieldGenericType = declaredField.getGenericType().getTypeName(); ...
If the parent class explicitly specifies generics, the serialization framework will process it and not need use default collection. eg: class WrappedList extends WrappedCollection implements List<V> return true eg: class exampleCollection extends ArrayList<String> return false
getGenericFieldFromClass
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static String invokeGetFieldType(Field field, Object result) { if (field == null || result == null) { return null; } try { final Object genericField = field.get(result); return getName(genericField); } catch (Throwable ex) { LogMana...
If the parent class explicitly specifies generics, the serialization framework will process it and not need use default collection. eg: class WrappedList extends WrappedCollection implements List<V> return true eg: class exampleCollection extends ArrayList<String> return false
invokeGetFieldType
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static boolean isGenericType(Object result) { return result.getClass().getTypeParameters().length != 0; }
If the parent class explicitly specifies generics, the serialization framework will process it and not need use default collection. eg: class WrappedList extends WrappedCollection implements List<V> return true eg: class exampleCollection extends ArrayList<String> return false
isGenericType
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static String collectionToString(Collection<?> result) { StringBuilder builder = new StringBuilder(); builder.append(result.getClass().getName()); if (result.isEmpty()) { return builder.toString(); } builder.append(HORIZONTAL_LINE); List<String> lin...
Converts a collection to a string representation. <p> eg: {@code List<String>} to java.util.ArrayList-java.lang.String <p> {@code List<List<String>>} to java.util.ArrayList-java.util.ArrayList,java.lang.String,java.lang.Integer
collectionToString
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static String optionalToString(Optional<?> result) { StringBuilder builder = new StringBuilder(); builder.append(Optional.class.getName()); result.ifPresent(o -> builder.append(HORIZONTAL_LINE).append(getName(o))); return builder.toString(); }
Converts a collection to a string representation. <p> eg: {@code List<String>} to java.util.ArrayList-java.lang.String <p> {@code List<List<String>>} to java.util.ArrayList-java.util.ArrayList,java.lang.String,java.lang.Integer
optionalToString
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static String mapToString(Map<?, ?> result) { if (result.isEmpty()) { return result.getClass().getName(); } String resultClassName = result.getClass().getName(); final TypeVariable<?>[] typeParameters = result.getClass().getTypeParameters(); if (ArrayUtils.is...
Converts a collection to a string representation. <p> eg: {@code List<String>} to java.util.ArrayList-java.lang.String <p> {@code List<List<String>>} to java.util.ArrayList-java.util.ArrayList,java.lang.String,java.lang.Integer
mapToString
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static boolean isEmpty(Object value) { if (value == null) { return true; } if (value instanceof Collection<?>) { return ((Collection<?>) value).isEmpty(); } if (value instanceof Map<?, ?>) { return ((Map<?, ?>) value).isEmpty(); ...
Converts a collection to a string representation. <p> eg: {@code List<String>} to java.util.ArrayList-java.lang.String <p> {@code List<List<String>>} to java.util.ArrayList-java.util.ArrayList,java.lang.String,java.lang.Integer
isEmpty
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static Class<?> classForName(String type) { try { if (Thread.currentThread().getContextClassLoader() == null) { return Class.forName(type); } return Class.forName(type, false, Thread.currentThread().getContextClassLoader()); } catch (Throwable ...
Converts a collection to a string representation. <p> eg: {@code List<String>} to java.util.ArrayList-java.lang.String <p> {@code List<List<String>>} to java.util.ArrayList-java.util.ArrayList,java.lang.String,java.lang.Integer
classForName
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static String parameterizedTypeToString(ParameterizedType type) { StringBuilder builder = new StringBuilder(); if (type.getRawType() != null) { builder.append(type.getRawType().getTypeName()); } if (ArrayUtils.isNotEmpty(type.getActualTypeArguments()) && type.getActua...
Currently only support {@code A<B.class>} type
parameterizedTypeToString
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static String errorSerializeToString(Object object) { if (object instanceof Object[]) { return ArrayUtils.toString((Object[]) object, o -> o.getClass().getTypeName()); } return getName(object); }
Currently only support {@code A<B.class>} type
errorSerializeToString
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
private static String filterRawGenericType(String genericType) { if (StringUtil.isEmpty(genericType)) { // does not return null, otherwise com.xxx.Response-null will deserialize throw ClassNotFoundException: null // this case means that the generic field is not assigned a value ...
filter out effective raw generic in collection: A<List<T>> -> A<T> class A<T> { List<T> t; } otherwise deserialize will fail such as: com.xxx.Response-java.util.ArrayList-java.lang.String return com.xxx.Response-java.lang.String
filterRawGenericType
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static boolean isCollection(String genericType) { if (StringUtil.isEmpty(genericType)) { return false; } switch (genericType) { case "java.util.List": case "java.util.Set": case "java.util.ArrayList": case "java.util.LinkedList":...
filter out effective raw generic in collection: A<List<T>> -> A<T> class A<T> { List<T> t; } otherwise deserialize will fail such as: com.xxx.Response-java.util.ArrayList-java.lang.String return com.xxx.Response-java.lang.String
isCollection
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static Collection<Collection<?>> toNestedCollection(Object object) { Collection<Collection<?>> collection = null; if (object instanceof Collection<?>) { collection = (Collection<Collection<?>>) object; } if (CollectionUtil.isEmpty(collection)) { return nul...
filter out effective raw generic in collection: A<List<T>> -> A<T> class A<T> { List<T> t; } otherwise deserialize will fail such as: com.xxx.Response-java.util.ArrayList-java.lang.String return com.xxx.Response-java.lang.String
toNestedCollection
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static boolean isProtobufClass(Class<?> clazz) { if (clazz == null || clazz.isInterface()) { return false; } final Class<?> superclass = clazz.getSuperclass(); if (superclass == null) { return false; } return StringUtil.startWith(superclass....
filter out effective raw generic in collection: A<List<T>> -> A<T> class A<T> { List<T> t; } otherwise deserialize will fail such as: com.xxx.Response-java.util.ArrayList-java.lang.String return com.xxx.Response-java.lang.String
isProtobufClass
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static boolean isJodaLocalDateTime(String typeName) { return JODA_LOCAL_DATE_TIME.equals(typeName); }
filter out effective raw generic in collection: A<List<T>> -> A<T> class A<T> { List<T> t; } otherwise deserialize will fail such as: com.xxx.Response-java.util.ArrayList-java.lang.String return com.xxx.Response-java.lang.String
isJodaLocalDateTime
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static boolean isJodaLocalDate(String typeName) { return JODA_LOCAL_DATE.equals(typeName); }
filter out effective raw generic in collection: A<List<T>> -> A<T> class A<T> { List<T> t; } otherwise deserialize will fail such as: com.xxx.Response-java.util.ArrayList-java.lang.String return com.xxx.Response-java.lang.String
isJodaLocalDate
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static boolean isJodaLocalTime(String typeName) { return JODA_LOCAL_TIME.equals(typeName); }
filter out effective raw generic in collection: A<List<T>> -> A<T> class A<T> { List<T> t; } otherwise deserialize will fail such as: com.xxx.Response-java.util.ArrayList-java.lang.String return com.xxx.Response-java.lang.String
isJodaLocalTime
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static boolean isJodaDateTime(String typeName) { return JODA_DATE_TIME.equals(typeName); }
filter out effective raw generic in collection: A<List<T>> -> A<T> class A<T> { List<T> t; } otherwise deserialize will fail such as: com.xxx.Response-java.util.ArrayList-java.lang.String return com.xxx.Response-java.lang.String
isJodaDateTime
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static boolean isJoinPoint(String typeName) { return METHOD_INVOCATION_PROCEEDING_JOIN_POINT.equals(typeName); }
filter out effective raw generic in collection: A<List<T>> -> A<T> class A<T> { List<T> t; } otherwise deserialize will fail such as: com.xxx.Response-java.util.ArrayList-java.lang.String return com.xxx.Response-java.lang.String
isJoinPoint
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/TypeUtil.java
Apache-2.0
public static <R> MethodHolder<R> build(Executable executable) { try { final MethodHandle methodHandle = getMethodHandle(executable); if (methodHandle == null) { return new MethodHolder<>(); } final LambdaMetadata metadata; if (!Modifi...
suggest cache instance after build, this method generate Anonymous Inner Class with lambda
build
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/fastreflect/MethodHolder.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/fastreflect/MethodHolder.java
Apache-2.0
public R invoke(Object... args) { if (metadata == null) { return null; } if (!Modifier.isPublic(executable.getModifiers())) { return invokePrivate(args); } try { LambdaWrapper func = (LambdaWrapper) callSite.getTarget().invoke(); r...
suggest cache instance after build, this method generate Anonymous Inner Class with lambda
invoke
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/fastreflect/MethodHolder.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/fastreflect/MethodHolder.java
Apache-2.0
public R invokePrivate(Object... args) { if (metadata == null) { return null; } try { return (R) metadata.getMatcher().apply(methodHandle, args); } catch (Throwable e) { return null; } }
suggest cache instance after build, this method generate Anonymous Inner Class with lambda
invokePrivate
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/fastreflect/MethodHolder.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/fastreflect/MethodHolder.java
Apache-2.0
public static MethodHandle getMethodHandle(Executable executable) throws IllegalAccessException { if (executable == null) { return null; } if (!Modifier.isPublic(executable.getModifiers())) { executable.setAccessible(true); } final MethodHandle methodHandl...
suggest cache instance after build, this method generate Anonymous Inner Class with lambda
getMethodHandle
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/fastreflect/MethodHolder.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/fastreflect/MethodHolder.java
Apache-2.0
public long deepSizeOf(long sizeThreshold, Object... obj) { return walker.walk(null, sizeThreshold, obj); }
Measures the size in memory (heap) of the objects passed in, walking their graph down Any overlap of the graphs being passed in will be recognized and only measured once @return the total size in bytes for these objects
deepSizeOf
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
Apache-2.0
public static AgentSizeOf newInstance(final SizeOfFilter... filters) { final SizeOfFilter filter = new CombinationSizeOfFilter(filters); return new AgentSizeOf(filter); }
Measures the size in memory (heap) of the objects passed in, walking their graph down Any overlap of the graphs being passed in will be recognized and only measured once @return the total size in bytes for these objects
newInstance
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
Apache-2.0
public long visit(Object object) { return sizeOf(object); }
Will return the sizeOf each instance
visit
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
Apache-2.0
public long sizeOf(Object obj) { if (instrumentation == null) { return 0; } return instrumentation.getObjectSize(obj); }
Will return the sizeOf each instance
sizeOf
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
Apache-2.0
public static String humanReadableUnits(long bytes) { return humanReadableUnits(bytes, new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.ROOT))); }
Returns <code>size</code> in human-readable units (GB, MB, KB or bytes).
humanReadableUnits
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
Apache-2.0
public static String humanReadableUnits(long bytes, DecimalFormat df) { if (bytes / ONE_GB > 0) { return df.format((float) bytes / ONE_GB) + " GB"; } else if (bytes / ONE_MB > 0) { return df.format((float) bytes / ONE_MB) + " MB"; } else if (bytes / ONE_KB > 0) { ...
Returns <code>size</code> in human-readable units (GB, MB, KB or bytes).
humanReadableUnits
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/AgentSizeOf.java
Apache-2.0
long walk(VisitorListener visitorListener, long sizeThreshold, Object... root) { long result = 0; Deque<Object> toVisit = new ArrayDeque<>(); Set<Object> visited = newSetFromMap(new IdentityHashMap<>()); nullSafeAddArray(toVisit, root); while (!toVisit.isEmpty()) { ...
Walk the graph and call into the "visitor" @param visitorListener A decorator for the Visitor @param sizeThreshold if > 0 and exceed sizeThreshold will stop walk @param root the roots of the objects (a shared graph will only be visited once) @return the sum of all Visitor#visit ...
walk
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
Apache-2.0
private void walkField(Object ref, Deque<Object> toVisit) { Class<?> refClass = ref.getClass(); if (refClass.isArray() && !refClass.getComponentType().isPrimitive()) { for (int i = 0; i < Array.getLength(ref); i++) { nullSafeAdd(toVisit, Array.get(ref, i)); } ...
Walk the graph and call into the "visitor" @param visitorListener A decorator for the Visitor @param sizeThreshold if > 0 and exceed sizeThreshold will stop walk @param root the roots of the objects (a shared graph will only be visited once) @return the sum of all Visitor#visit ...
walkField
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
Apache-2.0
private Collection<Field> getFilteredFields(Class<?> refClass) { SoftReference<Collection<Field>> ref = fieldCache.get(refClass); Collection<Field> fieldList = ref != null ? ref.get() : null; if (fieldList != null) { return fieldList; } else { Collection<Field> re...
Returns the filtered fields for a particular type @param refClass the type @return A collection of fields to be visited
getFilteredFields
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
Apache-2.0
private boolean shouldWalkClass(Class<?> refClass) { Boolean cached = classCache.get(refClass); if (cached == null) { cached = sizeOfFilter.filterClass(refClass); classCache.put(refClass, cached); } return cached; }
Returns the filtered fields for a particular type @param refClass the type @return A collection of fields to be visited
shouldWalkClass
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
Apache-2.0
private static void nullSafeAddArray(final Deque<Object> toVisit, final Object... root) { if (root != null) { for (Object object : root) { nullSafeAdd(toVisit, object); } } }
Returns the filtered fields for a particular type @param refClass the type @return A collection of fields to be visited
nullSafeAddArray
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
Apache-2.0
private static void nullSafeAdd(final Deque<Object> toVisit, final Object o) { if (o != null) { toVisit.push(o); } }
Returns the filtered fields for a particular type @param refClass the type @return A collection of fields to be visited
nullSafeAdd
java
arextest/arex-agent-java
arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/util/sizeof/ObjectGraphWalker.java
Apache-2.0
public void setDynamicClassList(List<DynamicClassConfiguration> newDynamicConfigList) { if (newDynamicConfigList == null) { return; } List<DynamicClassEntity> newDynamicClassList = new ArrayList<>(newDynamicConfigList.size()); // keyFormula: java.lang.System.currentTimeMillis...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setDynamicClassList
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private Set<String> getDiffClassSet(List<DynamicClassEntity> dynamicClassList, List<DynamicClassEntity> newDynamicClassList) { Set<String> changedClassSet = new HashSet<>(); // if old dynamic class list is empty, add all new dynamic class list if (CollectionUtil.isEmpty(dynamicClassList)) { ...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
getDiffClassSet
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private void setRetransformClassCollection(Set<String> resetClassSet, List<DynamicClassEntity> newDynamicClassList) { this.resetClassSet = resetClassSet; this.dynamicClassList = newDynamicClassList; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setRetransformClassCollection
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private DynamicClassEntity createDynamicClass(DynamicClassConfiguration config, String keyFormula) { DynamicClassEntity newItem = new DynamicClassEntity(config.getFullClassName(), config.getMethodName(), config.getParameterTypes(), keyFormula); newItem.setStatus(DynamicClassStatusEnum.UN...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
createDynamicClass
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
@VisibleForTesting void init() { agentVersion = System.getProperty(AGENT_VERSION); setEnableDebug(System.getProperty(ENABLE_DEBUG)); setServiceName(StringUtil.strip(System.getProperty(SERVICE_NAME))); setStorageServiceHost(StringUtil.strip(System.getProperty(STORAGE_SERVICE_HOST))); ...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
init
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
@VisibleForTesting void readConfigFromFile(String configPath) { if (StringUtil.isEmpty(configPath)) { return; } Map<String, String> configMap = parseConfigFile(configPath); if (configMap.isEmpty()) { return; } setEnableDebug(configMap.get(ENA...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
readConfigFromFile
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private static Map<String, String> parseConfigFile(String configPath) { Map<String, String> configMap = new HashMap<>(); try (Stream<String> configStream = Files.lines(Paths.get(configPath))) { configStream.forEach(item -> { int separatorIndex = item.indexOf('='); ...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
parseConfigFile
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void parseAgentConfig(String args) { Map<String, String> agentMap = StringUtil.asMap(args); if (agentMap.isEmpty()) { return; } for (Map.Entry<String, String> entry : agentMap.entrySet()) { String key = entry.getKey(); String value = entry.getVa...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
parseAgentConfig
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void updateConfigFromService(ResponseBody serviceConfig) { ServiceCollectConfig config = serviceConfig.getServiceCollectConfiguration(); setRecordRate(config.getSampleRate()); setAllowDayOfWeeks(config.getAllowDayOfWeeks()); setAllowTimeOfDayFrom(config.getAllowTimeOfDayFrom()); ...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
updateConfigFromService
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private void updateRuntimeConfig() { Map<String, String> configMap = new HashMap<>(); configMap.put(DYNAMIC_RESULT_SIZE_LIMIT, String.valueOf(getDynamicResultSizeLimit())); configMap.put(DISABLE_REPLAY, System.getProperty(DISABLE_REPLAY)); configMap.put(DISABLE_RECORD, System.getProperty...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
updateRuntimeConfig
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private void appendCoveragePackages(String collectCoveragePackages) { if (StringUtil.isEmpty(collectCoveragePackages)) { return; } System.setProperty(COVERAGE_PACKAGES, collectCoveragePackages); }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
appendCoveragePackages
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private void publish(Config config) { for (ConfigListener listener : listeners) { listener.load(config); } }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
publish
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setConfigInvalid() { setRecordRate(0); setAllowDayOfWeeks(0); updateRuntimeConfig(); }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setConfigInvalid
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public boolean isLocalStorage() { return STORAGE_MODE.equalsIgnoreCase(storageServiceMode); }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
isLocalStorage
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setStorageServiceMode(String storageServiceMode) { if (StringUtil.isEmpty(storageServiceMode)) { return; } this.storageServiceMode = storageServiceMode; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setStorageServiceMode
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public int getDynamicResultSizeLimit() { return dynamicResultSizeLimit; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
getDynamicResultSizeLimit
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setDynamicResultSizeLimit(String dynamicResultSizeLimit) { if (StringUtil.isEmpty(dynamicResultSizeLimit)) { return; } this.dynamicResultSizeLimit = Integer.parseInt(dynamicResultSizeLimit); System.setProperty(DYNAMIC_RESULT_SIZE_LIMIT, dynamicResultSizeLimit); ...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setDynamicResultSizeLimit
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public EnumSet<DayOfWeek> getAllowDayOfWeeks() { return allowDayOfWeeks; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
getAllowDayOfWeeks
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setAllowDayOfWeeks(int allowDayOfWeeks) { if (allowDayOfWeeks <= 0) { this.allowDayOfWeeks = EnumSet.noneOf(DayOfWeek.class); return; } // binary 1111111 if (allowDayOfWeeks == 127) { this.allowDayOfWeeks = EnumSet.allOf(DayOfWeek.class); ...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setAllowDayOfWeeks
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public LocalTime getAllowTimeOfDayFrom() { return allowTimeOfDayFrom; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
getAllowTimeOfDayFrom
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setAllowTimeOfDayFrom(String allowTimeOfDayFrom) { if (StringUtil.isEmpty(allowTimeOfDayFrom)) { return; } this.allowTimeOfDayFrom = LocalTime.parse(allowTimeOfDayFrom, DateTimeFormatter.ofPattern("HH:mm")); System.setProperty(ALLOW_TIME_FROM, allowTim...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setAllowTimeOfDayFrom
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public LocalTime getAllowTimeOfDayTo() { return allowTimeOfDayTo; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
getAllowTimeOfDayTo
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setAllowTimeOfDayTo(String allowTimeOfDayTo) { if (StringUtil.isEmpty(allowTimeOfDayTo)) { return; } this.allowTimeOfDayTo = LocalTime.parse(allowTimeOfDayTo, DateTimeFormatter.ofPattern("HH:mm")); System.setProperty(ALLOW_TIME_TO, allowTimeOfDayTo); ...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setAllowTimeOfDayTo
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public boolean inWorkingTime() { return nextWorkTime() <= 0L; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
inWorkingTime
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private long nextWorkTime() { LocalDateTime dateTime = LocalDateTime.now(); LocalTime beginTime = dateTime.toLocalTime(); int diffDays = 0; if (beginTime.isAfter(allowTimeOfDayFrom) && beginTime.isAfter(allowTimeOfDayTo)) { diffDays++; dateTime = dateTime.plusDays...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
nextWorkTime
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public List<String> getIgnoreTypePrefixes() { return ignoreTypePrefixes; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
getIgnoreTypePrefixes
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private void setIgnoreTypePrefixes(String ignoredTypes) { if (StringUtil.isEmpty(ignoredTypes)) { this.ignoreTypePrefixes = Collections.emptyList(); } else { this.ignoreTypePrefixes = Arrays.asList(StringUtil.split(ignoredTypes, ',')); } }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setIgnoreTypePrefixes
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public List<String> getIgnoreClassLoaderPrefixes() { return ignoreClassLoaderPrefixes; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
getIgnoreClassLoaderPrefixes
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
private void setIgnoreClassLoaderPrefixes(String ignoreClassLoaderPrefixes) { if (StringUtil.isEmpty(ignoreClassLoaderPrefixes)) { this.ignoreClassLoaderPrefixes = Collections.emptyList(); } else { this.ignoreClassLoaderPrefixes = Arrays.asList(StringUtil.split(ignoreClassLoaderP...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setIgnoreClassLoaderPrefixes
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public List<String> getDisabledModules() { return disabledModules; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
getDisabledModules
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setDisabledModules(String disabledModules) { if (StringUtil.isEmpty(disabledModules)) { if (this.disabledModules == null) { this.disabledModules = Collections.emptyList(); } return; } this.disabledModules = Arrays.asList(StringUtil...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setDisabledModules
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public List<String> getRetransformModules() { return retransformModules; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
getRetransformModules
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setRetransformModules(String retransformModules) { if (StringUtil.isEmpty(retransformModules)) { if (this.retransformModules == null) { this.retransformModules = Collections.emptyList(); } return; } this.retransformModules = Arrays...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setRetransformModules
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setExcludeServiceOperations(String excludeServiceOperations) { if (StringUtil.isEmpty(excludeServiceOperations)) { if (this.excludeServiceOperations == null) { this.excludeServiceOperations = Collections.emptySet(); } return; } thi...
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setExcludeServiceOperations
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0
public void setExcludeServiceOperations(Set<String> excludeServiceOperationSet) { if (CollectionUtil.isEmpty(excludeServiceOperationSet)) { this.excludeServiceOperations = Collections.emptySet(); return; } this.excludeServiceOperations = excludeServiceOperationSet; }
DynamicClass retransform rules: 1. addEntity: all entity of the same class of the added entity class need to be set to retransform 2. resetEntity: resetEntityClassSet only contains the class not in newDynamicClassList ex: oldDynamicClassList: ClassA methodA, ClassB methodB, ClassC methodC newDynamicClassList: Class...
setExcludeServiceOperations
java
arextest/arex-agent-java
arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-foundation/src/main/java/io/arex/foundation/config/ConfigManager.java
Apache-2.0