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

config:write important config into metrics #4206

Merged
merged 9 commits into from Mar 7, 2019

Conversation

Projects
None yet
5 participants
@AndreMouche
Copy link
Member

AndreMouche commented Feb 14, 2019

Signed-off-by: AndreMouche AndreMouche@126.com

What have you changed? (mandatory)

For now, we can only find the parameters of the configuration through the log, which is not friendly.
This PR write some important configurations into metrics to fix the above problem.

What are the type of the changes? (mandatory)

The currently defined types are listed below, please pick one of the types for this PR by removing the others:

  • Improvement (non-breaking change which is an improvement to an existing feature)

How has this PR been tested? (mandatory)

unit tests, integration tests

Does this PR affect documentation (docs) update? (mandatory)

yes, it will change the metrics.

Does this PR affect tidb-ansible update? (mandatory)

yes

Refer to a related PR or issue link (optional)

Benchmark result if necessary (optional)

Add a few positive/negative examples (optional)

@huachaohuang @rleungx

AndreMouche added some commits Feb 14, 2019

config:write important config into metrics
Signed-off-by: AndreMouche <AndreMouche@126.com>
@@ -602,6 +711,19 @@ impl DbConfig {
fn validate(&mut self) -> Result<(), Box<Error>> {
Ok(())
}

fn write_into_metrics(&self) {

This comment has been minimized.

@zhangjinpeng1987

zhangjinpeng1987 Feb 14, 2019

Member

Can we add test for this function?

This comment has been minimized.

@AndreMouche

AndreMouche Feb 15, 2019

Author Member

Seems can't? Any suggestion?

@Connor1996 Connor1996 added the C: Raft label Feb 19, 2019

@huachaohuang

This comment has been minimized.

Copy link
Member

huachaohuang commented Feb 19, 2019

We may change some configurations dynamically, so we need to check and report these configurations periodically.

@AndreMouche

This comment has been minimized.

Copy link
Member Author

AndreMouche commented Feb 19, 2019

Why do the configurations change dynamically? Can you provide some hints? @huachaohuang

@huachaohuang

This comment has been minimized.

Copy link
Member

huachaohuang commented Feb 20, 2019

We provide some debug API to change configurations dynamically now. For example, tidb-lightning can switch TiKV servers into import mode and then switch them back to normal mode dynamically.

AndreMouche added some commits Feb 21, 2019

store/config: add all configurations into metrics
Signed-off-by: AndreMouche <AndreMouche@126.com>
merge master && fix conflicts
Signed-off-by: AndreMouche <AndreMouche@126.com>
address comments
Signed-off-by: AndreMouche <AndreMouche@126.com>
@AndreMouche

This comment has been minimized.

Copy link
Member Author

AndreMouche commented Feb 26, 2019

@rleungx
Copy link
Member

rleungx left a comment

LGTM.

@AndreMouche

This comment has been minimized.

Copy link
Member Author

AndreMouche commented Mar 6, 2019

@Huachao PTAL

@huachaohuang
Copy link
Member

huachaohuang left a comment

LGTM

@@ -162,6 +164,114 @@ macro_rules! cf_config {
};
}

macro_rules! write_into_metrics {
($cf:expr, $tag:expr,$metrics:expr) => {{

This comment has been minimized.

@huachaohuang

huachaohuang Mar 6, 2019

Member
Suggested change
($cf:expr, $tag:expr,$metrics:expr) => {{
($cf:expr, $tag:expr, $metrics:expr) => {{

@AndreMouche AndreMouche merged commit 3f1e577 into tikv:master Mar 7, 2019

2 checks passed

DCO All commits are signed off!
Details
idc-jenkins-ci/test Jenkins job succeeded.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.