Comments (4)
张玉哲:
系统可能下发多个指标,且每个指标的时间可能不一致,这就给管理带来了困难
我的想法是:把所有的指标抽象成一个类,每个单独的指标就是一个实例化
指标的执行就是一个该类的一个方法,每次下发指标到最后就交给一个对象来负责
方便处理了多指标时间不一致的问题
关于该指标类的思考,首先是成员,我觉得应该一个单独是的string,
代表要操作的python文件;执行指标的方法,可以写成一个使用一个go func()
来创建一个进程执行python,通过一个通道返回给主方法该进程的pid,主方法根据参数
设置定时器,定时器就是指标执行的时间,时间到,kill掉python进程
一个系统中一个指标只会有一个对象,这里使用单例模式来创建指标对象。
from lmp.
赵晨雨:
@张玉哲感觉是可行的,你是想避免全局类频繁创建吗,但是感觉你用这个大类一直在实例化新的对象,这个不是单例模式吧,单例模式不是只创建自己唯一的实例么,也可能是我理解有问题,最好画一个类图,看着会好一点,然后咱们再看。
from lmp.
张玉哲:
@赵晨雨(赵晨雨) 师兄,这里我把那个单例和享元搞混了,应该是享元模式。把每个指标的对象实例化之后,就保存下来。
from lmp.
赵晨雨:
@张玉哲 那这个就回到我们之前做项目的时候遇到的问题了,就是有没有必要上这个,享元模式是因为对象创建太多占内存导致性能下降了,但是我们的目前的场景下不会创建很多的类,这个是ebpf本身性能开销决定的。也就是ebpf的性能开销和go层创建对象的性能开销的对比。这个发到群里大家讨论下吧。
from lmp.
Related Issues (20)
- Process_image 项目:目标是开发一个Linux用户态进程生命周期画像工具 HOT 3
- Stack_Analyzer项目:基于eBPF的调用栈统计工具 HOT 6
- 使用eBPF优化FUSE read方法性能
- net_watcher项目:基于eBPF的无侵入式网络分析工具开发建设
- net_manager 项目:对 linux 内核网络进行优化和加速 HOT 2
- fast_fuse项目:使用eBPF优化FUSE read/write 等方法性能 HOT 4
- mem_watcher 项目:目标是分析主机中指定进程或者服务内存使用情况 HOT 1
- cpu_watcher 项目:目标是分析cpu 的运行状态 HOT 4
- kvm_watcher 项目:目标是分析 kvm 的状态信息 HOT 15
- cilium_ebpf_probe 代码编译需要修复
- sidecar 代码编译需要修复
- [BUG]get_loadavg.py中报错 HOT 2
- eBPF DNS Cache HOT 4
- BCC_sar下的各个功能整合到 cpu_watcher:
- fs_watcher项目:目标是检测文件系统的性能指标 HOT 10
- [BUG]get_loadavg HOT 1
- c++符号解析支持
- MagicEyes:Linux内核观测与诊断工具框架
- [BUG] compile eBPF_proc_image error HOT 1
- [BUG]ebpf_cpu_watcher.yml 流水线文件有语法错误,执行有问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lmp.