Skip to content

Conversation

@masarasi
Copy link
Contributor

@masarasi masarasi commented Apr 7, 2022

ログインしているユーザが 0 の場合に linux.users メトリックに 0 が投稿されない問題の修正です。

ログインしているユーザが 0 の場合 (*p)["users"] = 0 で 0 を代入していますが、最後にメトリックを出力する以下の処理で int 型に対応しておらずメトリックが投稿されないため、float64 で代入しています。

https://github.com/mackerelio/go-mackerel-plugin-helper/blob/3d9512468e0b00efe5bc2189eead8b4275fd8e9d/mackerel-plugin.go#L87

@masarasi masarasi added the bug label Apr 7, 2022
@ne-sachirou ne-sachirou self-requested a review April 8, 2022 05:46
@ne-sachirou ne-sachirou self-assigned this Apr 8, 2022
@ne-sachirou
Copy link
Member

これでも build 通ったんですねぇ。
🙆‍♀️

@ne-sachirou ne-sachirou merged commit f374608 into master Apr 8, 2022
@ne-sachirou ne-sachirou deleted the fix-zero_not_posted_to_users_metric branch April 8, 2022 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants