mirror of
https://gitee.com/huoyo/ko-time.git
synced 2025-12-06 16:58:26 +08:00
update docs
This commit is contained in:
parent
661ec7496e
commit
414cb95964
@ -7,7 +7,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.langpy</groupId>
|
<groupId>cn.langpy</groupId>
|
||||||
<artifactId>ko-time</artifactId>
|
<artifactId>ko-time</artifactId>
|
||||||
<version>2.2.2</version>
|
<version>2.2.3-PRE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ ko-time.auth-enable=true # 是否开启认证,默认为false,开启后需要
|
|||||||
ko-time.user-name=xxxx # 登录用户 v2.0.2开始支持
|
ko-time.user-name=xxxx # 登录用户 v2.0.2开始支持
|
||||||
ko-time.password=xxxx # 登录密码 v2.0.2开始支持
|
ko-time.password=xxxx # 登录密码 v2.0.2开始支持
|
||||||
ko-time.param-analyse=true # 是否开启入参组合分析 默认开启 v2.0.8开始支持 双击方法节点即可看到效果
|
ko-time.param-analyse=true # 是否开启入参组合分析 默认开启 v2.0.8开始支持 双击方法节点即可看到效果
|
||||||
ko-time.saver=memory # 接口信息存储位置,可选{memory,database} 默认memory v2.2.0-BETA
|
ko-time.saver=memory # 接口信息存储位置,可选{memory,database,redis} 默认memory v2.2.0-BETA
|
||||||
ko-time.thread-num=2 # 调用信息存储线程数(为了不影响项目本身性能,链路存储异步进行),默认2,该值并非越大越好,瓶颈取决于数据库性能和服务器配置,尽可能少占用项目资源为上 v2.2.0-BETA开始支持
|
ko-time.thread-num=2 # 调用信息存储线程数(为了不影响项目本身性能,链路存储异步进行),默认2,该值并非越大越好,瓶颈取决于数据库性能和服务器配置,尽可能少占用项目资源为上 v2.2.0-BETA开始支持
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -59,7 +59,8 @@ ko-time.thread-num=2 # 调用信息存储线程数(为了不影响项目本身
|
|||||||
|
|
||||||
如:application.properties中定义了 `server.servlet.context-path=/myservice`,那么访问路径为`http://localhost:8080/myservice/koTime`
|
如:application.properties中定义了 `server.servlet.context-path=/myservice`,那么访问路径为`http://localhost:8080/myservice/koTime`
|
||||||
|
|
||||||
如果页面能正常显示,但是无法获取方法链路,可配置`ko-time.context-path=http://localhost:8080/myservice`
|
如果页面能正常显示,但是无法获取方法链路,可配置ko-time.context-path=http://正确路径/myservice进行koTime接口访问路径纠正
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@ -8,6 +8,50 @@ v2.2.0开始支持数据库存储接口信息功能,可在内存和数据库
|
|||||||
|
|
||||||
> ko-time.saver=memory #默认存储方式,无需此配置也行
|
> ko-time.saver=memory #默认存储方式,无需此配置也行
|
||||||
|
|
||||||
|
|
||||||
|
### Redis存储
|
||||||
|
|
||||||
|
1.更改配置:
|
||||||
|
|
||||||
|
> ko-time.saver=redis
|
||||||
|
>
|
||||||
|
> #redis配置
|
||||||
|
>
|
||||||
|
> spring.redis.host: xxx
|
||||||
|
>
|
||||||
|
> spring.redis.port: xxx
|
||||||
|
>
|
||||||
|
> spring.redis.password: xxx
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
2.引入依赖
|
||||||
|
|
||||||
|
```
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
|
||||||
|
3.其他
|
||||||
|
|
||||||
|
项目默认使用Springboot的StringRedisTemplate对象,无需其他操作
|
||||||
|
如果对其不满意,可以自定Bean如:
|
||||||
|
|
||||||
|
```java
|
||||||
|
@Bean("redisbean")
|
||||||
|
public StringRedisTemplate getRedisTemplate(RedisConnectionFactory connectionFactory){
|
||||||
|
StringRedisTemplate template = new StringRedisTemplate();
|
||||||
|
template.setConnectionFactory(connectionFactory);
|
||||||
|
return template;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
然后配置
|
||||||
|
|
||||||
|
> ko-time.redis-template: redisbean
|
||||||
|
|
||||||
|
|
||||||
### 数据库存储
|
### 数据库存储
|
||||||
|
|
||||||
> 注: 使用mysql
|
> 注: 使用mysql
|
||||||
@ -16,26 +60,28 @@ v2.2.0开始支持数据库存储接口信息功能,可在内存和数据库
|
|||||||
|
|
||||||
> ko-time.saver=database
|
> ko-time.saver=database
|
||||||
|
|
||||||
|
> 请引入MySQL相关依赖
|
||||||
> 注:默认使用项目的数据源,多数据源情况下默认使用主数据源,如果没有主数据源,请在配置中指定数据源:`ko-time.data-source=数据源名称`
|
> 注:默认使用项目的数据源,多数据源情况下默认使用主数据源,如果没有主数据源,请在配置中指定数据源:`ko-time.data-source=数据源名称`
|
||||||
|
|
||||||
2.数据表创建
|
2.数据表创建
|
||||||
|
|
||||||
|
> 数据库字段长度不够的自行调整
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
create table ko_method_node (
|
create table ko_method_node (
|
||||||
id varchar(200) not null primary key comment '主键' ,
|
id varchar(400) not null primary key comment '主键' ,
|
||||||
name varchar(200) null comment '类名+方法名' ,
|
name varchar(400) null comment '类名+方法名' ,
|
||||||
class_name varchar(200) null comment '类名' ,
|
class_name varchar(400) null comment '类名' ,
|
||||||
method_name varchar(200) null comment '方法名' ,
|
method_name varchar(400) null comment '方法名' ,
|
||||||
route_name varchar(200) null comment '路由,controller才有' ,
|
route_name varchar(400) null comment '路由,controller才有' ,
|
||||||
method_type varchar(64) null comment '方法类型'
|
method_type varchar(64) null comment '方法类型'
|
||||||
) comment '方法信息表';
|
) comment '方法信息表';
|
||||||
|
|
||||||
|
|
||||||
create table ko_method_relation (
|
create table ko_method_relation (
|
||||||
id varchar(200) not null primary key comment '' ,
|
id varchar(400) not null primary key comment '' ,
|
||||||
source_id varchar(200) null comment '调用方id' ,
|
source_id varchar(400) null comment '调用方id' ,
|
||||||
target_id varchar(200) null comment '被调用方id' ,
|
target_id varchar(400) null comment '被调用方id' ,
|
||||||
avg_run_time numeric(10,2) null comment '平均耗时' ,
|
avg_run_time numeric(10,2) null comment '平均耗时' ,
|
||||||
max_run_time numeric(10,2) null comment '最大耗时' ,
|
max_run_time numeric(10,2) null comment '最大耗时' ,
|
||||||
min_run_time numeric(10,2) null comment '最小耗时'
|
min_run_time numeric(10,2) null comment '最小耗时'
|
||||||
@ -43,23 +89,23 @@ create table ko_method_relation (
|
|||||||
|
|
||||||
;
|
;
|
||||||
create table ko_exception_node (
|
create table ko_exception_node (
|
||||||
id varchar(200) not null primary key comment '主键' ,
|
id varchar(400) not null primary key comment '主键' ,
|
||||||
name varchar(200) null comment '异常名' ,
|
name varchar(400) null comment '异常名' ,
|
||||||
class_name varchar(200) null comment '类名' ,
|
class_name varchar(400) null comment '类名' ,
|
||||||
message varchar(200) null comment '异常消息'
|
message varchar(400) null comment '异常消息'
|
||||||
) comment '异常表';
|
) comment '异常表';
|
||||||
|
|
||||||
|
|
||||||
create table ko_exception_relation (
|
create table ko_exception_relation (
|
||||||
id varchar(200) not null primary key comment '' ,
|
id varchar(400) not null primary key comment '' ,
|
||||||
source_id varchar(200) null comment '调用方法id' ,
|
source_id varchar(400) null comment '调用方法id' ,
|
||||||
target_id varchar(200) null comment '异常id' ,
|
target_id varchar(400) null comment '异常id' ,
|
||||||
location int null comment '异常位置'
|
location int null comment '异常位置'
|
||||||
) comment '异常关系表';
|
) comment '异常关系表';
|
||||||
|
|
||||||
create table ko_param_ana (
|
create table ko_param_ana (
|
||||||
source_id varchar(200) null comment '调用方法id' ,
|
source_id varchar(400) null comment '调用方法id' ,
|
||||||
params varchar(200) null comment '参数组合,-分隔' ,
|
params varchar(400) null comment '参数组合,-分隔' ,
|
||||||
avg_run_time numeric(10,2) null comment '平均耗时' ,
|
avg_run_time numeric(10,2) null comment '平均耗时' ,
|
||||||
max_run_time numeric(10,2) null comment '最大耗时' ,
|
max_run_time numeric(10,2) null comment '最大耗时' ,
|
||||||
min_run_time numeric(10,2) null comment '最小耗时'
|
min_run_time numeric(10,2) null comment '最小耗时'
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>cn.langpy</groupId>
|
<groupId>cn.langpy</groupId>
|
||||||
<artifactId>ko-time</artifactId>
|
<artifactId>ko-time</artifactId>
|
||||||
<version>2.2.3</version>
|
<version>2.2.3-PRE</version>
|
||||||
<name>KoTime</name>
|
<name>KoTime</name>
|
||||||
<description>A springboot tool for tracking the paths of the methods,which can help you to find methods's performances easily.</description>
|
<description>A springboot tool for tracking the paths of the methods,which can help you to find methods's performances easily.</description>
|
||||||
<licenses>
|
<licenses>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user