-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: simplify logic of handling initial context (#283)
- reduce thread locals - drop usage of extra executors
- Loading branch information
1 parent
227bec3
commit 05b9e03
Showing
10 changed files
with
75 additions
and
258 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
24 changes: 24 additions & 0 deletions
24
james-agent/src/main/java/com/tomtom/james/informationpoint/advice/ExecutionContext.java
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.tomtom.james.informationpoint.advice; | ||
|
||
import java.time.Duration; | ||
|
||
public class ExecutionContext { | ||
private final long started; | ||
private Object initialContext; | ||
|
||
public ExecutionContext() { | ||
this.started = System.nanoTime(); | ||
} | ||
|
||
public Duration getElapsedTime() { | ||
return Duration.ofNanos(System.nanoTime() - started); | ||
} | ||
|
||
public Object getInitialContext() { | ||
return initialContext; | ||
} | ||
|
||
public void setInitialContext(final Object initialContext) { | ||
this.initialContext = initialContext; | ||
} | ||
} |
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
47 changes: 0 additions & 47 deletions
47
james-agent/src/main/java/com/tomtom/james/newagent/MethodExecutionTimeHelper.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.