-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
all: add force option for metric system #17667
Conversation
21af00a
to
16e4efd
Compare
@rjl493456442 could you please add a short summary on why this is necessary? I understand that this is needed because you want to record I am sure this has been discussed already, but please help me understand as well :) |
16e4efd
to
1c9aaf8
Compare
@nonsense, To be honest, there is no discussion whether should we record the hashrate even the system is enable or not. Currently, our metrics system has a global switch to control all metric instances, but sometimes we not only use metrics library to record some This PR just wants to make our metrics system more flexible. Because the metrcis library allows us to easily record and calculate some necessary system information. May be in the future we need to record some other necessary data in the runtime, so this PR will be helpful :) Do you think it make sense? |
@rjl493456442 sure, it makes sense. I don't have strong feelings about it, so if you find this helpful, I approve. |
Would't it make more sense to add a new set of methods instead? E.g. Instead of This way we would retain the original API, would not introduce a big refactor all over the codebase and future metrics would remain clean as they are now. We'd only need to explicitly tag a couple metrics that are always needed. |
1c9aaf8
to
4048793
Compare
@karalabe I just explicitly tag the There are many different types of metrics( |
db.compReadMeter = metrics.NewRegisteredMeter(prefix+"compact/input", nil) | ||
db.compWriteMeter = metrics.NewRegisteredMeter(prefix+"compact/output", nil) | ||
db.diskReadMeter = metrics.NewRegisteredMeter(prefix+"disk/read", nil) | ||
db.diskWriteMeter = metrics.NewRegisteredMeter(prefix+"disk/write", nil) | ||
db.writeDelayMeter = metrics.NewRegisteredMeter(prefix+"compact/writedelay/duration", nil) | ||
db.writeDelayNMeter = metrics.NewRegisteredMeter(prefix+"compact/writedelay/counter", nil) |
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.
Don't we need Forced here?
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.
LGTM
fix #17601