Skip to content

Commit

Permalink
Temporary workaround for MID-2866.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed May 24, 2016
1 parent 5b1100a commit f6ac941
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Expand Up @@ -460,9 +460,6 @@ public synchronized void recordNotificationOperation(String transportName, boole

public synchronized void recordMappingOperation(String objectOid, String objectName, String mappingName, long duration) {
// ignoring mapping name for now
if (objectName == null) {
System.out.println("Null objectName");
}
MappingsStatisticsKey key = new MappingsStatisticsKey(objectOid, objectName);
GenericStatisticsData data = mappingsData.get(key);
if (data == null) {
Expand Down
Expand Up @@ -79,8 +79,18 @@ public <V extends PrismValue, D extends ItemDefinition, F extends ObjectType> vo
ModelExpressionThreadLocalHolder.pushLensContext(lensContext);
ModelExpressionThreadLocalHolder.pushCurrentResult(parentResult);
ModelExpressionThreadLocalHolder.pushCurrentTask(task);
String objectOid = mapping.getOriginObject() != null ? mapping.getOriginObject().getOid() : null;
String objectName = mapping.getOriginObject() != null ? String.valueOf(mapping.getOriginObject().getName()) : null;
ObjectType originObject = mapping.getOriginObject();
String objectOid, objectName;
if (originObject instanceof FocusType) {
// MID-2866 - TEMPORARY WORKAROUND: it seems that originObject is sometimes a FocusType ... we have to aggregate such objects by type, as it yields huge statistics
objectOid = null;
objectName = originObject.getClass().getSimpleName();
} else if (originObject != null) {
objectOid = originObject.getOid();
objectName = String.valueOf(originObject.getName());
} else {
objectOid = objectName = null;
}
String mappingName = mapping.getItemName() != null ? mapping.getItemName().getLocalPart() : null;
long start = System.currentTimeMillis();
try {
Expand Down

0 comments on commit f6ac941

Please sign in to comment.