-
Notifications
You must be signed in to change notification settings - Fork 78
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
add metrics for indexer and sidecar #642
add metrics for indexer and sidecar #642
Conversation
Best reviewed: commit by commit
Optimal code review plan
|
[CHATOPS:HELP] ChatOps commands.
|
Codecov Report
@@ Coverage Diff @@
## master #642 +/- ##
==========================================
- Coverage 15.48% 15.25% -0.24%
==========================================
Files 412 411 -1
Lines 21598 21578 -20
==========================================
- Hits 3344 3291 -53
- Misses 18000 18036 +36
+ Partials 254 251 -3
Continue to review full report at Codecov.
|
|
||
func (i *indexerMetrics) View() []*metrics.View { | ||
return []*metrics.View{ | ||
&metrics.View{ |
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.
[golangci] reported by reviewdog 🐶
File is not gofmt
-ed with -s
(gofmt)
@@ -392,8 +394,27 @@ func (o *observer) requestBackup(ctx context.Context) error { | |||
return nil | |||
} | |||
|
|||
func (o *observer) backup(ctx context.Context) error { | |||
func (o *observer) backup(ctx context.Context) (err error) { |
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.
[golangci] reported by reviewdog 🐶
Function 'backup' has too many statements (42 > 40) (funlen)
@@ -392,8 +394,27 @@ func (o *observer) requestBackup(ctx context.Context) error { | |||
return nil | |||
} | |||
|
|||
func (o *observer) backup(ctx context.Context) error { | |||
func (o *observer) backup(ctx context.Context) (err error) { |
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.
[golangci] reported by reviewdog 🐶
cognitive complexity 53 of func (*observer).backup
is high (> 30) (gocognit)
@@ -40,7 +40,90 @@ var ( | |||
LastValue = view.LastValue | |||
Sum = view.Sum | |||
|
|||
DefaultMillisecondsDistribution = Distribution(0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000) | |||
DefaultMillisecondsDistribution = Distribution( |
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.
[golangci] reported by reviewdog 🐶
DefaultMillisecondsDistribution
is a global variable (gochecknoglobals)
50000, | ||
100000, | ||
) | ||
RoughMillisecondsDistribution = Distribution( |
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.
[golangci] reported by reviewdog 🐶
RoughMillisecondsDistribution
is a global variable (gochecknoglobals)
@@ -40,7 +40,90 @@ var ( | |||
LastValue = view.LastValue | |||
Sum = view.Sum | |||
|
|||
DefaultMillisecondsDistribution = Distribution(0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000) | |||
DefaultMillisecondsDistribution = Distribution( | |||
0.01, |
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.
[golangci] reported by reviewdog 🐶
mnd: Magic number: 0.01, in detected (gomnd)
} | ||
|
||
return []*metrics.View{ | ||
&metrics.View{ |
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.
[golangci] reported by reviewdog 🐶
File is not gofmt
-ed with -s
(gofmt)
/rebase |
[REBASE] Rebase triggered by rinx for branch: feature/observability/add-metrics-for-indexer-and-sidecar |
e1c34ee
to
6bfcf6b
Compare
[FORMAT] Updating license headers and formatting go codes triggered by rinx. |
/rebase |
[REBASE] Rebase triggered by kpango for branch: feature/observability/add-metrics-for-indexer-and-sidecar |
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
6bfcf6b
to
778656f
Compare
[FORMAT] Updating license headers and formatting go codes triggered by kpango. |
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.
[APPROVED] This PR is approved by kpango.
ms []metrics.MeasurementWithTags | ||
} | ||
|
||
type MetricsHook interface { |
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.
[golangci] reported by reviewdog 🐶
exported type MetricsHook
should have comment or be unexported (golint)
observer.Hook | ||
} | ||
|
||
func New() (MetricsHook, error) { |
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.
[golangci] reported by reviewdog 🐶
exported function New
should have comment or be unexported (golint)
sm.ms = append( | ||
sm.ms, | ||
metrics.MeasurementWithTags{ | ||
Measurement: sm.uploadTotal.M(1), |
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.
[golangci] reported by reviewdog 🐶
mnd: Magic number: 1, in detected (gomnd)
Description:
Added new metrics for indexer and sidecar.
Related Issue:
#343
How Has This Been Tested?:
nothing.
Environment:
Types of changes:
Changes to Core Features:
Checklist: