{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/alertmanager/pulls/comments/74705442","id":74705442,"diff_hunk":"@@ -359,15 +360,33 @@ func (api *API) delSilence(w http.ResponseWriter, r *http.Request) {\n }\n \n func (api *API) listSilences(w http.ResponseWriter, r *http.Request) {\n-\tsils, err := api.silences.All()\n+\tvar (\n+\t\tnum    = r.FormValue(\"n\")\n+\t\toffset = r.FormValue(\"offset\")","path":"api/api.go","position":15,"original_position":15,"commit_id":"1690c94f72ad2d84ff406db192f9fde2e68389ff","original_commit_id":"1690c94f72ad2d84ff406db192f9fde2e68389ff","user":{"login":"grobie","id":3432,"avatar_url":"https://avatars.githubusercontent.com/u/3432?v=3","gravatar_id":"","url":"https://api.github.com/users/grobie","html_url":"https://github.com/grobie","followers_url":"https://api.github.com/users/grobie/followers","following_url":"https://api.github.com/users/grobie/following{/other_user}","gists_url":"https://api.github.com/users/grobie/gists{/gist_id}","starred_url":"https://api.github.com/users/grobie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grobie/subscriptions","organizations_url":"https://api.github.com/users/grobie/orgs","repos_url":"https://api.github.com/users/grobie/repos","events_url":"https://api.github.com/users/grobie/events{/privacy}","received_events_url":"https://api.github.com/users/grobie/received_events","type":"User","site_admin":false},"body":"Offset based pagination has some disadvantages. Besides being quite slow with several relational-databases (which doesn't really matter here), it's not as stable as an after-id based approach. Using something like `?after=last-seen-id&limit=50` will ensure that the user will really see the next result when using pagination.","created_at":"2016-08-14T17:14:14Z","updated_at":"2016-08-14T17:14:14Z","html_url":"https://github.com/prometheus/alertmanager/pull/456#discussion_r74705442","pull_request_url":"https://api.github.com/repos/prometheus/alertmanager/pulls/456","_links":{"self":{"href":"https://api.github.com/repos/prometheus/alertmanager/pulls/comments/74705442"},"html":{"href":"https://github.com/prometheus/alertmanager/pull/456#discussion_r74705442"},"pull_request":{"href":"https://api.github.com/repos/prometheus/alertmanager/pulls/456"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/alertmanager/pulls/456","id":80815244,"html_url":"https://github.com/prometheus/alertmanager/pull/456","diff_url":"https://github.com/prometheus/alertmanager/pull/456.diff","patch_url":"https://github.com/prometheus/alertmanager/pull/456.patch","issue_url":"https://api.github.com/repos/prometheus/alertmanager/issues/456","number":456,"state":"open","locked":false,"title":"Paginate silences","user":{"login":"stuartnelson3","id":1398104,"avatar_url":"https://avatars.githubusercontent.com/u/1398104?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartnelson3","html_url":"https://github.com/stuartnelson3","followers_url":"https://api.github.com/users/stuartnelson3/followers","following_url":"https://api.github.com/users/stuartnelson3/following{/other_user}","gists_url":"https://api.github.com/users/stuartnelson3/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartnelson3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartnelson3/subscriptions","organizations_url":"https://api.github.com/users/stuartnelson3/orgs","repos_url":"https://api.github.com/users/stuartnelson3/repos","events_url":"https://api.github.com/users/stuartnelson3/events{/privacy}","received_events_url":"https://api.github.com/users/stuartnelson3/received_events","type":"User","site_admin":false},"body":"somewhere between the first commit and the second commit I started getting nil pointer dereferences in `TestSilencesMutes`, which I'll look into. Also, there are no tests for this `lastID` thing.\r\n\r\nLet me know what you think, and if the UI works. I added the `inflight` check to prevent duplicate requests being made to the backend -- apparently the throttling option in the code doesn't work very well.\r\n\r\n@fabxc \r\n\r\n**EDIT**\r\n\r\n- Number of returned silences and page offset can be controlled through the url: `http://localhost:9093/#/silences?n=5&offset=0`\r\n- There's a default page size of 50\r\n- Don't be shy about closing this, it probably has little to do with how you're thinking of implementing paging + label searches","created_at":"2016-08-10T15:29:19Z","updated_at":"2016-08-14T17:14:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6eb48001f1edf8440d1db5aabab2b51626de58c0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/alertmanager/pulls/456/commits","review_comments_url":"https://api.github.com/repos/prometheus/alertmanager/pulls/456/comments","review_comment_url":"https://api.github.com/repos/prometheus/alertmanager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prometheus/alertmanager/issues/456/comments","statuses_url":"https://api.github.com/repos/prometheus/alertmanager/statuses/1690c94f72ad2d84ff406db192f9fde2e68389ff","head":{"label":"prometheus:paginate-silences","ref":"paginate-silences","sha":"1690c94f72ad2d84ff406db192f9fde2e68389ff","user":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"repo":{"id":11452538,"name":"alertmanager","full_name":"prometheus/alertmanager","owner":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prometheus/alertmanager","description":"Prometheus Alertmanager","fork":false,"url":"https://api.github.com/repos/prometheus/alertmanager","forks_url":"https://api.github.com/repos/prometheus/alertmanager/forks","keys_url":"https://api.github.com/repos/prometheus/alertmanager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/alertmanager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/alertmanager/teams","hooks_url":"https://api.github.com/repos/prometheus/alertmanager/hooks","issue_events_url":"https://api.github.com/repos/prometheus/alertmanager/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/alertmanager/events","assignees_url":"https://api.github.com/repos/prometheus/alertmanager/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/alertmanager/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/alertmanager/tags","blobs_url":"https://api.github.com/repos/prometheus/alertmanager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/alertmanager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/alertmanager/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/alertmanager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/alertmanager/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/alertmanager/languages","stargazers_url":"https://api.github.com/repos/prometheus/alertmanager/stargazers","contributors_url":"https://api.github.com/repos/prometheus/alertmanager/contributors","subscribers_url":"https://api.github.com/repos/prometheus/alertmanager/subscribers","subscription_url":"https://api.github.com/repos/prometheus/alertmanager/subscription","commits_url":"https://api.github.com/repos/prometheus/alertmanager/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/alertmanager/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/alertmanager/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/alertmanager/issues/comments{/number}","contents_url":"https://api.github.com/repos/prometheus/alertmanager/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/alertmanager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/alertmanager/merges","archive_url":"https://api.github.com/repos/prometheus/alertmanager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/alertmanager/downloads","issues_url":"https://api.github.com/repos/prometheus/alertmanager/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/alertmanager/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/alertmanager/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/alertmanager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/alertmanager/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/alertmanager/releases{/id}","deployments_url":"https://api.github.com/repos/prometheus/alertmanager/deployments","created_at":"2013-07-16T15:06:31Z","updated_at":"2016-08-13T14:55:44Z","pushed_at":"2016-08-14T12:46:12Z","git_url":"git://github.com/prometheus/alertmanager.git","ssh_url":"git@github.com:prometheus/alertmanager.git","clone_url":"https://github.com/prometheus/alertmanager.git","svn_url":"https://github.com/prometheus/alertmanager","homepage":"","size":7873,"stargazers_count":204,"watchers_count":204,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":127,"mirror_url":null,"open_issues_count":68,"forks":127,"open_issues":68,"watchers":204,"default_branch":"master"}},"base":{"label":"prometheus:master","ref":"master","sha":"5c12950576e5dcc03b8bfff775127a1f4c013903","user":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"repo":{"id":11452538,"name":"alertmanager","full_name":"prometheus/alertmanager","owner":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prometheus/alertmanager","description":"Prometheus Alertmanager","fork":false,"url":"https://api.github.com/repos/prometheus/alertmanager","forks_url":"https://api.github.com/repos/prometheus/alertmanager/forks","keys_url":"https://api.github.com/repos/prometheus/alertmanager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/alertmanager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/alertmanager/teams","hooks_url":"https://api.github.com/repos/prometheus/alertmanager/hooks","issue_events_url":"https://api.github.com/repos/prometheus/alertmanager/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/alertmanager/events","assignees_url":"https://api.github.com/repos/prometheus/alertmanager/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/alertmanager/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/alertmanager/tags","blobs_url":"https://api.github.com/repos/prometheus/alertmanager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/alertmanager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/alertmanager/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/alertmanager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/alertmanager/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/alertmanager/languages","stargazers_url":"https://api.github.com/repos/prometheus/alertmanager/stargazers","contributors_url":"https://api.github.com/repos/prometheus/alertmanager/contributors","subscribers_url":"https://api.github.com/repos/prometheus/alertmanager/subscribers","subscription_url":"https://api.github.com/repos/prometheus/alertmanager/subscription","commits_url":"https://api.github.com/repos/prometheus/alertmanager/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/alertmanager/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/alertmanager/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/alertmanager/issues/comments{/number}","contents_url":"https://api.github.com/repos/prometheus/alertmanager/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/alertmanager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/alertmanager/merges","archive_url":"https://api.github.com/repos/prometheus/alertmanager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/alertmanager/downloads","issues_url":"https://api.github.com/repos/prometheus/alertmanager/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/alertmanager/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/alertmanager/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/alertmanager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/alertmanager/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/alertmanager/releases{/id}","deployments_url":"https://api.github.com/repos/prometheus/alertmanager/deployments","created_at":"2013-07-16T15:06:31Z","updated_at":"2016-08-13T14:55:44Z","pushed_at":"2016-08-14T12:46:12Z","git_url":"git://github.com/prometheus/alertmanager.git","ssh_url":"git@github.com:prometheus/alertmanager.git","clone_url":"https://github.com/prometheus/alertmanager.git","svn_url":"https://github.com/prometheus/alertmanager","homepage":"","size":7873,"stargazers_count":204,"watchers_count":204,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":127,"mirror_url":null,"open_issues_count":68,"forks":127,"open_issues":68,"watchers":204,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/alertmanager/pulls/456"},"html":{"href":"https://github.com/prometheus/alertmanager/pull/456"},"issue":{"href":"https://api.github.com/repos/prometheus/alertmanager/issues/456"},"comments":{"href":"https://api.github.com/repos/prometheus/alertmanager/issues/456/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/alertmanager/pulls/456/comments"},"review_comment":{"href":"https://api.github.com/repos/prometheus/alertmanager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prometheus/alertmanager/pulls/456/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/alertmanager/statuses/1690c94f72ad2d84ff406db192f9fde2e68389ff"}}}}
{"actor":{"display_login":"grobie"}}