question: protected static String createCounterName ( String switchID , int portID , String counterName , String subCategory , NetworkLayer layer ) { String fullCounterName = "" ; String groupCounterName = "" ; if ( portID < 0 ) { groupCounterName = switchID + TitleDelimitor + counterName ; fullCounterName = groupCounterName + TitleDelimitor + subCategory ; } else { groupCounterName = switchID + TitleDelimitor + portID + TitleDelimitor + counterName ; fullCounterName = groupCounterName + TitleDelimitor + subCategory ; } Map < String , List < String > > counterToCategories ; if ( layeredCategories . containsKey ( layer ) ) { counterToCategories = layeredCategories . get ( layer ) ; } else { counterToCategories = new ConcurrentHashMap < String , List < String > > ( ) ; layeredCategories . put ( layer , counterToCategories ) ; } List < String > categories ; if ( counterToCategories . containsKey ( groupCounterName ) ) { categories = counterToCategories . get ( groupCounterName ) ; } else { categories = new ArrayList < String > ( ) ; counterToCategories . put ( groupCounterName , categories ) ; } if ( ! categories . contains ( subCategory ) ) { categories . add ( subCategory ) ; } return fullCounterName ; }
target:  Create a title based on switch ID, portID, vlanID, counterName, and subCategory If portID is -1, the title represents the given switch only If portID is a non-negative number, the title represents the port on the given switch For example: PacketIns can be further categorized based on L2 etherType or L3 protocol