Skip to content

Commit

Permalink
[#9666] Add redis pubsub atc,atd,echo
Browse files Browse the repository at this point in the history
  • Loading branch information
smilu97 committed May 18, 2023
1 parent 8a3ba8a commit f99c438
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ private void testServerClientFactory(
serverFactory.build(name -> Mono.just("Hello, " + name), greeterService).afterPropertiesSet();
assertThat(syncRequestMono(clientFactory, greeterService, "World")).isEqualTo("Hello, World");

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

final PubSubFluxServiceDescriptor<Integer, Integer> rangeService =
PubSubServiceDescriptor.flux("range", Integer.class, Integer.class);
Expand All @@ -119,7 +119,7 @@ private <D, S> List<S> syncRequestFlux(
return clientFactory.build(descriptor)
.request(demand)
.collectList()
.timeout(Duration.ofSeconds(5))
.timeout(Duration.ofSeconds(30))
.block();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@
import com.navercorp.pinpoint.web.install.controller.AgentDownloadController;
import com.navercorp.pinpoint.web.install.service.AgentDownLoadService;
import com.navercorp.pinpoint.web.service.ActiveThreadDumpService;
import com.navercorp.pinpoint.web.service.ActiveThreadDumpServiceImpl;
import com.navercorp.pinpoint.web.service.AdminService;
import com.navercorp.pinpoint.web.service.AgentEventService;
import com.navercorp.pinpoint.web.service.AgentInfoService;
import com.navercorp.pinpoint.web.service.AgentService;
import com.navercorp.pinpoint.web.service.AlarmService;
import com.navercorp.pinpoint.web.service.EchoService;
import com.navercorp.pinpoint.web.service.EchoServiceImpl;
import com.navercorp.pinpoint.web.service.FilteredMapService;
import com.navercorp.pinpoint.web.service.HeatMapService;
import com.navercorp.pinpoint.web.service.ScatterChartService;
Expand All @@ -52,7 +49,6 @@
import com.navercorp.pinpoint.web.service.appmetric.ApplicationStatChartService;
import com.navercorp.pinpoint.web.service.stat.AgentStatChartService;
import com.navercorp.pinpoint.web.service.stat.AgentStatService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

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

@Bean
@ConditionalOnMissingBean(ActiveThreadDumpService.class)
public ActiveThreadDumpService activeThreadDumpService(AgentService agentService) {
return new ActiveThreadDumpServiceImpl(agentService);
}

@Bean
@ConditionalOnMissingBean(EchoService.class)
public EchoService echoService(AgentService agentService) {
return new EchoServiceImpl(agentService);
}

@Bean
public AgentCommandController createAgentCommandController(
ConfigProperties webProperties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
WebServerConfig.class,
WebMvcConfig.class,
WebSocketConfig.class,
WebServiceConfig.class,
WebMysqlDataSourceConfiguration.class,
ClusterConfigurationFactory.class,
CacheConfiguration.class,
Expand All @@ -48,7 +49,6 @@
QueryServiceConfiguration.class
})
@ComponentScan(basePackages = {
"com.navercorp.pinpoint.web.service",
"com.navercorp.pinpoint.web.mapper",
"com.navercorp.pinpoint.web.filter",
"com.navercorp.pinpoint.web.view",
Expand Down
47 changes: 47 additions & 0 deletions web/src/main/java/com/navercorp/pinpoint/web/WebServiceConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2023 NAVER Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.navercorp.pinpoint.web;

import com.navercorp.pinpoint.web.service.ActiveThreadDumpService;
import com.navercorp.pinpoint.web.service.ActiveThreadDumpServiceImpl;
import com.navercorp.pinpoint.web.service.AgentService;
import com.navercorp.pinpoint.web.service.EchoService;
import com.navercorp.pinpoint.web.service.EchoServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
* @author youngjin.kim2
*/
@Configuration
@ComponentScan(basePackages = { "com.navercorp.pinpoint.web.service" })
public class WebServiceConfig {

@Bean
@ConditionalOnMissingBean(ActiveThreadDumpService.class)
ActiveThreadDumpService activeThreadDumpService(AgentService agentService) {
return new ActiveThreadDumpServiceImpl(agentService);
}

@Bean
@ConditionalOnMissingBean(EchoService.class)
EchoService echoService(AgentService agentService) {
return new EchoServiceImpl(agentService);
}

}

0 comments on commit f99c438

Please sign in to comment.