Skip to content

Commit

Permalink
Merge pull request #12 from Cw404/V2.5.3-RELEASE
Browse files Browse the repository at this point in the history
Make main keep newest [ V2.5.3]
  • Loading branch information
Cw404 committed Dec 22, 2022
2 parents ae49947 + 373edb6 commit 6bc6bdc
Show file tree
Hide file tree
Showing 122 changed files with 43,707 additions and 210 deletions.
10 changes: 9 additions & 1 deletion CHANGES
@@ -1,8 +1,16 @@
trace-recorder Changes

Changes in 2.5.3

* Add dashboard, management chart

* Fix browser display garbled Chinese problem in some server resource

* Fix not found self directory environment in generate process

Changes in 2.5.2

* Add chart-echarts-bar module, use bar chart to show dat
* Add chart-echarts-bar module, use bar chart to show data

* Rebuild json step in relation chart and bar chart

Expand Down
102 changes: 102 additions & 0 deletions CHANGES_zh.txt
@@ -0,0 +1,102 @@
trace-recorder 变更

在2.5.3中的变更

* 添加dashboard, 管理图

* 修复浏览器在一些服务资源中显示中文乱码问题

* 修复在生成过程中找不到自身目录环境的问题

在2.5.2中的变更

* 添加chart-echarts-bar模块, 使用柱状图显示数据

* 在关系图和柱状图中重构json步骤

* 修复在ChartAttribute属性中设置offsetXAxis属性异常

在2.5.1中的变更

* 兼容Windows

在2.5中的变更

* 项目模块化, 项目名变更为trace-recorder

* 添加echarts关系图

* 添加SPI组件注册

* 添加本地共享TraceRecorder

* 添加TraceRecorderEnvironment, 使TraceRecorder更强

* 添加TraceRecorderVersion, 描述当前版本

* 添加slf4j日志去记录TraceRecorder的所有流程

* 添加更多...

在2.4中的变更

* 添加TraceRecorderProperties, 支持从properties文件和xml文件中去生成TraceRecorderConfig

* 变更TraceRecorder的InfoEnhancer链定义,内部InfoEnhancer应晚于外部InfoEnhancer

在2.3中的变更

* 废弃Recorders,它是不受控制的

在2.2.1中的变更

* 修复TraceRecorder关闭方法直接引发com.lmax.disruptor.TimeoutException触发的编译问题

* 修复TraceRecorder关闭方法的有效性

在2.2中的变更

* 添加Memo和Randoms, 支持TraceRecorder复位到特定的结构

在2.1中的变更

* 添加TraceHandler关闭方法, 支持AsyncTraceHandler中释放Disruptor资源

在2.0中的变更

* 将TraceRecorder日志处理提取到TraceHandler,支持同步与异步两种方式

* 添加TraceRecorderConfig, 使用TraceRecorder配置更灵活

* 添加ThreadInfoEnhancer, 支持线程信息log

* 为应用级别添加TraceException, 统一异常

* 添加Disruptors和TeConsumer, 为异步提供更简单的使用

* 添加Lists和Strings, 提供列表的元素打印

* 修正许可证的正确年份

* 更多javadoc信息

在1.2.1中的变更

* 在TraceRecorder和Recorders中添加移除组件方法

在1.2中的变更

* 在Recorders中新的方法非静态的,由于1.1版本已经发布到中央存储库,所以升级到1.2版本,这是一个不好的做法

在1.1中的变更

* 添加Formats, 设置log格式。
清理实例化的一些util类

在1.0.3中的变更

* 添加Symbols, 简化符号生成

在1.0.1中的变更

* 通过中央存储库解析依赖关系,而不是手动推送到本地Maven存储库
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -5,6 +5,7 @@ can better access to the source code implementation of the basic process and the
Records can be better managed with a scalable plug-in architecture.

### News
* TraceRecorder log info to dashboard show.
* TraceRecorder log info to echarts bar chart show.
* TraceRecorder log info to echarts relation chart show.

Expand All @@ -13,15 +14,15 @@ Records can be better managed with a scalable plug-in architecture.

gradle
```gradle
implementation 'cn.xusc:trace-recorder:2.5.2'
implementation 'cn.xusc:trace-recorder:2.5.3'
```

maven
```maven
<dependency>
<groupId>cn.xusc</groupId>
<artifactId>trace-recorder</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</dependency>
```

Expand Down
5 changes: 3 additions & 2 deletions README.zh.md
Expand Up @@ -4,6 +4,7 @@
可以更好的获取源码执行的基础流程和全流程;通过可伸缩的插件体系可以更好的去管理记录。

### 新闻
* 跟踪记录仪记录信息到仪表盘显示。
* 跟踪记录仪记录信息到echarts柱状图显示。
* 跟踪记录仪记录信息到echarts关系图显示。

