Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sober-wang
Copy link

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

Copy link
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.

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

const (
eventMeasurementName = "log/events"
// Event special tags
eventUID = "uid"
// Value Field name
valueField = "value"

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

Choose a reason for hiding this comment

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

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

// getWorkloadName get workload name, deployment is no problem
func getWorkloadName(podName string) string{
s := strings.Split(podName,"-")
n := len(s) - 2
Copy link
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

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.

@@ -28,6 +28,7 @@ import (
influxdb "github.com/influxdata/influxdb/client"
kube_api "k8s.io/api/core/v1"
"k8s.io/klog"
jsoniter "github.com/json-iterator/go"
Copy link
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
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