Skip to content

Commit e539e33

Browse files
committed
replace pic
1 parent ccd6b8f commit e539e33

4 files changed

Lines changed: 84 additions & 84 deletions

File tree

docs/netty/Netty(1)TCP-Heartbeat.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public class CustomerHandleInitializer extends ChannelInitializer<Channel> {
137137

138138
所以当应用启动每隔 10 秒会检测是否发送过消息,不然就会发送心跳信息。
139139

140-
![](https://ws3.sinaimg.cn/large/006tKfTcgy1frqd863hrhj31kw04taed.jpg)
140+
![](https://i.loli.net/2019/07/19/5d313938a059249899.jpg)
141141

142142
## 服务端心跳
143143

@@ -286,7 +286,7 @@ public class HeartbeatInitializer extends ChannelInitializer<Channel> {
286286

287287
也是同样将IdleStateHandler 添加到 ChannelPipeline 中,也会有一个定时任务,每5秒校验一次是否有收到消息,否则就主动发送一次请求。
288288

289-
![](https://ws1.sinaimg.cn/large/006tKfTcgy1frqe2hbxjfj31kw06rtej.jpg)
289+
![](https://i.loli.net/2019/07/19/5d31393e0f8c660705.jpg)
290290

291291
因为测试是有两个客户端连上所以有两个日志。
292292

@@ -474,10 +474,10 @@ public class HeartbeatDecoder extends ByteToMessageDecoder {
474474
就开启了 SpringBoot 的 actuator 监控功能,他可以暴露出很多监控端点供我们使用。
475475

476476
如一些应用中的一些统计数据:
477-
![](https://ws1.sinaimg.cn/large/006tKfTcgy1frqeyocotnj31kw0b8tiy.jpg)
477+
![](https://i.loli.net/2019/07/19/5d31393fa017351196.jpg)
478478

479479
存在的 Beans:
480-
![](https://ws3.sinaimg.cn/large/006tKfTcgy1frqez1kr3dj31kw0onawi.jpg)
480+
![](https://i.loli.net/2019/07/19/5d31394d8fb6d16523.jpg)
481481

482482
更多信息请查看:[https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html](https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html)
483483

@@ -536,10 +536,10 @@ public class EndPointConfig {
536536
这样我们就可以通过配置文件中的 `monitor.channel.map.key` 来访问了:
537537

538538
一个客户端连接时:
539-
![](https://ws3.sinaimg.cn/large/006tKfTcgy1frqf7ic0wqj31kw07rq7a.jpg)
539+
![](https://i.loli.net/2019/07/19/5d31394e55fe384723.jpg)
540540

541541
两个客户端连接时:
542-
![](https://ws2.sinaimg.cn/large/006tKfTcgy1frqf8omlzkj31kw07xq7y.jpg)
542+
![](https://i.loli.net/2019/07/19/5d31395522dda45659.jpg)
543543

544544

545545
## 整合 SBA
@@ -552,7 +552,7 @@ public class EndPointConfig {
552552

553553
简单来说我们可以利用该工具将 actuator 暴露出来的接口可视化并聚合的展示在页面中:
554554

555-
![](https://ws2.sinaimg.cn/large/006tKfTcgy1frqfbz359wj31kw0p513n.jpg)
555+
![](https://i.loli.net/2019/07/19/5d313956b3aca18512.jpg)
556556

557557
接入也很简单,首先需要引入依赖:
558558

@@ -609,7 +609,7 @@ public class AdminApplication {
609609

610610
这样我们在 SpringBootAdmin 的页面中就可以查看很多应用信息了。
611611

612-
![](https://ws4.sinaimg.cn/large/006tKfTcgy1frqfjuof2rj31kw10ldqk.jpg)
612+
![](https://i.loli.net/2019/07/19/5d31395886b8e59039.jpg)
613613

614614
更多内容请参考官方指南:
615615

@@ -668,21 +668,21 @@ public class IndexController {
668668

669669
当我们调用该接口时:
670670

671-
![](https://ws4.sinaimg.cn/large/006tKfTcgy1frqfv3vx0ej31hk0g6dj5.jpg)
671+
![](https://i.loli.net/2019/07/19/5d313960a3a9826851.jpg)
672672

673-
![](https://ws4.sinaimg.cn/large/006tKfTcgy1frqfvof9lpj31kw07l0z8.jpg)
673+
![](https://i.loli.net/2019/07/19/5d3139634d9e553115.jpg)
674674

675675
在监控页面中可以查询刚才的调用情况:
676676

677-
![](https://ws4.sinaimg.cn/large/006tKfTcgy1frqfwembi6j31kw0o0dot.jpg)
677+
![](https://i.loli.net/2019/07/19/5d313964b932568620.jpg)
678678

679679
服务端主动 push 消息也是类似,只是需要在发送时候根据客户端的 ID 查询到具体的 Channel 发送:
680680

681-
![](https://ws4.sinaimg.cn/large/006tKfTcgy1frqfy9dcu5j31hu0f277i.jpg)
681+
![](https://i.loli.net/2019/07/19/5d31396c18f0c66961.jpg)
682682

683-
![](https://ws2.sinaimg.cn/large/006tKfTcgy1frqfz0aticj31kw05jgol.jpg)
683+
![](https://i.loli.net/2019/07/19/5d313aacddff648185.jpg)
684684

685-
![](https://ws3.sinaimg.cn/large/006tKfTcgy1frqfztzxd8j31kw0iyn0t.jpg)
685+
![](https://i.loli.net/2019/07/19/5d313aada4d3082044.jpg)
686686

687687

688688
# 总结

docs/netty/Netty(2)Thread-model.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://ws1.sinaimg.cn/large/006tNc79gy1fsx42fcwsxj312v0ocjve.jpg)
1+
![](https://i.loli.net/2019/07/19/5d313935e4ef253589.jpg)
22

33
## 前言
44

@@ -49,7 +49,7 @@ while((request = in.readLine()) != null){
4949

5050
### 单线程
5151

52-
![](https://ws4.sinaimg.cn/large/006tNc79gy1fsx4by9581j30k60aygn7.jpg)
52+
![](https://i.loli.net/2019/07/19/5d3139369e57d74023.jpg)
5353

5454
从图中可以看出:
5555

@@ -60,7 +60,7 @@ while((request = in.readLine()) != null){
6060
6161
### 多线程
6262

63-
![](https://ws2.sinaimg.cn/large/006tNc79gy1fsx4cctol0j30k70dq40n.jpg)
63+
![](https://i.loli.net/2019/07/19/5d313937667e941981.jpg)
6464

6565
因此产生了多线程模型。
6666

@@ -76,7 +76,7 @@ while((request = in.readLine()) != null){
7676

7777
### 主从多线程
7878

79-
![](https://ws1.sinaimg.cn/large/006tNc79gy1fsx4iv4kmxj30gb0c0dha.jpg)
79+
![](https://i.loli.net/2019/07/19/5d313937f2dbd55910.jpg)
8080

8181
该模型将客户端连接那一块的线程也改为多线程,称为主线程。
8282

@@ -179,4 +179,4 @@ ServerBootstrap bootstrap = new ServerBootstrap()
179179
[https://github.com/crossoverJie/netty-action](https://github.com/crossoverJie/netty-action)
180180

181181

182-
**欢迎关注公众号一起交流:**
182+
**欢迎关注公众号一起交流:**

docs/netty/cicada.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
<div align="center">
33

4-
<img src="https://ws3.sinaimg.cn/large/006tNbRwly1fxda6k9k3bj30oy08cjsx.jpg" />
4+
<img src="https://i.loli.net/2019/07/19/5d31392e3b7b875245.jpg" />
55
<br/>
66

77
[![Build Status](https://travis-ci.org/crossoverJie/cicada.svg?branch=master)](https://travis-ci.org/crossoverJie/cicada)
@@ -187,7 +187,7 @@ public class KafkaConfiguration extends AbstractCicadaConfiguration {
187187
}
188188
```
189189

190-
![](https://ws3.sinaimg.cn/large/0069RVTdgy1fv5mw7p5nvj31by0fo76t.jpg)
190+
![](https://i.loli.net/2019/07/19/5d31392ece42e20923.jpg)
191191

192192
### 获取配置
193193

@@ -247,7 +247,7 @@ public class ExecuteTimeInterceptor implements CicadaInterceptor {
247247

248248
## 性能测试
249249

250-
![](https://ws4.sinaimg.cn/large/006tNbRwly1fv4luap7w0j31kw0iwdnu.jpg)
250+
![](https://i.loli.net/2019/07/19/5d31392f5efa350999.jpg)
251251

252252
> 测试条件:100 threads and 100 connections ;1G RAM/4 CPU。
253253
@@ -283,9 +283,9 @@ public class ExecuteTimeInterceptor implements CicadaInterceptor {
283283

284284
> crossoverJie#gmail.com
285285
286-
<img src="https://ws2.sinaimg.cn/large/006tKfTcly1fsa01u7ro1j30gs0howfq.jpg" width="300"/>
286+
<img src="https://i.loli.net/2019/07/19/5d3139302977498892.jpg" width="300"/>
287287

288288
## 特别感谢
289289

290290
- [Netty](https://github.com/netty/netty)
291-
- [blade](https://github.com/lets-blade/blade)
291+
- [blade](https://github.com/lets-blade/blade)

0 commit comments

Comments
 (0)