{"action":"opened","issue":{"url":"https://api.github.com/repos/adamchainz/django-mysql/issues/80","labels_url":"https://api.github.com/repos/adamchainz/django-mysql/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/adamchainz/django-mysql/issues/80/comments","events_url":"https://api.github.com/repos/adamchainz/django-mysql/issues/80/events","html_url":"https://github.com/adamchainz/django-mysql/issues/80","id":70680626,"number":80,"title":"Fix SmartIterator ZeroDivisionError","user":{"login":"adamchainz","id":857609,"avatar_url":"https://avatars.githubusercontent.com/u/857609?v=3","gravatar_id":"","url":"https://api.github.com/users/adamchainz","html_url":"https://github.com/adamchainz","followers_url":"https://api.github.com/users/adamchainz/followers","following_url":"https://api.github.com/users/adamchainz/following{/other_user}","gists_url":"https://api.github.com/users/adamchainz/gists{/gist_id}","starred_url":"https://api.github.com/users/adamchainz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamchainz/subscriptions","organizations_url":"https://api.github.com/users/adamchainz/orgs","repos_url":"https://api.github.com/users/adamchainz/repos","events_url":"https://api.github.com/users/adamchainz/events{/privacy}","received_events_url":"https://api.github.com/users/adamchainz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-24T12:42:01Z","updated_at":"2015-04-24T12:42:01Z","closed_at":null,"body":"Seen happening on an iterator in a test case which iterated very quickly:\r\n\r\n```\r\n  emacs +170 /opt/yplan/venv/local/lib/python2.7/site-packages/django_mysql/models/query.py  # __iter__\r\n    self.adjust_chunk_size(chunk, timer.total_time)\r\n  emacs +228 /opt/yplan/venv/local/lib/python2.7/site-packages/django_mysql/models/query.py  # adjust_chunk_size\r\n    new_chunk_size = self.rate.update(num_processed, chunk_time)\r\n  emacs +44  /opt/yplan/venv/local/lib/python2.7/site-packages/django_mysql/utils.py  # update\r\n    avg_rate = self.avg_n / self.avg_t\r\nZeroDivisionError: float division by zero\r\n```"}}