use of com.creditease.uav.profiling.spi.ProfileHandler in project uavstack by uavorg.
the class StandardProfile method doProfiling.
@Override
public void doProfiling(ProfileContext context) {
ProfileElement[] pes = repository.getElements();
int state = 1;
repository.setState(state);
Set<String> IncludePes = context.getPE();
for (ProfileElement pe : pes) {
if (IncludePes.size() > 0 && (!IncludePes.contains(pe.getElemId()))) {
continue;
}
String hClass = pe.getElemHandlerClass();
if (null == hClass) {
continue;
}
/**
* select profiling handler to process
*/
ProfileHandler handler = selectHandler(hClass);
try {
handler.doProfiling(pe, context);
} catch (Exception e) {
this.logger.error("ProfileHandler[" + hClass + "] do profile FAILs ", e);
state = 3;
}
}
if (state == 1) {
state = 2;
}
repository.setState(state);
}
Aggregations