File tree Expand file tree Collapse file tree 3 files changed +8
-20
lines changed Expand file tree Collapse file tree 3 files changed +8
-20
lines changed Original file line number Diff line number Diff line change @@ -70,3 +70,11 @@ harness = false
7070[[bench ]]
7171name = " text_encoder"
7272harness = false
73+
74+ [[example ]]
75+ name = " example_push"
76+ required-features = [" push" ]
77+
78+ [[example ]]
79+ name = " example_process_collector"
80+ required-features = [" process" ]
Original file line number Diff line number Diff line change 11// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
22
3- #[ cfg( all( feature = "process" , target_os = "linux" ) ) ]
43fn main ( ) {
54 use std:: thread;
65 use std:: time:: Duration ;
@@ -21,11 +20,3 @@ fn main() {
2120 thread:: sleep ( Duration :: from_secs ( 1 ) ) ;
2221 }
2322}
24-
25- #[ cfg( any( not( feature = "process" ) , not( target_os = "linux" ) ) ) ]
26- fn main ( ) {
27- println ! (
28- r#"Please enable feature "process", try:
29- cargo run --features="process" --example example_process_collector"#
30- ) ;
31- }
Original file line number Diff line number Diff line change 11// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
22
3- #![ cfg_attr( not( feature = "push" ) , allow( unused_imports, dead_code) ) ]
4-
53use std:: env;
64use std:: thread;
75use std:: time;
@@ -25,7 +23,6 @@ lazy_static! {
2523 . unwrap( ) ;
2624}
2725
28- #[ cfg( feature = "push" ) ]
2926fn main ( ) {
3027 let args: Vec < String > = env:: args ( ) . collect ( ) ;
3128 let program = args[ 0 ] . clone ( ) ;
@@ -68,11 +65,3 @@ fn main() {
6865
6966 println ! ( "Okay, please check the Pushgateway." ) ;
7067}
71-
72- #[ cfg( not( feature = "push" ) ) ]
73- fn main ( ) {
74- println ! (
75- r#"Please enable feature "push", try:
76- cargo run --features="push" --example example_push"#
77- ) ;
78- }
You can’t perform that action at this time.
0 commit comments