-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jihor
authored and
jihor
committed
Sep 30, 2016
1 parent
c728b91
commit ecb65a8
Showing
2 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,21 +4,21 @@ | |
import org.aspectj.lang.annotation.Before; | ||
import org.aspectj.lang.annotation.Pointcut; | ||
|
||
import java.util.concurrent.atomic.LongAdder; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
/** | ||
* @author jihor ([email protected]) | ||
* Created on 2016-09-30 | ||
*/ | ||
@Aspect | ||
public class CountingAspect { | ||
public LongAdder counter = new LongAdder(); | ||
public AtomicInteger counter = new AtomicInteger(0); | ||
|
||
@Pointcut("execution(* org.springframework.cloud.client.loadbalancer.LoadBalancerClient.choose(..))") | ||
private void loadBalancerServerChoice() {} | ||
|
||
@Before("loadBalancerServerChoice()") | ||
public void before(){ | ||
counter.increment(); | ||
counter.incrementAndGet(); | ||
} | ||
} |