Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
d3c70fa1
Commit
d3c70fa1
authored
Apr 09, 2015
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.2.x'
parents
d13878e1
8cdff1cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
InMemoryTraceRepository.java
...framework/boot/actuate/trace/InMemoryTraceRepository.java
+1
-1
InMemoryTraceRepositoryTests.java
...work/boot/actuate/trace/InMemoryTraceRepositoryTests.java
+14
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/InMemoryTraceRepository.java
View file @
d3c70fa1
...
@@ -63,7 +63,7 @@ public class InMemoryTraceRepository implements TraceRepository {
...
@@ -63,7 +63,7 @@ public class InMemoryTraceRepository implements TraceRepository {
Trace
trace
=
new
Trace
(
new
Date
(),
map
);
Trace
trace
=
new
Trace
(
new
Date
(),
map
);
synchronized
(
this
.
traces
)
{
synchronized
(
this
.
traces
)
{
while
(
this
.
traces
.
size
()
>=
this
.
capacity
)
{
while
(
this
.
traces
.
size
()
>=
this
.
capacity
)
{
this
.
traces
.
remove
(
this
.
capacity
-
1
);
this
.
traces
.
remove
(
this
.
reverse
?
this
.
capacity
-
1
:
0
);
}
}
if
(
this
.
reverse
)
{
if
(
this
.
reverse
)
{
this
.
traces
.
add
(
0
,
trace
);
this
.
traces
.
add
(
0
,
trace
);
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java
View file @
d3c70fa1
...
@@ -41,6 +41,20 @@ public class InMemoryTraceRepositoryTests {
...
@@ -41,6 +41,20 @@ public class InMemoryTraceRepositoryTests {
List
<
Trace
>
traces
=
this
.
repository
.
findAll
();
List
<
Trace
>
traces
=
this
.
repository
.
findAll
();
assertEquals
(
2
,
traces
.
size
());
assertEquals
(
2
,
traces
.
size
());
assertEquals
(
"bar"
,
traces
.
get
(
0
).
getInfo
().
get
(
"bar"
));
assertEquals
(
"bar"
,
traces
.
get
(
0
).
getInfo
().
get
(
"bar"
));
assertEquals
(
"foo"
,
traces
.
get
(
1
).
getInfo
().
get
(
"bar"
));
}
@Test
public
void
reverseFalse
()
{
this
.
repository
.
setReverse
(
false
);
this
.
repository
.
setCapacity
(
2
);
this
.
repository
.
add
(
Collections
.<
String
,
Object
>
singletonMap
(
"foo"
,
"bar"
));
this
.
repository
.
add
(
Collections
.<
String
,
Object
>
singletonMap
(
"bar"
,
"foo"
));
this
.
repository
.
add
(
Collections
.<
String
,
Object
>
singletonMap
(
"bar"
,
"bar"
));
List
<
Trace
>
traces
=
this
.
repository
.
findAll
();
assertEquals
(
2
,
traces
.
size
());
assertEquals
(
"bar"
,
traces
.
get
(
1
).
getInfo
().
get
(
"bar"
));
assertEquals
(
"foo"
,
traces
.
get
(
0
).
getInfo
().
get
(
"bar"
));
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment