I hate to be that typical hackernews commenter that says "Oh this is already done for free by this thing".
But I use this open source project https://anvaka.github.io/redsim/ for that purposes.
Unless there's something else I don't see here, i think this open source thingy gives all you need.