{"action":"opened","issue":{"url":"https://api.github.com/repos/Feuerlabs/exometer/issues/125","labels_url":"https://api.github.com/repos/Feuerlabs/exometer/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/Feuerlabs/exometer/issues/125/comments","events_url":"https://api.github.com/repos/Feuerlabs/exometer/issues/125/events","html_url":"https://github.com/Feuerlabs/exometer/issues/125","id":55924373,"number":125,"title":"Reporter's erlang:send_after/3 fails under heavy load","user":{"login":"jstypka","id":4479536,"avatar_url":"https://avatars.githubusercontent.com/u/4479536?v=3","gravatar_id":"","url":"https://api.github.com/users/jstypka","html_url":"https://github.com/jstypka","followers_url":"https://api.github.com/users/jstypka/followers","following_url":"https://api.github.com/users/jstypka/following{/other_user}","gists_url":"https://api.github.com/users/jstypka/gists{/gist_id}","starred_url":"https://api.github.com/users/jstypka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstypka/subscriptions","organizations_url":"https://api.github.com/users/jstypka/orgs","repos_url":"https://api.github.com/users/jstypka/repos","events_url":"https://api.github.com/users/jstypka/events{/privacy}","received_events_url":"https://api.github.com/users/jstypka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-29T16:46:53Z","updated_at":"2015-01-29T16:46:53Z","closed_at":null,"body":"When performing some heavier computations with many processes, I noticed that the reporter skips some of the logs. For example after running a program for 30s and logging data every 1s, the reporter ends up logging only 15 of them or sometimes even less.\r\n\r\nIn my opinion using send_after/3 might be the issue. Reporter uses it to indicate the moment when it should activate, fetch appropriate data and \"report it\". Every time he receives the message `{report, Key, Interval}` he performs some action and then calls send_after/3 once again. However when there are many other processes waiting to be scheduled, a significant amount of time may pass between the event of receiving the message, and the reporter being activated by the scheduler to process it and call the function once again. Therefore even though the interval is officially 1s, the period between the events of calling send_after/3 might be much more than 1s. This offset accumulates over time resulting in a significant deviation in the logs.\r\n\r\nThis issue might be solved by substituting send_after/3 with send_interval/3, which doesn't require resetting the timer every 1s (or whatever the interval is)."}}