{"action":"created","comment":{"url":"https://api.github.com/repos/chriso/gauged/pulls/comments/25928701","id":25928701,"diff_hunk":"@@ -549,6 +549,78 @@ def test_clear_from(self):\n         self.assertEqual(gauged.value('foo', timestamp=40000), 5)\n         self.assertEqual(gauged.value('foo', timestamp=40000, namespace=1), 6)\n \n+    def test_clear_key_before(self):\n+        gauged = Gauged(self.driver, resolution=1000, block_size=10000)\n+        with gauged.writer as writer:\n+            writer.add({'foo': 1, 'bar': 1}, timestamp=10000)\n+            writer.add({'foo': 2, 'bar': 2}, timestamp=20000)\n+            writer.add({'foo': 3, 'bar': 3}, timestamp=30000)\n+            writer.add({'foo': 4, 'bar': 4}, timestamp=40000, namespace=1)\n+        self.assertEqual(gauged.value('foo', timestamp=40000), 3)\n+        self.assertEqual(gauged.value('bar', timestamp=40000), 3)\n+        self.assertEqual(gauged.value('foo', timestamp=40000, namespace=1), 4)\n+        self.assertEqual(gauged.value('bar', timestamp=40000, namespace=1), 4)\n+        with gauged.writer as writer:\n+            writer.clear_key_before('foo', timestamp=20000)\n+        # every value after 20000 stays the same\n+        self.assertEqual(gauged.value('foo', timestamp=30000), 3)\n+        self.assertEqual(gauged.value('bar', timestamp=30000), 3)\n+        # 'foo' value before 20000 is cleared\n+        self.assertEqual(gauged.value('foo', timestamp=10000), None)","path":"test/test_gauged.py","position":21,"original_position":21,"commit_id":"e7c22e97f65d0d2d55d168dca71f96a88e1af1f2","original_commit_id":"e7c22e97f65d0d2d55d168dca71f96a88e1af1f2","user":{"login":"chriso","id":364903,"avatar_url":"https://avatars.githubusercontent.com/u/364903?v=3","gravatar_id":"","url":"https://api.github.com/users/chriso","html_url":"https://github.com/chriso","followers_url":"https://api.github.com/users/chriso/followers","following_url":"https://api.github.com/users/chriso/following{/other_user}","gists_url":"https://api.github.com/users/chriso/gists{/gist_id}","starred_url":"https://api.github.com/users/chriso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriso/subscriptions","organizations_url":"https://api.github.com/users/chriso/orgs","repos_url":"https://api.github.com/users/chriso/repos","events_url":"https://api.github.com/users/chriso/events{/privacy}","received_events_url":"https://api.github.com/users/chriso/received_events","type":"User","site_admin":false},"body":"Can you add a test for `gauged.value('foo', timestamp=20000)` here to show if timestamps are inclusive?","created_at":"2015-03-06T07:04:03Z","updated_at":"2015-03-06T07:04:03Z","html_url":"https://github.com/chriso/gauged/pull/5#discussion_r25928701","pull_request_url":"https://api.github.com/repos/chriso/gauged/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/chriso/gauged/pulls/comments/25928701"},"html":{"href":"https://github.com/chriso/gauged/pull/5#discussion_r25928701"},"pull_request":{"href":"https://api.github.com/repos/chriso/gauged/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/chriso/gauged/pulls/5","id":30605026,"html_url":"https://github.com/chriso/gauged/pull/5","diff_url":"https://github.com/chriso/gauged/pull/5.diff","patch_url":"https://github.com/chriso/gauged/pull/5.patch","issue_url":"https://api.github.com/repos/chriso/gauged/issues/5","number":5,"state":"open","locked":false,"title":"added two new methods clear_key_before and clear_key_after","user":{"login":"niphlod","id":122119,"avatar_url":"https://avatars.githubusercontent.com/u/122119?v=3","gravatar_id":"","url":"https://api.github.com/users/niphlod","html_url":"https://github.com/niphlod","followers_url":"https://api.github.com/users/niphlod/followers","following_url":"https://api.github.com/users/niphlod/following{/other_user}","gists_url":"https://api.github.com/users/niphlod/gists{/gist_id}","starred_url":"https://api.github.com/users/niphlod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niphlod/subscriptions","organizations_url":"https://api.github.com/users/niphlod/orgs","repos_url":"https://api.github.com/users/niphlod/repos","events_url":"https://api.github.com/users/niphlod/events{/privacy}","received_events_url":"https://api.github.com/users/niphlod/received_events","type":"User","site_admin":false},"body":"Fixes issue #4\r\n\r\nThose are meant mainly for easier maintenance purposes\r\n\r\nNotes:\r\n- new methods are meant mainly for easier maintenance purposes\r\n- schema change needs a new version, plus migration scripts\r\n- remember to add in the docs that using the new methods statistics are\r\n  not updated\r\n\r\nUnrelated: \r\n- switched to faster travis-ci infrastructure based on docker\r\n- fails on newer pypy because pythonapi is no longer available","created_at":"2015-03-05T23:01:02Z","updated_at":"2015-03-06T07:04:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5f4f8b69815dd5e807872246a0a947fd43611b6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chriso/gauged/pulls/5/commits","review_comments_url":"https://api.github.com/repos/chriso/gauged/pulls/5/comments","review_comment_url":"https://api.github.com/repos/chriso/gauged/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chriso/gauged/issues/5/comments","statuses_url":"https://api.github.com/repos/chriso/gauged/statuses/e7c22e97f65d0d2d55d168dca71f96a88e1af1f2","head":{"label":"niphlod:enhancement/clear_key_methods","ref":"enhancement/clear_key_methods","sha":"e7c22e97f65d0d2d55d168dca71f96a88e1af1f2","user":{"login":"niphlod","id":122119,"avatar_url":"https://avatars.githubusercontent.com/u/122119?v=3","gravatar_id":"","url":"https://api.github.com/users/niphlod","html_url":"https://github.com/niphlod","followers_url":"https://api.github.com/users/niphlod/followers","following_url":"https://api.github.com/users/niphlod/following{/other_user}","gists_url":"https://api.github.com/users/niphlod/gists{/gist_id}","starred_url":"https://api.github.com/users/niphlod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niphlod/subscriptions","organizations_url":"https://api.github.com/users/niphlod/orgs","repos_url":"https://api.github.com/users/niphlod/repos","events_url":"https://api.github.com/users/niphlod/events{/privacy}","received_events_url":"https://api.github.com/users/niphlod/received_events","type":"User","site_admin":false},"repo":{"id":31618591,"name":"gauged","full_name":"niphlod/gauged","owner":{"login":"niphlod","id":122119,"avatar_url":"https://avatars.githubusercontent.com/u/122119?v=3","gravatar_id":"","url":"https://api.github.com/users/niphlod","html_url":"https://github.com/niphlod","followers_url":"https://api.github.com/users/niphlod/followers","following_url":"https://api.github.com/users/niphlod/following{/other_user}","gists_url":"https://api.github.com/users/niphlod/gists{/gist_id}","starred_url":"https://api.github.com/users/niphlod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niphlod/subscriptions","organizations_url":"https://api.github.com/users/niphlod/orgs","repos_url":"https://api.github.com/users/niphlod/repos","events_url":"https://api.github.com/users/niphlod/events{/privacy}","received_events_url":"https://api.github.com/users/niphlod/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/niphlod/gauged","description":"A fast, append-only storage layer for numeric data that changes over time","fork":true,"url":"https://api.github.com/repos/niphlod/gauged","forks_url":"https://api.github.com/repos/niphlod/gauged/forks","keys_url":"https://api.github.com/repos/niphlod/gauged/keys{/key_id}","collaborators_url":"https://api.github.com/repos/niphlod/gauged/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/niphlod/gauged/teams","hooks_url":"https://api.github.com/repos/niphlod/gauged/hooks","issue_events_url":"https://api.github.com/repos/niphlod/gauged/issues/events{/number}","events_url":"https://api.github.com/repos/niphlod/gauged/events","assignees_url":"https://api.github.com/repos/niphlod/gauged/assignees{/user}","branches_url":"https://api.github.com/repos/niphlod/gauged/branches{/branch}","tags_url":"https://api.github.com/repos/niphlod/gauged/tags","blobs_url":"https://api.github.com/repos/niphlod/gauged/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/niphlod/gauged/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/niphlod/gauged/git/refs{/sha}","trees_url":"https://api.github.com/repos/niphlod/gauged/git/trees{/sha}","statuses_url":"https://api.github.com/repos/niphlod/gauged/statuses/{sha}","languages_url":"https://api.github.com/repos/niphlod/gauged/languages","stargazers_url":"https://api.github.com/repos/niphlod/gauged/stargazers","contributors_url":"https://api.github.com/repos/niphlod/gauged/contributors","subscribers_url":"https://api.github.com/repos/niphlod/gauged/subscribers","subscription_url":"https://api.github.com/repos/niphlod/gauged/subscription","commits_url":"https://api.github.com/repos/niphlod/gauged/commits{/sha}","git_commits_url":"https://api.github.com/repos/niphlod/gauged/git/commits{/sha}","comments_url":"https://api.github.com/repos/niphlod/gauged/comments{/number}","issue_comment_url":"https://api.github.com/repos/niphlod/gauged/issues/comments{/number}","contents_url":"https://api.github.com/repos/niphlod/gauged/contents/{+path}","compare_url":"https://api.github.com/repos/niphlod/gauged/compare/{base}...{head}","merges_url":"https://api.github.com/repos/niphlod/gauged/merges","archive_url":"https://api.github.com/repos/niphlod/gauged/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/niphlod/gauged/downloads","issues_url":"https://api.github.com/repos/niphlod/gauged/issues{/number}","pulls_url":"https://api.github.com/repos/niphlod/gauged/pulls{/number}","milestones_url":"https://api.github.com/repos/niphlod/gauged/milestones{/number}","notifications_url":"https://api.github.com/repos/niphlod/gauged/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/niphlod/gauged/labels{/name}","releases_url":"https://api.github.com/repos/niphlod/gauged/releases{/id}","created_at":"2015-03-03T20:05:26Z","updated_at":"2015-03-03T20:05:26Z","pushed_at":"2015-03-05T23:02:34Z","git_url":"git://github.com/niphlod/gauged.git","ssh_url":"git@github.com:niphlod/gauged.git","clone_url":"https://github.com/niphlod/gauged.git","svn_url":"https://github.com/niphlod/gauged","homepage":null,"size":203,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"chriso:master","ref":"master","sha":"37198211702973cbf0aafe08594fc0244d067068","user":{"login":"chriso","id":364903,"avatar_url":"https://avatars.githubusercontent.com/u/364903?v=3","gravatar_id":"","url":"https://api.github.com/users/chriso","html_url":"https://github.com/chriso","followers_url":"https://api.github.com/users/chriso/followers","following_url":"https://api.github.com/users/chriso/following{/other_user}","gists_url":"https://api.github.com/users/chriso/gists{/gist_id}","starred_url":"https://api.github.com/users/chriso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriso/subscriptions","organizations_url":"https://api.github.com/users/chriso/orgs","repos_url":"https://api.github.com/users/chriso/repos","events_url":"https://api.github.com/users/chriso/events{/privacy}","received_events_url":"https://api.github.com/users/chriso/received_events","type":"User","site_admin":false},"repo":{"id":15922550,"name":"gauged","full_name":"chriso/gauged","owner":{"login":"chriso","id":364903,"avatar_url":"https://avatars.githubusercontent.com/u/364903?v=3","gravatar_id":"","url":"https://api.github.com/users/chriso","html_url":"https://github.com/chriso","followers_url":"https://api.github.com/users/chriso/followers","following_url":"https://api.github.com/users/chriso/following{/other_user}","gists_url":"https://api.github.com/users/chriso/gists{/gist_id}","starred_url":"https://api.github.com/users/chriso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriso/subscriptions","organizations_url":"https://api.github.com/users/chriso/orgs","repos_url":"https://api.github.com/users/chriso/repos","events_url":"https://api.github.com/users/chriso/events{/privacy}","received_events_url":"https://api.github.com/users/chriso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chriso/gauged","description":"A fast, append-only storage layer for numeric data that changes over time","fork":false,"url":"https://api.github.com/repos/chriso/gauged","forks_url":"https://api.github.com/repos/chriso/gauged/forks","keys_url":"https://api.github.com/repos/chriso/gauged/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chriso/gauged/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chriso/gauged/teams","hooks_url":"https://api.github.com/repos/chriso/gauged/hooks","issue_events_url":"https://api.github.com/repos/chriso/gauged/issues/events{/number}","events_url":"https://api.github.com/repos/chriso/gauged/events","assignees_url":"https://api.github.com/repos/chriso/gauged/assignees{/user}","branches_url":"https://api.github.com/repos/chriso/gauged/branches{/branch}","tags_url":"https://api.github.com/repos/chriso/gauged/tags","blobs_url":"https://api.github.com/repos/chriso/gauged/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chriso/gauged/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chriso/gauged/git/refs{/sha}","trees_url":"https://api.github.com/repos/chriso/gauged/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chriso/gauged/statuses/{sha}","languages_url":"https://api.github.com/repos/chriso/gauged/languages","stargazers_url":"https://api.github.com/repos/chriso/gauged/stargazers","contributors_url":"https://api.github.com/repos/chriso/gauged/contributors","subscribers_url":"https://api.github.com/repos/chriso/gauged/subscribers","subscription_url":"https://api.github.com/repos/chriso/gauged/subscription","commits_url":"https://api.github.com/repos/chriso/gauged/commits{/sha}","git_commits_url":"https://api.github.com/repos/chriso/gauged/git/commits{/sha}","comments_url":"https://api.github.com/repos/chriso/gauged/comments{/number}","issue_comment_url":"https://api.github.com/repos/chriso/gauged/issues/comments{/number}","contents_url":"https://api.github.com/repos/chriso/gauged/contents/{+path}","compare_url":"https://api.github.com/repos/chriso/gauged/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chriso/gauged/merges","archive_url":"https://api.github.com/repos/chriso/gauged/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chriso/gauged/downloads","issues_url":"https://api.github.com/repos/chriso/gauged/issues{/number}","pulls_url":"https://api.github.com/repos/chriso/gauged/pulls{/number}","milestones_url":"https://api.github.com/repos/chriso/gauged/milestones{/number}","notifications_url":"https://api.github.com/repos/chriso/gauged/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chriso/gauged/labels{/name}","releases_url":"https://api.github.com/repos/chriso/gauged/releases{/id}","created_at":"2014-01-15T02:21:46Z","updated_at":"2015-01-06T14:42:38Z","pushed_at":"2014-05-29T10:22:10Z","git_url":"git://github.com/chriso/gauged.git","ssh_url":"git@github.com:chriso/gauged.git","clone_url":"https://github.com/chriso/gauged.git","svn_url":"https://github.com/chriso/gauged","homepage":null,"size":618,"stargazers_count":341,"watchers_count":341,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":3,"forks":9,"open_issues":3,"watchers":341,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chriso/gauged/pulls/5"},"html":{"href":"https://github.com/chriso/gauged/pull/5"},"issue":{"href":"https://api.github.com/repos/chriso/gauged/issues/5"},"comments":{"href":"https://api.github.com/repos/chriso/gauged/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/chriso/gauged/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/chriso/gauged/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chriso/gauged/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/chriso/gauged/statuses/e7c22e97f65d0d2d55d168dca71f96a88e1af1f2"}}}}