Skip to content

feat: When kube-eventer write data into InfluxDB will become more detial#87

Open
sober-wang wants to merge 3 commits into
AliyunContainerService:masterfrom
sober-wang:master
Open

feat: When kube-eventer write data into InfluxDB will become more detial#87
sober-wang wants to merge 3 commits into
AliyunContainerService:masterfrom
sober-wang:master

Conversation

@sober-wang
Copy link
Copy Markdown

When kube-eventer write data into InfluxDB will become more detial

Copy link
Copy Markdown
Contributor

@zeusro zeusro left a comment

Choose a reason for hiding this comment

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

还有,尽量附上测试用例和实际运行结果。

Comment thread sinks/influxdb/influxdb.go Outdated
// Value Field name
valueField = "value"

/* ---------------------------------*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

不要有多余的注释。下同。

Comment thread sinks/influxdb/influxdb.go Outdated
// getWorkloadName get workload name, deployment is no problem
func getWorkloadName(podName string) string{
s := strings.Split(podName,"-")
n := len(s) - 2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s,n 变量命名不是很规范。

@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 10, 2020

Codecov Report

Merging #87 into master will increase coverage by 1.56%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   52.12%   53.69%   +1.56%     
==========================================
  Files          24       24              
  Lines        1483     1516      +33     
==========================================
+ Hits          773      814      +41     
+ Misses        645      634      -11     
- Partials       65       68       +3     
Impacted Files Coverage Δ
sinks/influxdb/influxdb.go 59.00% <88.88%> (+16.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 203b91e...040c22a. Read the comment docs.

influxdb "github.com/influxdata/influxdb/client"
kube_api "k8s.io/api/core/v1"
"k8s.io/klog"
jsoniter "github.com/json-iterator/go"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you remove external libs. json.Unmarshal should be enough

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I know. But the jsoniter handle JSON become so convenient , and the jsoniter is very quickly.
You can see the web pages:
https://github.com/json-iterator/go

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.

4 participants