{"action":"opened","issue":{"url":"https://api.github.com/repos/catapult-project/catapult/issues/30","labels_url":"https://api.github.com/repos/catapult-project/catapult/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/catapult-project/catapult/issues/30/comments","events_url":"https://api.github.com/repos/catapult-project/catapult/issues/30/events","html_url":"https://github.com/catapult-project/catapult/issues/30","id":98471879,"number":30,"title":"Refactor tracing_analysis so that the appendXXX methods come from a SummaryBuilder class","user":{"login":"catapult-bot","id":13457154,"avatar_url":"https://avatars.githubusercontent.com/u/13457154?v=3","gravatar_id":"","url":"https://api.github.com/users/catapult-bot","html_url":"https://github.com/catapult-bot","followers_url":"https://api.github.com/users/catapult-bot/followers","following_url":"https://api.github.com/users/catapult-bot/following{/other_user}","gists_url":"https://api.github.com/users/catapult-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/catapult-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catapult-bot/subscriptions","organizations_url":"https://api.github.com/users/catapult-bot/orgs","repos_url":"https://api.github.com/users/catapult-bot/repos","events_url":"https://api.github.com/users/catapult-bot/events{/privacy}","received_events_url":"https://api.github.com/users/catapult-bot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/catapult-project/catapult/labels/P2","name":"P2","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-31T21:10:50Z","updated_at":"2015-07-31T21:10:50Z","closed_at":null,"body":"<a href=\"https://github.com/natduca\"><img src=\"https://avatars.githubusercontent.com/u/412396?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [natduca](https://github.com/natduca)**\n_Monday Sep 22, 2014 at 19:54 GMT_\n_Originally opened as https://github.com/google/trace-viewer/issues/30_\n\n----\n\n_From [nd...@chromium.org](https://code.google.com/u/102435256078839283966/) on June 05, 2012 13:13:11_\n\nThe  createSummaryElementForSelection uses a variety of appendXXX methods. These methods construct elements and return them which is awesome but it makes it hard to test the analysis code.\r\n\r\nWe should create a class\r\n\r\n   SummaryBuilder {\r\n   }\r\n   SummaryBuilder.prototype = {\r\n     // all the append methods\r\n   }\r\n\r\nAnd modify createSummaryElementForSelection to take a SummaryBuilder instance as one of its arguments.\r\n\r\nThis way, when we want to test code, e.g. the averaging code, we can pass in a mock version of this interface instead.\n\n_Original issue: http://code.google.com/p/trace-viewer/issues/detail?id=23_\n"}}