refactoring
add condition to set profiling ratio
set io.writer at Flush()
refactoring