forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#noissue] Reduce memory usage of DisableTrace
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
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
29 changes: 29 additions & 0 deletions
29
profiler/src/test/java/com/navercorp/pinpoint/profiler/context/DisableTraceTest.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,29 @@ | ||
package com.navercorp.pinpoint.profiler.context; | ||
|
||
import com.navercorp.pinpoint.bootstrap.context.Trace; | ||
import com.navercorp.pinpoint.profiler.context.active.ActiveTraceHandle; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import static org.mockito.Mockito.mock; | ||
|
||
public class DisableTraceTest { | ||
@Test | ||
public void testGetScope() { | ||
Trace trace = newTrace(); | ||
Assert.assertNull(trace.addScope("empty")); | ||
} | ||
|
||
@Test | ||
public void testAddScope() { | ||
Trace trace = newTrace(); | ||
|
||
trace.addScope("aaa"); | ||
Assert.assertNotNull(trace.getScope("aaa")); | ||
} | ||
|
||
private Trace newTrace() { | ||
ActiveTraceHandle activeTraceHandle = mock(ActiveTraceHandle.class); | ||
return new DisableTrace(1, 2, activeTraceHandle); | ||
} | ||
} |