Skip to content

Commit 5b6a76c

Browse files
committed
docs: 📝 更新文档中的图片链接和内容
1 parent fd1630e commit 5b6a76c

5 files changed

Lines changed: 44 additions & 6 deletions

File tree

81.4 KB
Loading

docs/贡献文档/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
## 如何联系我们:
22

3-
43
[EzStars团队](https://ezstars.github.io/EzMonitor/about.html)
54

65
## PR提交规范
@@ -9,4 +8,6 @@
98
pnpm run commit
109
```
1110

12-
![image.png](https://p0-xtjj-private.juejin.cn/tos-cn-i-73owjymdk6/273fcc171649452eb7dd23b856397e7e~tplv-73owjymdk6-jj-mark-v1:0:0:0:0:5o6Y6YeR5oqA5pyv56S-5Yy6IEAgTmkwZHVhbm4=:q75.awebp?policy=eyJ2bSI6MywidWlkIjoiMzYzMTAyMzcwNjg2NTg5MiJ9&rk3s=e9ecf3d6&x-orig-authkey=f32326d3454f2ac7e96d3d06cdbb035152127018&x-orig-expires=1745380306&x-orig-sign=2wUxsLHZo9hA17516cNVbVWqJ78%3D)
11+
12+
13+
![image-20250506215436489](img/image-20250506215436489.png)

packages/monitor-sdk/src/plugins/behavior/behaviorStore.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ export interface behaviorRecordsOptions {
22
maxBehaviorRecords: number;
33
}
44

5+
/**
6+
* 行为记录的格式
7+
* @param name 行为名称
8+
* @param page 页面名称
9+
* @param timestamp 时间戳
10+
* @param value 行为参数
11+
*/
512
export interface behaviorStack {
613
name: string;
714
page: string;
@@ -27,7 +34,7 @@ export default class BehaviorStore {
2734
// 从底部插入一个元素,且不超过 maxBehaviorRecords 限制数量
2835
push(value: behaviorStack) {
2936
if (this.length() === this.maxBehaviorRecords) {
30-
this.shift();
37+
this.shift(); // 超过最大数量,删除第一个元素
3138
}
3239
this.state.push(value);
3340
}

packages/monitor-sdk/src/plugins/behavior/index.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,26 @@ import {
1717
} from '../../types';
1818
import BehaviorStore from './behaviorStore';
1919
import { proxyHash, proxyHistory, wrHistory } from './utils';
20-
20+
/**
21+
* 行为追踪
22+
*/
2123
export class Behavior {
2224
// 本地暂存数据在 Map 里 (也可以自己用对象来存储)
2325
public metrics: any;
2426

27+
// 行为追踪记录
2528
public breadcrumbs: any;
2629

30+
// 自定义埋点的信息一般立即上报
2731
public customHandler!: Function;
2832

2933
// 最大行为追踪记录数
3034
public maxBehaviorRecords!: number;
3135

3236
// 允许捕获click事件的DOM标签 eg:button div img canvas
3337
public clickMountList!: Array<string>;
38+
39+
// 初始化单例模式
3440
static instance: any;
3541

3642
constructor() {
@@ -57,7 +63,10 @@ export class Behavior {
5763
Behavior.instance = this;
5864
}
5965

60-
// 初始化用户自定义埋点数据的获取上报
66+
/**
67+
* 初始化用户自定义埋点数据的获取上报
68+
* @param reportData 自定义埋点数据
69+
*/
6170
initCustomerHandler = (): Function => {
6271
const handler = (reportData: customAnalyticsData) => {
6372
// 自定义埋点的信息一般立即上报

packages/monitor-sdk/src/types/index.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ export type PerformanceResourceType = commonType & {
120120
pageUrl: string;
121121
};
122122

123+
/**
124+
* 错误信息
125+
* @param errId 错误id
126+
* @param state 错误状态
127+
* @param timestamp 错误时间
128+
*/
123129
export type ErrorCommonType = {
124130
errId: string;
125131
state: any[];
@@ -133,6 +139,18 @@ export type ResourceErrorTarget = {
133139
outerHTML?: string;
134140
};
135141

142+
/**
143+
* 资源错误信息
144+
* @param message 错误信息
145+
* @param src 资源路径
146+
* @param lineNo 错误行号
147+
* @param columnNo 错误列号
148+
* @param stack 错误堆栈
149+
* @param pageUrl 页面路径
150+
* @param tagName 标签名
151+
* @param html 错误信息
152+
* @param path 节点的dom位置
153+
*/
136154
export type ResourceErrorType = commonType &
137155
ErrorCommonType & {
138156
message: string | Event; // 错误信息
@@ -199,7 +217,10 @@ export type PageInformation = {
199217
pageLoadType: string;
200218
};
201219

202-
// 这里参考了 谷歌GA 的自定义埋点上报数据维度结构
220+
/**
221+
* 自定义埋点上报数据维度结构
222+
* 这里参考了 谷歌GA 的自定义埋点上报数据维度结构
223+
*/
203224
export type customAnalyticsData = commonType & {
204225
// 埋点key
205226
eventKey: string;

0 commit comments

Comments
 (0)