Skip to content

Commit 6a9752c

Browse files
committed
fixing tracing issue with speed up fix
back to tomcat suppress cache warnings
1 parent 5d4809e commit 6a9752c

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

marklogic-data-hub/src/main/resources/ml-modules/root/com.marklogic.hub/lib/trace-lib.xqy

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,15 @@ declare variable $FORMAT-JSON := "json";
3333

3434
declare %private variable $current-trace-settings := map:map();
3535

36-
declare %private variable $current-trace := map:new((
37-
map:entry("traceId", xdmp:random()),
38-
map:entry("created", fn:current-dateTime())
39-
));
36+
declare %private variable $current-trace := trace:new-trace();
37+
38+
declare function trace:new-trace()
39+
{
40+
map:new((
41+
map:entry("traceId", xdmp:random()),
42+
map:entry("created", fn:current-dateTime())
43+
))
44+
};
4045

4146
declare function trace:enable-tracing($enabled as xs:boolean)
4247
{
@@ -77,7 +82,7 @@ declare function trace:init-trace($format as xs:string)
7782

7883
declare function trace:write-trace()
7984
{
80-
if (trace:enabled() or trace:has-errors()) then
85+
if (trace:enabled() or trace:has-errors()) then (
8186
let $format := map:get($current-trace-settings, "data-format")
8287
let $trace :=
8388
if ($format eq $FORMAT-JSON) then
@@ -145,7 +150,9 @@ declare function trace:write-trace()
145150
map:new((
146151
map:entry("database", xdmp:database($config:TRACING-DATABASE)),
147152
map:entry("transactionMode", "update-auto-commit")
148-
)))
153+
))),
154+
xdmp:set($current-trace, trace:new-trace())
155+
)
149156
else ()
150157
};
151158

quick-start/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
ext {
3-
springBootVersion = '1.4.0.RELEASE'
3+
springBootVersion = '1.4.1.RELEASE'
44
}
55
repositories {
66
jcenter()
@@ -38,7 +38,6 @@ targetCompatibility = 1.8
3838
dependencies {
3939
compile("org.springframework.boot:spring-boot-starter:${springBootVersion}")
4040
compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}")
41-
compile("org.springframework.boot:spring-boot-starter-jetty:${springBootVersion}")
4241
compile("org.springframework.boot:spring-boot-starter-websocket:${springBootVersion}")
4342
compile("org.springframework.boot:spring-boot-starter-thymeleaf:${springBootVersion}")
4443
compile("org.aspectj:aspectjweaver:1.8.9")
@@ -59,7 +58,6 @@ dependencies {
5958
configurations {
6059
all*.exclude group: 'xml-apis'
6160
all*.exclude group: 'xerces'
62-
compile.exclude module: "spring-boot-starter-tomcat"
6361
}
6462

6563
task cleanUI(type: Delete) {

quick-start/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ server.port=8080
33
server.contextPath=/
44
# server.error.whitelabel.enabled=false
55
logging.level.com.marklogic.hub: INFO
6-
6+
logging.level.org.apache.catalina.webresources.Cache: ERROR
77
spring.mvc.favicon.enabled=false
88

99
# By default, enable the dev profile

quick-start/src/test/java/com/marklogic/quickstart/service/FlowManagerServiceTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
import org.junit.runner.RunWith;
88
import org.springframework.beans.factory.annotation.Autowired;
99
import org.springframework.boot.test.SpringApplicationConfiguration;
10+
import org.springframework.boot.test.context.SpringBootTest;
1011
import org.springframework.mock.web.MockHttpServletRequest;
1112
import org.springframework.mock.web.MockHttpSession;
1213
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
14+
import org.springframework.test.context.junit4.SpringRunner;
1315
import org.springframework.test.context.web.WebAppConfiguration;
1416

1517
import static org.junit.Assert.*;
1618

17-
@RunWith(SpringJUnit4ClassRunner.class)
18-
@SpringApplicationConfiguration(Application.class)
19-
@WebAppConfiguration
19+
@RunWith(SpringRunner.class)
20+
@SpringBootTest()
2021
public class FlowManagerServiceTest {
2122

2223
@Autowired

0 commit comments

Comments
 (0)