Add support for dataset,runtime,webhook pprof#985
Add support for dataset,runtime,webhook pprof#985cheyang merged 1 commit intofluid-cloudnative:masterfrom
Conversation
|
Thanks very much for your great contributions. If you'd like to add documentation, it will be great! |
|
I think you can make nodeport configurable and the default port could be 50000. Could you rebase you code so that it can fix the CI. Thanks. |
3db5999 to
8d9bac0
Compare
Codecov Report
@@ Coverage Diff @@
## master #985 +/- ##
==========================================
+ Coverage 70.48% 70.50% +0.01%
==========================================
Files 221 222 +1
Lines 12122 12146 +24
==========================================
+ Hits 8544 8563 +19
- Misses 2659 2662 +3
- Partials 919 921 +2
Continue to review full report at Codecov.
|
I have fixed nodeport and passed the CI. |
yangyuliufeng
left a comment
There was a problem hiding this comment.
I have tested this pr and found no problems.
I suggest changing the naming of some files such as the svc name.
Also, I'm worried that it's unsafe to expose program indicators through HTTP.
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: fluid-pod-alluxioruntime-controller |
There was a problem hiding this comment.
It's not suitable to be 'fluid-pod-alluxioruntime-controller', how about 'fluid-alluxioruntime-controller-ststic'
charts/fluid/fluid/values.yaml
Outdated
| statistics: | ||
| enabled: false | ||
| nodePort: 50002 |
There was a problem hiding this comment.
I think it's better to put it in runtime.controllerStatistics, not three pieces.
我觉得统一写一个runtime.controllerStatistics比较好,不要分三块
@yangyuliufeng @cheyang I cannot decide where tls crt and key should be.
But my plan has a problem: it cannot execute certificate.sh and create secret automatically when helm install. |
| @@ -0,0 +1,16 @@ | |||
| {{ if .Values.dataset.controller.statistics.enabled -}} | |||
There was a problem hiding this comment.
Maybe the service is not necessary. I think we can connect to ip address of pod directly.
cmd/alluxio/main.go
Outdated
| "net/http" | ||
| "os" | ||
|
|
||
| "github.com/arl/statsviz" |
There was a problem hiding this comment.
How about using "net/http/pprof" ? Kubernetes is also using this. And we can avoid importing new package.
There was a problem hiding this comment.
Thanks very much for your good advice. I will use pprof to implement it.
Thank you for your contribution! My suggestion is that if we can leverage the implementation in Kubernetes. Btw, is it enabled by default? https://github.com/kubernetes/kubernetes/blob/ea0764452222146c47ec826977f49d7001b0ea8c/staging/src/k8s.io/apiserver/pkg/server/routes/profiling.go#L30 |
I think service to expose is not necessary for debugging. |
|
@wangyanghack could you refer to https://github.com/banzaicloud/logging-operator/blob/master/main.go#L122-L129? thanks in advance! |
e6315e1 to
209a813
Compare
Thank you very much for your careful guidance and patience. |
|
@cheyang please take a moment to review my code. I will apologize in advance if it is not still satisfied with you again. Thanks a lot. |
|
@wangyanghack Please fix the conflict, thanks. |
733278d to
368bdaf
Compare
cmd/alluxio/main.go
Outdated
| })) | ||
|
|
||
| if pprofAddr != "" { | ||
| glog.Infof("Enabling pprof with address %s", pprofAddr) |
There was a problem hiding this comment.
Can we use the same log system in the controller. I suggest not to use glog here rahter than github.com/go-logr/logr.
cmd/dataset/main.go
Outdated
| } | ||
| })) | ||
|
|
||
| if pprofAddr != "" { |
There was a problem hiding this comment.
How about to create a common function to launch pprof? This piece of code has been repeated several times. Just a suggestion, WDYT?
There was a problem hiding this comment.
yes, I will create a common function now
| @@ -0,0 +1,47 @@ | |||
| package utils | |||
There was a problem hiding this comment.
Please add license header. Thanks.
pkg/utils/pprof.go
Outdated
| Addr: pprofAddr, | ||
| Handler: mux, | ||
| } | ||
| glog.Infof("Starting pprof HTTP server at %s", pprofServer.Addr) |
There was a problem hiding this comment.
Please use logr instead of glog. Thanks.
xieydd
left a comment
There was a problem hiding this comment.
@wangyanghack We can add test for new func to improve the diff hit of codecov, thanks.
acc6f84 to
6e33863
Compare
Signed-off-by: 汪洋 <1264017613@qq.com>
Ⅰ. Describe what this PR does
add instant live visualization of statistics for performance analysis
Ⅱ. Does this pull request fix one issue?
fixes #780
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
I cannot decide on nodeport number. please give me some advice. thanks.