/challenge @th3hunt <!-- probot = {"23183073":{"challenge":{"repoOwner":"beat-interviewing","repo":"example-code-review-assignment-th3hunt-4v7","candidate":"th3hunt","assignment":"example-code-review-assignment","status":"graded","createdAt":"2022-10-17T11:25:50.130Z","createdBy":"feel-the-beat","config":{"challenge":{"create_pull_request":{"head":"pr","base":"main","paths":["!.github/assignment.yml"],"title":"Introduce analytics functionality","body":"## Description\n\nI've introduced the functionality of counting each visit for later analysis. Each visit is registered in real-time.\n\nIn addition to tracking each visit a new read endpoint makes link metadata and analytics available at a chosen interval.\n\n```\nPOST /link/NvE?per=1s HTTP/1.1\nHost: beat.ly\n```\n\n```\nHTTP/1.1 200 OK\n\n{\n \"id\": \"NvE\",\n \"url\": \"https://beat.ly/NvE\",\n \"target\": \"https://en.wikipedia.org/wiki/URL_shortening#Techniques\",\n \"redirect\": 302,\n \"visits\": {\n \"2022-07-27T11:42\": 11\n \"2022-07-27T11:43\": 7\n \"2022-07-27T11:44\": 9\n }\n}\n```\n\n## Review Checklist\n\n- [ ] Design is appropriate for the task\n- [ ] Requirements have been met\n- [ ] Free of potential bugs and security issues\n- [ ] Tests verify the code against requirements and edge cases\n- [ ] Style is consistent and idiomatic\n"}},"review":{"comments":[{"path":"beatly/store.go","start_line":97,"line":113,"body":"**Design:** The additional database interaction is performed serially adding to the overall response time.\n\nConsider concurrent mechanisms to improve response times. \n\n**Points**: 4\n"},{"path":"beatly/store.go","line":97,"body":"**Design:** The select query has no limit and has the potential of loading large amounts of data in memory.\n\n**Points**: 4\n"}]},"grade":{}},"pull":1,"pull_commit_sha":"a96641824e3013689f0876655791546cd76aaa9b","endedAt":"2022-10-17T11:30:29.814Z","endedBy":"feel-the-beat","grade":80,"gradedAt":"2022-10-17T11:31:57.912Z","gradedBy":"feel-the-beat"}}} -->