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

server: precreate some labal metrics #2765

Merged
merged 6 commits into from Mar 1, 2018

Conversation

Projects
None yet
6 participants
@july2993
Copy link
Contributor

commented Feb 23, 2018

for some frequently use metrics, we can pre create the Metric for later use, this avoid with_label_values() every time, but maybe needless here...it help little

@sre-bot

This comment has been minimized.

Copy link
Collaborator

commented Feb 23, 2018

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

@siddontang

This comment has been minimized.

Copy link
Contributor

commented Feb 23, 2018

Thank you very much. @july2993

This reduces the hash and lock operations, it is useful. :-)

@siddontang

This comment has been minimized.

Copy link
Contributor

commented Feb 23, 2018

mvcc_get_by_key: Histogram,
mvcc_get_by_start_ts: Histogram,
split_region: Histogram,
}

This comment has been minimized.

Copy link
@disksing

disksing Feb 24, 2018

Collaborator

Why not use HashMap<&str, Histogram>?

This comment has been minimized.

Copy link
@siddontang

siddontang Feb 24, 2018

Contributor

maybe using fields is faster and more certain than HashMap.

This comment has been minimized.

Copy link
@july2993

july2993 Feb 24, 2018

Author Contributor

and here if using HashMap, we still need to init it one by one, and no need to create some metrics dynamic, so i use fields

@breeswish

This comment has been minimized.

Copy link
Member

commented Feb 24, 2018

Can we use LocalXxxVec here?

@siddontang

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2018

Can we use LocalXxxVec here

No, now we have no way to flush the local metrics here.

@disksing

This comment has been minimized.

Copy link
Collaborator

commented Feb 26, 2018

LGTM.

@siddontang
Copy link
Contributor

left a comment

LGTM

@breeswish

This comment has been minimized.

Copy link
Member

commented Feb 26, 2018

/run-all-tests

@breeswish

This comment has been minimized.

Copy link
Member

commented Feb 26, 2018

/ok-to-test

@breeswish

This comment has been minimized.

Copy link
Member

commented Feb 26, 2018

Amazing! I just benchmarked your PR and observed a ~7% performance improvement for raw kv commands 🎉 Please resolve conflicts

@siddontang

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2018

Thank @july2993

There are still some MetricVectors in our codes, it is very appreciated that you can help us improve them.

@july2993

This comment has been minimized.

Copy link
Contributor Author

commented Feb 26, 2018

@breeswish , thanks for the benchmark. well...this much better than my expect, wonder about the benchmark detail. maybe i will take a more look later.

@july2993

This comment has been minimized.

Copy link
Contributor Author

commented Feb 26, 2018

@siddontang, at a first look, the GRPC_MSG_FAIL_COUNTER.with_label_values in kv.rs can be avoid easyly too, but i think it will seldomly reach the code in a stable cluster(maybe except the kv_commit api), so i did not change it first when i do this pr.
another is the KV_COMMAND_COUNTER_VEC.with_label_values in storage/mod.rs, one rpc one call.

@siddontang
Copy link
Contributor

left a comment

LGTM

@siddontang

This comment has been minimized.

Copy link
Contributor

commented Feb 27, 2018

/ok-to-test

@breeswish

This comment has been minimized.

Copy link
Member

commented Feb 27, 2018

/run-all-tests

@breeswish

This comment has been minimized.

Copy link
Member

commented Feb 27, 2018

/run-unit-test

@breeswish

This comment has been minimized.

Copy link
Member

commented Feb 28, 2018

@disksing there are "endpoint read failed" in jenkins unit test. Could you take a look?

@disksing

This comment has been minimized.

Copy link
Collaborator

commented Feb 28, 2018

@breeswish I'm sorry I have no clue... @overvenus @BusyJay would you want to lend a hand?

@BusyJay

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2018

@hicqu PTAL

siddontang added some commits Mar 1, 2018

@breeswish

This comment has been minimized.

Copy link
Member

commented Mar 1, 2018

LGTM

@breeswish breeswish merged commit 50a14ca into tikv:master Mar 1, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
jenkins-ci-tikv/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
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.