Skip to content

Commit d227fcb

Browse files
committed
[pinpoint-apm#9666] Add redis pubsub atc,atd,echo
1 parent 8a3ba8a commit d227fcb

File tree

4 files changed

+52
-21
lines changed

4 files changed

+52
-21
lines changed

redis/src/test/java/com/navercorp/pinpoint/redis/pubsub/RedisReqResTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ private void testServerClientFactory(
9090
serverFactory.build(name -> Mono.just("Hello, " + name), greeterService).afterPropertiesSet();
9191
assertThat(syncRequestMono(clientFactory, greeterService, "World")).isEqualTo("Hello, World");
9292

93-
final PubSubMonoServiceDescriptor<Integer, Integer> incrementService =
93+
final PubSubMonoServiceDescriptor<Integer, Integer> squareService =
9494
PubSubServiceDescriptor.mono("square", Integer.class, Integer.class);
95-
serverFactory.build(el -> Mono.just(el * el), incrementService).afterPropertiesSet();
96-
assertThat(syncRequestMono(clientFactory, incrementService, 22)).isEqualTo(484);
95+
serverFactory.build(el -> Mono.just(el * el), squareService).afterPropertiesSet();
96+
assertThat(syncRequestMono(clientFactory, squareService, 22)).isEqualTo(484);
9797

9898
final PubSubFluxServiceDescriptor<Integer, Integer> rangeService =
9999
PubSubServiceDescriptor.flux("range", Integer.class, Integer.class);
@@ -119,7 +119,7 @@ private <D, S> List<S> syncRequestFlux(
119119
return clientFactory.build(descriptor)
120120
.request(demand)
121121
.collectList()
122-
.timeout(Duration.ofSeconds(5))
122+
.timeout(Duration.ofSeconds(30))
123123
.block();
124124
}
125125

web/src/main/java/com/navercorp/pinpoint/web/AuthorizationConfig.java

-16
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@
3535
import com.navercorp.pinpoint.web.install.controller.AgentDownloadController;
3636
import com.navercorp.pinpoint.web.install.service.AgentDownLoadService;
3737
import com.navercorp.pinpoint.web.service.ActiveThreadDumpService;
38-
import com.navercorp.pinpoint.web.service.ActiveThreadDumpServiceImpl;
3938
import com.navercorp.pinpoint.web.service.AdminService;
4039
import com.navercorp.pinpoint.web.service.AgentEventService;
4140
import com.navercorp.pinpoint.web.service.AgentInfoService;
4241
import com.navercorp.pinpoint.web.service.AgentService;
4342
import com.navercorp.pinpoint.web.service.AlarmService;
44-
import com.navercorp.pinpoint.web.service.EchoService;
45-
import com.navercorp.pinpoint.web.service.EchoServiceImpl;
4643
import com.navercorp.pinpoint.web.service.FilteredMapService;
4744
import com.navercorp.pinpoint.web.service.HeatMapService;
4845
import com.navercorp.pinpoint.web.service.ScatterChartService;
@@ -52,7 +49,6 @@
5249
import com.navercorp.pinpoint.web.service.appmetric.ApplicationStatChartService;
5350
import com.navercorp.pinpoint.web.service.stat.AgentStatChartService;
5451
import com.navercorp.pinpoint.web.service.stat.AgentStatService;
55-
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
5652
import org.springframework.context.annotation.Bean;
5753
import org.springframework.context.annotation.Configuration;
5854

@@ -87,18 +83,6 @@ public AgentStatController<AgentStatDataPoint> createAgentStatController(List<Ag
8783
return new AgentStatController<>(service, agentStatChartServiceList);
8884
}
8985

90-
@Bean
91-
@ConditionalOnMissingBean(ActiveThreadDumpService.class)
92-
public ActiveThreadDumpService activeThreadDumpService(AgentService agentService) {
93-
return new ActiveThreadDumpServiceImpl(agentService);
94-
}
95-
96-
@Bean
97-
@ConditionalOnMissingBean(EchoService.class)
98-
public EchoService echoService(AgentService agentService) {
99-
return new EchoServiceImpl(agentService);
100-
}
101-
10286
@Bean
10387
public AgentCommandController createAgentCommandController(
10488
ConfigProperties webProperties,

web/src/main/java/com/navercorp/pinpoint/web/PinpointWebModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
WebServerConfig.class,
3737
WebMvcConfig.class,
3838
WebSocketConfig.class,
39+
WebServiceConfig.class,
3940
WebMysqlDataSourceConfiguration.class,
4041
ClusterConfigurationFactory.class,
4142
CacheConfiguration.class,
@@ -48,7 +49,6 @@
4849
QueryServiceConfiguration.class
4950
})
5051
@ComponentScan(basePackages = {
51-
"com.navercorp.pinpoint.web.service",
5252
"com.navercorp.pinpoint.web.mapper",
5353
"com.navercorp.pinpoint.web.filter",
5454
"com.navercorp.pinpoint.web.view",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2023 NAVER Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.navercorp.pinpoint.web;
17+
18+
import com.navercorp.pinpoint.web.service.ActiveThreadDumpService;
19+
import com.navercorp.pinpoint.web.service.ActiveThreadDumpServiceImpl;
20+
import com.navercorp.pinpoint.web.service.AgentService;
21+
import com.navercorp.pinpoint.web.service.EchoService;
22+
import com.navercorp.pinpoint.web.service.EchoServiceImpl;
23+
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
24+
import org.springframework.context.annotation.Bean;
25+
import org.springframework.context.annotation.ComponentScan;
26+
import org.springframework.context.annotation.Configuration;
27+
28+
/**
29+
* @author youngjin.kim2
30+
*/
31+
@Configuration
32+
@ComponentScan(basePackages = { "com.navercorp.pinpoint.web.service" })
33+
public class WebServiceConfig {
34+
35+
@Bean
36+
@ConditionalOnMissingBean(ActiveThreadDumpService.class)
37+
ActiveThreadDumpService activeThreadDumpService(AgentService agentService) {
38+
return new ActiveThreadDumpServiceImpl(agentService);
39+
}
40+
41+
@Bean
42+
@ConditionalOnMissingBean(EchoService.class)
43+
EchoService echoService(AgentService agentService) {
44+
return new EchoServiceImpl(agentService);
45+
}
46+
47+
}

0 commit comments

Comments
 (0)