-
Notifications
You must be signed in to change notification settings - Fork 4
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 principal cache memory usage #42
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
1cf5e27
to
a10d2fa
Compare
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
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.
metrics.goに追加した関数に関するテストも追加をお願いします
service/metrics.go
Outdated
|
||
// Collect is implementation of prometheus.Collector.Collect | ||
func (m *metrics) Collect(ch chan<- prometheus.Metric) { | ||
// m.mutex.RLock() |
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.
ここは必要ですか?
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.
fix: d0c67da
service/metrics.go
Outdated
for _, opt := range opts { | ||
opt(m) | ||
} | ||
|
||
err := prometheus.Register(m.httpOriginLatency) | ||
if err != nil { | ||
return nil, errors.Wrap(err, "cannot register metrics") |
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.
なんのメトリクスの登録に失敗したかわかるようにしてください
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.
fix: d0c67da
service/metrics.go
Outdated
err := prometheus.Register(m.httpOriginLatency) | ||
if err != nil { | ||
return nil, errors.Wrap(err, "cannot register metrics") | ||
} | ||
|
||
err = prometheus.Register(m) | ||
if err != nil { | ||
return nil, errors.Wrap(err, "cannot register metrics") |
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.
同上
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.
fix: d0c67da
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
92aec89 で追加 |
Signed-off-by: fum1h1to <75571344+fum1h1to@users.noreply.github.com>
Description
Add memoryUsage for principal cache
Type of change
Flags
Related issue/PR
Delete this section if there are no issues or pull requests that relate to this pull request.
Checklist
[skip ci]
/[ci skip]
/[no ci]
/[skip actions]
/[actions skip]
in the PR title if necessaryChecklist for maintainer
Squash and merge
[skip ci]
/[ci skip]
/[no ci]
/[skip actions]
/[actions skip]