mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
use stopwatch to log time taken by getChangesets of a hook
This commit is contained in:
@@ -33,6 +33,8 @@ package sonia.scm.repository;
|
|||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
|
import com.google.common.base.Stopwatch;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -118,7 +120,7 @@ public class SynchronizedRepositoryHookEvent implements RepositoryHookEvent
|
|||||||
{
|
{
|
||||||
if (changesets == null)
|
if (changesets == null)
|
||||||
{
|
{
|
||||||
changesets = wrappedEvent.getChangesets();
|
fetchChangesets();
|
||||||
|
|
||||||
if (changesets != null)
|
if (changesets != null)
|
||||||
{
|
{
|
||||||
@@ -171,6 +173,26 @@ public class SynchronizedRepositoryHookEvent implements RepositoryHookEvent
|
|||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private void fetchChangesets()
|
||||||
|
{
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
Stopwatch sw = new Stopwatch().start();
|
||||||
|
|
||||||
|
changesets = wrappedEvent.getChangesets();
|
||||||
|
sw.stop();
|
||||||
|
logger.debug("getChangesets() took {}", sw);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
changesets = wrappedEvent.getChangesets();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user