Use getnum in Monitor limit
Update Monitor/Defense samples
Add Monitor unit test
Update doc