write commits count to db