Expand All @@ -12,15 +13,15 @@

gradle
```gradle
implementation 'cn.xusc:trace-recorder:2.5.2'
implementation 'cn.xusc:trace-recorder:2.5.3'
```

maven
```maven
<dependency>
<groupId>cn.xusc</groupId>
<artifactId>trace-recorder</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -38,7 +38,7 @@ buildscript{
// https://mvnrepository.com/artifact/org.projectlombok/lombok
lombokVersion = '1.18.24'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
jacksonVersion = '2.13.3'
jacksonVersion = '2.14.1'
// https://mvnrepository.com/artifact/com.lmax/disruptor
disruptorVersion = '3.4.4'
// https://mvnrepository.com/artifact/org.mockito/mockito-core
Expand Down Expand Up @@ -80,7 +80,7 @@ subprojects {
apply plugin: "com.diffplug.spotless"

group 'cn.xusc'
version = new Version(major: 2, minor: 5, revision: 2, snapshot: false)
version = new Version(major: 2, minor: 5, revision: 3, snapshot: false)

// 配置lombok编译时期的注释解析
configurations {
Expand Down
11 changes: 11 additions & 0 deletions settings.gradle
Expand Up @@ -7,6 +7,13 @@ include 'trace-recorder-chart:trace-recorder-chart-echarts:trace-recorder-chart-
include 'trace-recorder-chart:trace-recorder-chart-echarts:trace-recorder-chart-echarts-relation'
include 'trace-recorder-server'
include 'trace-recorder-server:trace-recorder-server-tomcat'
include 'trace-recorder-dashboard'
include 'trace-recorder-dashboard:trace-recorder-dashboard-base'
include 'trace-recorder-dashboard:trace-recorder-dashboard-component'
include 'trace-recorder-dashboard:trace-recorder-dashboard-component:trace-recorder-dashboard-component-chart'
include 'trace-recorder-dashboard:trace-recorder-dashboard-component:trace-recorder-dashboard-component-chart:trace-recorder-dashboard-component-chart-echarts'
include 'trace-recorder-dashboard:trace-recorder-dashboard-component:trace-recorder-dashboard-component-chart:trace-recorder-dashboard-component-chart-echarts:trace-recorder-dashboard-component-chart-echarts-relation'
include 'trace-recorder-dashboard:trace-recorder-dashboard-component:trace-recorder-dashboard-component-chart:trace-recorder-dashboard-component-chart-echarts:trace-recorder-dashboard-component-chart-echarts-bar'

include 'trace-recorder-example'
include 'trace-recorder-example:trace-recorder-example-common'
Expand All @@ -16,3 +23,7 @@ include 'trace-recorder-example:trace-recorder-example-chart:trace-recorder-exam
include 'trace-recorder-example:trace-recorder-example-chart:trace-recorder-example-chart-echarts-relation'
include 'trace-recorder-example:trace-recorder-example-server'
include 'trace-recorder-example:trace-recorder-example-server:trace-recorder-example-server-tomcat'
include 'trace-recorder-example:trace-recorder-example-dashboard'
include 'trace-recorder-example:trace-recorder-example-dashboard:trace-recorder-example-dashboard-base'
include 'trace-recorder-example:trace-recorder-example-dashboard:trace-recorder-example-dashboard-component-chart-echarts-bar'
include 'trace-recorder-example:trace-recorder-example-dashboard:trace-recorder-example-dashboard-component-chart-echarts-relation'
Expand Up @@ -67,39 +67,27 @@ public abstract class AbstractChart implements Chart {
* 基础构造
*/
public AbstractChart() {
boolean debugEnabled = log.isDebugEnabled();
String chartName = new Class<>(this).name();
if (debugEnabled) {
log.debug("init chart: {}", chartName);
}
log.debug("init chart: {}", chartName);

this.CHART_CONFIG = initChartConfig();
if (debugEnabled) {
log.debug("init chart config successful!");
}
log.debug("init chart config successful!");

initChartAttribute();
if (debugEnabled) {
log.debug("init chart attribute successful!");
}
log.debug("init chart attribute successful!");

this.CHART_FLOW = new ChartFlow();
if (debugEnabled) {
log.debug("creat chart flow successful!");
}
log.debug("creat chart flow successful!");

initCharProcessSteps(CHART_FLOW);
if (debugEnabled) {
log.debug("init chart processSteps successful!");
}
log.debug("init chart processSteps successful!");

this.CHART_DATA_PROCESSOR = initChartDataProcessor(this);
this.CHART_DATA_PROCESSOR.setDaemon(true);
this.CHART_DATA_PROCESSOR.start();
if (debugEnabled) {
log.debug("started chart data processor [ {} ] successful!", CHART_DATA_PROCESSOR.getName());
log.debug("init chart: [ {} ] successful!", chartName);
}
log.debug("started chart data processor [ {} ] successful!", CHART_DATA_PROCESSOR.getName());

log.debug("init chart: [ {} ] successful!", chartName);
}

@Override
Expand All @@ -125,9 +113,7 @@ public ChartData render() {
renderChartData = chartData
);

if (log.isDebugEnabled()) {
log.debug("render chart data: {}", renderChartData.basicChartData());
}
log.debug("render chart data: {}", renderChartData.basicChartData());

for (ChartProcessStep chartProcessStep : CHART_FLOW.flow()) {
try {
Expand All @@ -136,13 +122,11 @@ public ChartData render() {
throw new TraceException(e);
}

if (log.isTraceEnabled()) {
log.debug(
"chart process step [ {} ] generate value: {}",
new Class<>(chartProcessStep).name(),
valuePipeline.getValue()
);
}
log.debug(
"chart process step [ {} ] generate value: {}",
new Class<>(chartProcessStep).name(),
valuePipeline.getValue()
);
}
return renderChartData;
}
Expand All @@ -165,18 +149,14 @@ public void show() {
continueShow();
openServerShow();

if (log.isDebugEnabled()) {
log.debug("open server show chart successful!");
}
log.debug("open server show chart successful!");
}

/**
* 等待第一个数据产生
*/
private void waitFirstData() {
if (log.isDebugEnabled()) {
log.debug("wait for first chart data of generate");
}
log.debug("wait for first chart data of generate");

while (true) {
if (Objects.nonNull(chartData)) {
Expand All @@ -198,9 +178,7 @@ private void continueShow() {
this.chartDataContinueShower.setDaemon(true);
this.chartDataContinueShower.start();

if (log.isDebugEnabled()) {
log.debug("started chart data continue shower [ {} ] successful!", chartDataContinueShower.getName());
}
log.debug("started chart data continue shower [ {} ] successful!", chartDataContinueShower.getName());
}

/**
Expand Down
Expand Up @@ -78,9 +78,7 @@ public ChartEnhancer() {
}
STRATEGY = chart.config().getChartRefreshStrategy();

if (log.isDebugEnabled()) {
log.debug("discover chart: {}, refresh strategy: {}", new Class<>(chart).name(), STRATEGY.name());
}
log.debug("discover chart: {}, refresh strategy: {}", new Class<>(chart).name(), STRATEGY.name());
}

/**
Expand Down Expand Up @@ -136,19 +134,15 @@ protected EnhanceInfo doEnhance(EnhanceInfo eInfo) {
standardChartData.setInfo(eInfo.getInfo());
standardChartData.setStackTraceElements(stackTraceElements);

if (log.isTraceEnabled()) {
log.trace("generate standard chart data: {}", standardChartData.basicChartData());
}
log.trace("generate standard chart data: {}", standardChartData.basicChartData());

/*
标准图表数据填充到存储库
*/
for (;;) {
try {
ChartDataRepository.INSTANCE.put(standardChartData);
if (log.isTraceEnabled()) {
log.trace("put standard chart data to repository");
}
log.trace("put standard chart data to repository");
break;
} catch (InterruptedException e) {
// nop
Expand Down Expand Up @@ -203,15 +197,11 @@ protected String showInfo() {
private void innerShow() {
String chartName = new Class<>(chart).name();

if (log.isTraceEnabled()) {
log.trace("show chart: {}", chartName);
}
log.trace("show chart: {}", chartName);

chart.show();
alreadyShowChart = true;

if (log.isDebugEnabled()) {
log.debug("showed chart: {}", chartName);
}
log.debug("showed chart: {}", chartName);
}
}
Expand Up @@ -118,7 +118,7 @@ private Path generateEnvironment(GenerableChartConfig generableChartConfig) thro
Path templatePath = Temporary.TEMPLATE_PATH;
generatePath = generatePath.resolve(generableChartConfig.getSpecificGenerateChartPath());
String homePath = generableChartConfig.getHomePath().toString();
List<Path> paths = Finder.find(ClassLoader.getSystemResource(Systems.getSystemClassPath(homePath)), "**");
List<Path> paths = Finder.find(ClassLoader.getSystemResource(Systems.getSystemClassPath(homePath)), "**", true);
if (Files.notExists(generatePath)) {
Files.createDirectories(generatePath);
for (Path path : paths) {
Expand Down
Expand Up @@ -90,9 +90,7 @@ protected void openServerShow() {
)
.start();

if (log.isDebugEnabled()) {
log.debug("started tomcat server successful!");
}
log.debug("started tomcat server successful!");
}

/**
Expand Down

0 comments on commit 6bc6bdc

Please sign in to comment.