{"action":"created","issue":{"url":"https://api.github.com/repos/fabianp/memory_profiler/issues/105","labels_url":"https://api.github.com/repos/fabianp/memory_profiler/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/fabianp/memory_profiler/issues/105/comments","events_url":"https://api.github.com/repos/fabianp/memory_profiler/issues/105/events","html_url":"https://github.com/fabianp/memory_profiler/pull/105","id":114697182,"number":105,"title":"Add 'window' support to mprof to plot a particular time range","user":{"login":"pbowyer","id":89852,"avatar_url":"https://avatars.githubusercontent.com/u/89852?v=3","gravatar_id":"","url":"https://api.github.com/users/pbowyer","html_url":"https://github.com/pbowyer","followers_url":"https://api.github.com/users/pbowyer/followers","following_url":"https://api.github.com/users/pbowyer/following{/other_user}","gists_url":"https://api.github.com/users/pbowyer/gists{/gist_id}","starred_url":"https://api.github.com/users/pbowyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbowyer/subscriptions","organizations_url":"https://api.github.com/users/pbowyer/orgs","repos_url":"https://api.github.com/users/pbowyer/repos","events_url":"https://api.github.com/users/pbowyer/events{/privacy}","received_events_url":"https://api.github.com/users/pbowyer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-02T22:20:23Z","updated_at":"2015-11-03T09:12:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fabianp/memory_profiler/pulls/105","html_url":"https://github.com/fabianp/memory_profiler/pull/105","diff_url":"https://github.com/fabianp/memory_profiler/pull/105.diff","patch_url":"https://github.com/fabianp/memory_profiler/pull/105.patch"},"body":"This is my contribution to address #103. It is my first time contributing to a Python project, so code review & feedback will be much appreciated.\r\n\r\nMy code lets one plot a particular time range out of the entire graph. This is really useful when bracketing functions in a long running, as it allows you to _zoom_ in and see in detail which functions are being called.\r\n\r\nTo use, I added a new option called `--window` or `-w`, taking a comma-separated value of two numbers:\r\n\r\n```\r\n$ mprof plot --window 10,17.5 -o plot.png\r\n```\r\n\r\n### One comment\r\n* I know my approach of passing `options` from `plot_action` to `plot_file` and thence to `add_brackets` is not a great. I couldn't think of a better way, short of putting the functions inside a class so a class variable can be accessed directly."},"comment":{"url":"https://api.github.com/repos/fabianp/memory_profiler/issues/comments/153293773","html_url":"https://github.com/fabianp/memory_profiler/pull/105#issuecomment-153293773","issue_url":"https://api.github.com/repos/fabianp/memory_profiler/issues/105","id":153293773,"user":{"login":"fabianp","id":277639,"avatar_url":"https://avatars.githubusercontent.com/u/277639?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianp","html_url":"https://github.com/fabianp","followers_url":"https://api.github.com/users/fabianp/followers","following_url":"https://api.github.com/users/fabianp/following{/other_user}","gists_url":"https://api.github.com/users/fabianp/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianp/subscriptions","organizations_url":"https://api.github.com/users/fabianp/orgs","repos_url":"https://api.github.com/users/fabianp/repos","events_url":"https://api.github.com/users/fabianp/events{/privacy}","received_events_url":"https://api.github.com/users/fabianp/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T09:12:33Z","updated_at":"2015-11-03T09:12:33Z","body":"Hi! Thanks a lot for this!\r\n\r\nThe code looks fine. It would be nice to have the possibility to only specify a start time or an end time, i.e. I would like to have\r\n\r\n```\r\n./mprof plot --window 0.1\r\n```\r\n\r\nthat plots in the window 0.1 to end and\r\n\r\n```\r\n./mprof plot --window ,1.\r\n```\r\n\r\nthat plots in the window from start to 1. . Do you think this is possible?\r\n"}}