整合springboot-admin
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
docker run --name portainer -d -p 9000:9000 -v "/var/run/docker.sock:/var/run/docker.sock" portainer/portainer
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
docker start portainer
|
||||
docker start mysql-master
|
||||
docker start redis-server
|
||||
docker start rabbitmq
|
||||
@@ -21,9 +21,7 @@ import java.util.SortedMap;
|
||||
@Slf4j
|
||||
public class RecordInformationFilter extends ZuulFilter {
|
||||
|
||||
public static final String SERVICE_RANK_KEY = "gateway:ServiceCount";
|
||||
|
||||
public static final String SERVICE_COUNT_KEY = "gateway:ServiceCount";
|
||||
public static final String SERVICE_RANK_KEY = "gateway:ServiceRank";
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate<String,String> redisTemplate;
|
||||
@@ -63,8 +61,6 @@ public class RecordInformationFilter extends ZuulFilter {
|
||||
String[] split = requestURI.split("/");
|
||||
// 统计网管访问服务数量
|
||||
redisTemplate.opsForZSet().incrementScore(SERVICE_RANK_KEY,split[1],1);
|
||||
// 统计服务调用总量
|
||||
redisTemplate.opsForValue().increment(SERVICE_COUNT_KEY,1);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,23 @@
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<!--springboot-server-->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
</dependency>
|
||||
<!--springboot-hystrix视图-->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-server-ui-hystrix</artifactId>
|
||||
<version>1.5.7</version>
|
||||
</dependency>
|
||||
<!--springboot-turbine视图-->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-server-ui-turbine</artifactId>
|
||||
<version>1.5.7</version>
|
||||
</dependency>
|
||||
<!--web-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package com.micro.fast.monitor.center;
|
||||
|
||||
import de.codecentric.boot.admin.config.EnableAdminServer;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
|
||||
@@ -14,6 +15,7 @@ import org.springframework.cloud.netflix.turbine.EnableTurbine;
|
||||
@EnableTurbine
|
||||
@EnableHystrixDashboard
|
||||
@EnableHystrix
|
||||
@EnableAdminServer
|
||||
public class MsMonitorTurbineApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<!--springboot监控客户端-->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
</dependency>
|
||||
<!--公共配置-->
|
||||
<dependency>
|
||||
<groupId>com.micro.fast</groupId>
|
||||
|
||||
@@ -80,6 +80,8 @@
|
||||
<docker.maven.plugin.version>0.4.3</docker.maven.plugin.version>
|
||||
<wiremock.version>2.11.0</wiremock.version>
|
||||
<spring-boot-devtools.optional>true</spring-boot-devtools.optional>
|
||||
<spring-boot-admin.version>1.5.7</spring-boot-admin.version>
|
||||
<quartz.version>2.2.1</quartz.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -288,6 +290,24 @@
|
||||
<artifactId>fastdfs-client-java</artifactId>
|
||||
<version>${fastdfs-client-java.version}</version>
|
||||
</dependency>
|
||||
<!--springboot-admin-->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-dependencies</artifactId>
|
||||
<version>${spring-boot-admin.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>${quartz.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz-jobs</artifactId>
|
||||
<version>${quartz.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user