Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Sep 29, 2016
2 parents 12e5612 + 97375e4 commit 35ef89f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2015 Evolveum
* Copyright (c) 2014-2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -160,7 +160,7 @@ SearchResultList<C> applySchemasAndSecurityToContainers(SearchResultList<C> orig
}

protected <T extends ObjectType> void applySchemaAndSecurityToObject(PrismObject<T> object, GetOperationOptions options, AuthorizationPhaseType phase, Task task) {
OperationResult subresult = new OperationResult(ModelController.class.getName()+".applySchemasAndSecurityToObjects");
OperationResult subresult = new OperationResult(SchemaTransformer.class.getName()+".applySchemasAndSecurityToObjects");
try {
applySchemasAndSecurity(object, options, phase, task, subresult);
} catch (IllegalArgumentException|IllegalStateException|SchemaException |SecurityViolationException |ConfigurationException |ObjectNotFoundException e) {
Expand All @@ -184,7 +184,7 @@ protected <T extends ObjectType> void applySchemaAndSecurityToObject(PrismObject
public <O extends ObjectType> void applySchemasAndSecurity(PrismObject<O> object, GetOperationOptions rootOptions,
AuthorizationPhaseType phase, Task task, OperationResult parentResult)
throws SchemaException, SecurityViolationException, ConfigurationException, ObjectNotFoundException {
OperationResult result = parentResult.createMinorSubresult(ModelController.class.getName()+".applySchemasAndSecurity");
OperationResult result = parentResult.createMinorSubresult(SchemaTransformer.class.getName()+".applySchemasAndSecurity");
validateObject(object, rootOptions, result);

PrismObjectDefinition<O> objectDefinition = object.deepCloneDefinition(true);
Expand Down Expand Up @@ -434,7 +434,7 @@ public <O extends ObjectType> void applyObjectTemplateToDefinition(PrismObjectDe
if (itemDef != null) {
applyObjectTemplateItem(itemDef, templateItemDefType, "item " + itemPath + " in object type " + objectDefinition.getTypeName() + " as specified in item definition in " + objectTemplateType);
} else {
OperationResult subResult = result.createMinorSubresult(ModelController.class.getName() + ".applyObjectTemplateToDefinition");
OperationResult subResult = result.createMinorSubresult(SchemaTransformer.class.getName() + ".applyObjectTemplateToDefinition");
subResult.recordPartialError("No definition for item " + itemPath + " in object type " + objectDefinition.getTypeName() + " as specified in item definition in " + objectTemplateType);
continue;
}
Expand All @@ -460,7 +460,7 @@ private <O extends ObjectType> void applyObjectTemplateToObject(PrismObject<O> o
applyObjectTemplateItem(itemDefFromObject, templateItemDefType, "item " + itemPath + " in " + object
+ " as specified in item definition in " + objectTemplateType);
} else {
OperationResult subResult = result.createMinorSubresult(ModelController.class.getName() + ".applyObjectTemplateToObject");
OperationResult subResult = result.createMinorSubresult(SchemaTransformer.class.getName() + ".applyObjectTemplateToObject");
subResult.recordPartialError("No definition for item " + itemPath + " in " + object
+ " as specified in item definition in " + objectTemplateType);
continue;
Expand Down
Expand Up @@ -442,8 +442,8 @@ public void test022ResourceOpenDjRefinedSchema() throws Exception {
display("Times", "getObject(RESOURCE_OPENDJ_OID): "+(t1-t0)+"ms\ngetResourceSchema: "+(t3-t2)
+"ms\ngetRefinedSchema: "+(t4-t3)+"ms");

// variable number of clones: 1 or 2 because of trigger scanner task
assertPrismObjectCloneIncrement(1,2);
// variable number of clones: 2 or 3 because of trigger scanner task
assertPrismObjectCloneIncrement(2,3);

assertResourceSchemaFetchIncrement(0);
assertResourceSchemaParseCountIncrement(0);
Expand Down
25 changes: 22 additions & 3 deletions tools/etimes.pl
Expand Up @@ -39,6 +39,14 @@ sub parse {
my $halfline = $';
processHalfline($halfline,\%logdata);
}
if ($line =~ /^(\S+)\s+(\S+)\s+(\w+):/) {
my %logdata = ();
$logdata{date} = $1;
$logdata{time} = $2;
$logdata{level} = $3;
my $halfline = $';
processHalfline($halfline,\%logdata);
}
if ($line =~ /^(\S+)\s+(\S+)\s+\[([^]]+)\]\s+\[([^]]+)\]\s+(\w+)/) {
my %logdata = ();
$logdata{date} = $1;
Expand Down Expand Up @@ -66,8 +74,8 @@ sub processHalfline {
$op->{op} = $2;
if ($logdata->{subsystem}) {
$op->{subsystem} = $logdata->{subsystem};
} elsif ($op->{op} =~ /com\.evolveum\.midpoint\.(\w+)\./) {
$op->{subsystem} = $packageToSubsystem{$1};
} else {
$op->{subsystem} = packageToSubsystem($op->{op});
}
$ops{$opkey} = $op;
push @{$threads{$thread}},$op;
Expand Down Expand Up @@ -100,6 +108,17 @@ sub processHalfline {

}

sub packageToSubsystem {
my ($op) = @_;

foreach my $key (keys %packageToSubsystem) {
if ($op =~ $key) {
return $packageToSubsystem{$key};
}
}
return undef;
}

sub count {
my ($op,$parentop) = @_;

Expand Down Expand Up @@ -128,7 +147,7 @@ sub count {

sub displayIndividualTimes {
foreach my $op (sort { $a->{etime} <=> $b->{etime} } values %ops) {
printf "%40s(%4s): total: %-15f own: %-15f\n",$op->{op},$op->{key},$op->{etime},$op->{ownTime};
printf "%40s(%4s): total: %-15f own: %-15f : ",$op->{op},$op->{key},$op->{etime},$op->{ownTime};
# print $op->{etime}.": ".$op->{key}." ".$op->{op}."\n";
foreach my $args (@{$op->{args}}) {
print " ".$args."\n";
Expand Down

0 comments on commit 35ef89f

Please sign in to comment.