Skip to content
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

bin: use SIGUSR1 to dump metrics. #1071

Merged
merged 2 commits into from Sep 16, 2016
Merged

bin: use SIGUSR1 to dump metrics. #1071

merged 2 commits into from Sep 16, 2016

Conversation

@siddontang
Copy link
Contributor

siddontang commented Sep 16, 2016

Use SIGUSR1 to dump the metrics.

@ngaut @BusyJay @hhkbp2 @overvenus

let metric_familys = prometheus::gather();
let encoder = TextEncoder::new();
encoder.encode(&metric_familys, &mut buffer).unwrap();
info!("{}", String::from_utf8(buffer.clone()).unwrap());

This comment has been minimized.

Copy link
@overvenus

overvenus Sep 16, 2016

Contributor

Why clone() ? How about std::str::from_utf8

This comment has been minimized.

Copy link
@siddontang

siddontang Sep 16, 2016

Author Contributor

Em, I just copy the previous code, will fix it.

for sig in trap {
match sig {
SIGTERM | SIGINT => {
info!("receive signal {}, stopping server...", sig);
ch.send(Msg::Quit).unwrap();
break;
}
SIGUSR1 => {

This comment has been minimized.

Copy link
@overvenus

overvenus Sep 16, 2016

Contributor

Later, we should add some docs for triggering metrics dump.

Copy link
Contributor

overvenus left a comment

LGTM

@ngaut

This comment has been minimized.

Copy link
Member

ngaut commented Sep 16, 2016

LGTM

@siddontang siddontang merged commit 0ef64ee into master Sep 16, 2016
3 checks passed
3 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
@siddontang siddontang deleted the siddontang/dump-metrics branch Sep 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.