private static MonitorConfig newConfig ( Class < ? > c , String defaultName , String id , com . netflix . servo . annotations . Monitor anno , TagList tags ) { String name = anno . name ( ) ; if ( name . isEmpty ( ) ) { name = defaultName ; } MonitorConfig . Builder builder = MonitorConfig . builder ( name ) ; builder . withTag ( "class" , className ( c ) ) ; builder . withTag ( anno . type ( ) ) ; builder . withTag ( anno . level ( ) ) ; if ( tags != null ) { builder . withTags ( tags ) ; } if ( id != null ) { builder . withTag ( "id" , id ) ; } return builder . build ( ) ; }
Creates a monitor config based on an annotation .