Skip to content

Commit

Permalink
chore(doc): update description for kitex practice (cloudwego#988)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangmingLuo authored Mar 1, 2024
1 parent 29816d9 commit 0962405
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: "集成测试"
linkTitle: "集成测试"
weight: 5
date: 2024-02-18
description: >
description: "介绍如何 mock client 调用以及高效 debug 思路。"
---

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ title: "高效 Debug"
linkTitle: "高效 Debug"
weight: 2
date: 2024-02-18
description: 通过模仿真实错误示例,描述不同现象背后可能是什么样的原因类型,并提供分析原因的方法。

description: "通过模仿真实错误示例,描述不同现象背后可能是什么样的原因类型,并提供分析原因的方法。"
---

## 排查 Panic 原因
Expand Down Expand Up @@ -585,4 +584,4 @@ func AddSSH(data *SSHData) {
该函数理论上,对于每一个 UserId,会在 Map 里存储 6 字节的对象。而由于 main 函数每秒会调用 `AddSSH` 1000 次,即每秒泄漏 6KB 的内存。即便如此,我们就算程序运行一小时,也无非泄漏 6 * 60 * 60 = 21600KB = 21MB 的数据,不至于一分钟内就泄漏了 60MB。
但如果再进一步去细看 `append` 函数的细节,我们会发现它最终返回的那个切片对象,底层数组的引用,依然还是原始 `randBytes` 函数所创建的那个,而切片的部分引用,依然会导致原始对象不能够被完全释放。
但如果再进一步去细看 `append` 函数的细节,我们会发现它最终返回的那个切片对象,底层数组的引用,依然还是原始 `randBytes` 函数所创建的那个,而切片的部分引用,依然会导致原始对象不能够被完全释放。
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ title: "如何 Mock Client 调用"
linkTitle: "如何 Mock Client 调用"
weight: 1
date: 2024-02-18
description: >
description: "介绍如何结合 go mock 来 mock 一个 client 作为桩对象。"
---

## 介绍
Expand Down Expand Up @@ -65,4 +64,4 @@ func TestClient(t *testing.T) {

如果不想使用 go mock,或者希望验证 client 的其他能力(例如 tracing),也可以在 NewClient 时指定自定义中间件,按需构造数据。

注意:Kitex Client 内置的中间件都会被执行。
注意:Kitex Client 内置的中间件都会被执行。
3 changes: 1 addition & 2 deletions content/zh/docs/kitex/Best Practice/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ title: "最佳实践"
linkTitle: "最佳实践"
weight: 5
date: 2024-02-18
description: >
description: "Kitex 在生产环境下的最佳实践。"
---
3 changes: 1 addition & 2 deletions content/zh/docs/kitex/Best Practice/error_handle.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ linkTitle: "错误处理"
weight: 3
date: 2024-02-18
keywords: ["RPC 异常", "业务异常", "最佳实践"]
description: 除了框架默认提供的 RPC 异常,Kitex 还提供了业务异常供用户设置,本文主要介绍 RPC 异常与业务异常的最佳实践。

description: "除了框架默认提供的 RPC 异常,Kitex 还提供了业务异常供用户设置,本文主要介绍 RPC 异常与业务异常的最佳实践。"
---

## 概念说明
Expand Down
2 changes: 1 addition & 1 deletion content/zh/docs/kitex/Best Practice/graceful_shutdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ linkTitle: "优雅停机"
date: 2024-02-18
weight: 2
keywords: ["优雅停机", "Kubernetes", "最佳实践"]
description: "以 K8s 部署平台为例,介绍如何基于 K8s 的原理以及 Kitex 的优雅停机功能,搭建一个具备优雅停机的服务架构"
description: "以 K8s 部署平台为例,介绍如何基于 K8s 的原理以及 Kitex 的优雅停机功能,搭建一个具备优雅停机的服务架构"
---

## 背景
Expand Down
3 changes: 1 addition & 2 deletions content/zh/docs/kitex/Best Practice/usage_attention.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ linkTitle: "使用注意事项"
weight: 1
date: 2024-02-18
keywords: ["Kitex", "RPCInfo", "client", "Set", "Map"]
description: >
description: "介绍 Kitex RPCInfo、client 创建、大量数据传输场景下的注意事项。"
---

## 勿异步使用 RPCInfo
Expand Down

0 comments on commit 0962405

Please sign in to comment.