forked from tikv/tikv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snap_recovery: added some metrics (tikv#15111)
close tikv#15110 Signed-off-by: hillium <yujuncen@pingcap.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9bb7bd6
commit 456c857
Showing
6 changed files
with
81 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2022 TiKV Project Authors. Licensed under Apache-2.0. | ||
|
||
use lazy_static::*; | ||
use prometheus::*; | ||
use prometheus_static_metric::*; | ||
|
||
lazy_static! { | ||
pub static ref REGION_EVENT_COUNTER: RegionEvent = register_static_int_counter_vec!( | ||
RegionEvent, | ||
"tikv_snap_restore_region_event", | ||
"the total count of some events that each happened to one region. (But the counter counts all regions' events.)", | ||
&["event"] | ||
) | ||
.unwrap(); | ||
|
||
// NOTE: should we handle the concurrent case by adding a tid parameter? | ||
pub static ref CURRENT_WAIT_APPLY_LEADER: IntGauge = register_int_gauge!( | ||
"tikv_current_waiting_leader_apply", | ||
"the current leader we are awaiting." | ||
).unwrap(); | ||
|
||
pub static ref CURRENT_WAIT_ELECTION_LEADER : IntGauge = register_int_gauge!( | ||
"tikv_current_waiting_leader_election", | ||
"the current leader we are awaiting." | ||
).unwrap(); | ||
|
||
} | ||
|
||
make_static_metric! { | ||
pub label_enum RegionEventType { | ||
collect_meta, | ||
promote_to_leader, | ||
keep_follower, | ||
start_wait_leader_apply, | ||
finish_wait_leader_apply, | ||
} | ||
|
||
pub struct RegionEvent : IntCounter { | ||
"event" => RegionEventType, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters