Skip to content

feat: add pm2 component list metrics#23

Merged
wangshijun merged 14 commits intomainfrom
feat-app-manager
Jan 13, 2026
Merged

feat: add pm2 component list metrics#23
wangshijun merged 14 commits intomainfrom
feat-app-manager

Conversation

@skypesky
Copy link

@skypesky skypesky commented Jan 10, 2026

关联 Issue

主要改动

界面截图

  • 在 grafana 目前实现了一个看板,可以链接直达每台机器的每个应用的更新地址(可以看到每个组件的版本),这个应该能节省不少时间。(不用手动找机器,不需要搜索应用,就可以链接到应用的更新页面,手动更新应用了)
image

测试计划

检查清单

  • ok


// Collect component list for each app
metricAppComponentList?.reset();
pAll(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里感觉效率不行,只有当某个进程变动之后才有重新获取的必要,不然每次都重复执行,拿到相同的结果,对于监控模块来说,太浪费了

Copy link
Author

@skypesky skypesky Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论: 不需要改
原因: 进程不变动不代表组件的版本也没有变化,不代表 3 大 store 的版本没有变化。这一层是不能缓存的,原因是组件的版本随时都可能发生变化(它的获取只是读取环境变量,非常高效,遍历的变量也是早就有的),3 大 store 的版本也可能发生变化(而它已经被缓存了,缓存时长为 5 min)。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缓存时长调整为小时级别即可,不需要那么快就失效,另外这里的请求有没有对组件做去重呢?内存消耗会增加多少?

Copy link
Author

@skypesky skypesky Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缓存时长 1h 感觉有点太长了,更新完成之后估计也要很久才知道 3 大 store 有没有更新好,要不改成 10 min 怎么样。内存消耗增加不明显,内存是波动的。我对比了一下,增加了 4 m 左右这样,但是我用 keyv.js 都没有缓存多少条目,估计只是波动引起的。

  • 更新前内存
image
  • 更新后内存
dec85bd8bf300f931f086e12909f90b6

@skypesky skypesky requested a review from wangshijun January 12, 2026 05:05
@wangshijun wangshijun merged commit 18101f3 into main Jan 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants