add some javadoc comment and ajust output format of metrics not json

file