Commits

pmv committed c5ee7ca

Add wrapper for each changeset. Also add logging for the amount of time it takes.

Comments (0)

Files changed (2)

src/main/java/sonia/scm/plugins/pushlog/ChangeGroup.java

 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 
 @XmlRootElement(name = "changegroup")
   @XmlElement(name = "date")
   private Date date;
 
+  @XmlElement(name = "changeset")
+  @XmlElementWrapper(name = "changesets")
   private List<Changeset> changesets;
 
 public String getUser() {

src/main/java/sonia/scm/plugins/pushlog/PushLogger.java

 	
 	@Override
 	public void onEvent(RepositoryHookEvent event) {
+		long beginTime = System.currentTimeMillis();
 		User currentUser = SecurityUtil.getCurrentUser(securityContextProvider);
 		Repository repository = event.getRepository();
 		logger.info("Post Receive Event for repo " + repository.getName() + " created by user " + currentUser.getId());
 			}
 		}
 		pushLogManager.appendPush(changeGroup, repository);
+		double executionTime = (double)(System.currentTimeMillis() - beginTime)/1000;
+		logger.info("PushLogger execution time: " + executionTime);
 	}
 	
 	public boolean isAsync(){