{"action":"opened","issue":{"url":"https://api.github.com/repos/weaveworks/cortex/issues/630","repository_url":"https://api.github.com/repos/weaveworks/cortex","labels_url":"https://api.github.com/repos/weaveworks/cortex/issues/630/labels{/name}","comments_url":"https://api.github.com/repos/weaveworks/cortex/issues/630/comments","events_url":"https://api.github.com/repos/weaveworks/cortex/issues/630/events","html_url":"https://github.com/weaveworks/cortex/issues/630","id":284311959,"number":630,"title":"Optimisation: avoid decoding repeated Metrics from chunks","user":{"login":"bboreham","id":8125524,"avatar_url":"https://avatars2.githubusercontent.com/u/8125524?v=4","gravatar_id":"","url":"https://api.github.com/users/bboreham","html_url":"https://github.com/bboreham","followers_url":"https://api.github.com/users/bboreham/followers","following_url":"https://api.github.com/users/bboreham/following{/other_user}","gists_url":"https://api.github.com/users/bboreham/gists{/gist_id}","starred_url":"https://api.github.com/users/bboreham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboreham/subscriptions","organizations_url":"https://api.github.com/users/bboreham/orgs","repos_url":"https://api.github.com/users/bboreham/repos","events_url":"https://api.github.com/users/bboreham/events{/privacy}","received_events_url":"https://api.github.com/users/bboreham/received_events","type":"User","site_admin":false},"labels":[{"id":619941414,"url":"https://api.github.com/repos/weaveworks/cortex/labels/querier/optimisation","name":"querier/optimisation","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-23T15:34:37Z","updated_at":"2017-12-23T15:34:37Z","closed_at":null,"author_association":"OWNER","body":"Part of #624 \r\n\r\nA `Metric` is a set of label-value pairs.  When decoding hundreds of chunks from a large query, many will share the same `Metric`.  \r\n\r\nA `Metric` has a `Fingerprint`, a hash of the contents, which is also in the chunk (and in the index key).\r\nOnce we have decoded the `Metric` for a given `Fingerprint` once we can re-use that value for subsequent chunks in the same series.\r\n\r\nThere is a small possibility the same hash value maps to two `Metric`s: we can check by comparing the raw bytes.  We save decompressing and decoding from JSON.\r\n\r\nUnfortunately the `Metric` is currently encoded in a blob with other metadata such as `From` and `Through` times.  We would need to separate the `Metric` into its own blob to achieve the above."}}
{"actor":{"display_login":"bboreham"}}