{"action":"created","issue":{"url":"https://api.github.com/repos/openzipkin/zipkin/issues/820","labels_url":"https://api.github.com/repos/openzipkin/zipkin/issues/820/labels{/name}","comments_url":"https://api.github.com/repos/openzipkin/zipkin/issues/820/comments","events_url":"https://api.github.com/repos/openzipkin/zipkin/issues/820/events","html_url":"https://github.com/openzipkin/zipkin/pull/820","id":115613994,"number":820,"title":"Adds minDuration and maxDuration to the query api, implemented by SQL","user":{"login":"adriancole","id":64215,"avatar_url":"https://avatars.githubusercontent.com/u/64215?v=3","gravatar_id":"","url":"https://api.github.com/users/adriancole","html_url":"https://github.com/adriancole","followers_url":"https://api.github.com/users/adriancole/followers","following_url":"https://api.github.com/users/adriancole/following{/other_user}","gists_url":"https://api.github.com/users/adriancole/gists{/gist_id}","starred_url":"https://api.github.com/users/adriancole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriancole/subscriptions","organizations_url":"https://api.github.com/users/adriancole/orgs","repos_url":"https://api.github.com/users/adriancole/repos","events_url":"https://api.github.com/users/adriancole/events{/privacy}","received_events_url":"https://api.github.com/users/adriancole/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-06T23:49:58Z","updated_at":"2015-11-08T01:30:42Z","closed_at":"2015-11-07T00:56:23Z","pull_request":{"url":"https://api.github.com/repos/openzipkin/zipkin/pulls/820","html_url":"https://github.com/openzipkin/zipkin/pull/820","diff_url":"https://github.com/openzipkin/zipkin/pull/820.diff","patch_url":"https://github.com/openzipkin/zipkin/pull/820.patch"},"body":"This adds minDuration and maxDuration queries that zipkin-web can use to\r\nsearch for long traces. This is initially supported by the in-memory and\r\nanorm (SQL) span stores.\r\n\r\nThis adds very basic UI support, which someone better at javascript can\r\npolish up:\r\n\r\n<img width=\"936\" alt=\"screen shot 2015-11-06 at 4 34 56 pm\" src=\"https://cloud.githubusercontent.com/assets/64215/11012242/5930d0d4-84a6-11e5-9fb5-67dbcc45adfb.png\">\r\n"},"comment":{"url":"https://api.github.com/repos/openzipkin/zipkin/issues/comments/154769339","html_url":"https://github.com/openzipkin/zipkin/pull/820#issuecomment-154769339","issue_url":"https://api.github.com/repos/openzipkin/zipkin/issues/820","id":154769339,"user":{"login":"yurishkuro","id":3523016,"avatar_url":"https://avatars.githubusercontent.com/u/3523016?v=3","gravatar_id":"","url":"https://api.github.com/users/yurishkuro","html_url":"https://github.com/yurishkuro","followers_url":"https://api.github.com/users/yurishkuro/followers","following_url":"https://api.github.com/users/yurishkuro/following{/other_user}","gists_url":"https://api.github.com/users/yurishkuro/gists{/gist_id}","starred_url":"https://api.github.com/users/yurishkuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurishkuro/subscriptions","organizations_url":"https://api.github.com/users/yurishkuro/orgs","repos_url":"https://api.github.com/users/yurishkuro/repos","events_url":"https://api.github.com/users/yurishkuro/events{/privacy}","received_events_url":"https://api.github.com/users/yurishkuro/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T01:30:42Z","updated_at":"2015-11-08T01:30:42Z","body":"small good news, Cassandra allows multi-column restrictions on clustering columns, it just requires special syntax like `(duration, ts) >= (20, '2015-11-07T11:00:00')`. With the table above, and the following data\r\n\r\n```\r\n service_name | time_bucket | duration | ts                       | trace_id\r\n--------------+-------------+----------+--------------------------+----------\r\n            x |           1 |       20 | 2015-11-07 12:00:00-0500 |        1\r\n            x |           1 |       20 | 2015-11-07 11:00:00-0500 |        1\r\n            x |           1 |       10 | 2015-11-07 12:00:00-0500 |        1\r\n            x |           1 |       10 | 2015-11-07 11:00:00-0500 |        1\r\n```\r\n\r\nthe following query finds both D=20 records at different timestamps:\r\n\r\n```\r\ncqlsh:zipkin> select * from duration_index where service_name='x' and time_bucket=1 and (duration, ts) >= (20, '2015-11-07T11:00:00');\r\n\r\n service_name | time_bucket | duration | ts                       | trace_id\r\n--------------+-------------+----------+--------------------------+----------\r\n            x |           1 |       20 | 2015-11-07 12:00:00-0500 |        1\r\n            x |           1 |       20 | 2015-11-07 11:00:00-0500 |        1\r\n```\r\n\r\nThe question of buckets skewing the distribution still remains, but it could be addressed by asking the user to specify both ends of the timeframe, not just endTs, and searching all relevant buckets. Then the bucket size can be tuned depending on the traffic volume in a given deployment.\r\n\r\n"}}