-
Notifications
You must be signed in to change notification settings - Fork 277
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有,尽量附上测试用例和实际运行结果。
sinks/influxdb/influxdb.go
Outdated
const ( | ||
eventMeasurementName = "log/events" | ||
// Event special tags | ||
eventUID = "uid" | ||
// Value Field name | ||
valueField = "value" | ||
|
||
/* ---------------------------------*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要有多余的注释。下同。
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s,n 变量命名不是很规范。
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@@ -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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
When kube-eventer write data into InfluxDB will become more detial