{"id":15715062,"url":"https://github.com/arusso/tgrep","last_synced_at":"2025-03-30T19:51:01.700Z","repository":{"id":144890714,"uuid":"94846808","full_name":"arusso/tgrep","owner":"arusso","description":null,"archived":false,"fork":false,"pushed_at":"2017-06-20T04:36:09.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T22:57:23.373Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arusso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-20T03:41:58.000Z","updated_at":"2017-06-20T04:37:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d75b333-dcd7-4f8d-8e11-552f548fc22d","html_url":"https://github.com/arusso/tgrep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arusso%2Ftgrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arusso%2Ftgrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arusso%2Ftgrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arusso%2Ftgrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arusso","download_url":"https://codeload.github.com/arusso/tgrep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246372501,"owners_count":20766627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T21:40:18.826Z","updated_at":"2025-03-30T19:51:01.670Z","avatar_url":"https://github.com/arusso.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"_In Febuary 2011, Reddit was looking to [hire some systems\nengineers](https://www.reddit.com/r/blog/comments/fjgit/reddit_is_doubling_the_size_of_its_programming/),\nand asked applicants to write a tool to search through web log files in a\nspecific format by date/time. This is my unfinished attempt to the backend\nchallenge._\n\n## Project Requirements\n\n1. Quickly search through log files.  Example of log line (newlines added):\n\n```\nFeb 10 10:59:49 web03 haproxy[1631]: 10.350.42.161:58625 [10/Feb/2011:10:59:49.089] frontend\npool3/srv28-5020 0/138/0/19/160 200 488 - - ---- 332/332/13/0/0 0/15 {Mozilla/5.0 (Windows; U; \nWindows NT 6.1; en-US; rv:1.9.2.7) Gecko/20100713 Firefox/3.6.7|www.reddit.com|\nhttp://www.reddit.com/r/pics/?count=75\u0026after=t3_fiic6|201.8.487.192|17.86.820.117|}\n\"POST /api/vote HTTP/1.1\"\n```\n\n2. By default, it looks at /logs/haproxy.log -- if an argument is specified for\n  which file to open, it can be either appended or prepended to the time argument\n\n3. Code must be leglible\n\n### Given Details\n\n* Each line starts with a date time\n* Each log contains a single 24-hour period +- a few minutes\n* Timestamps are always increasing in order\n* You can ignore daylight savings\n\n### Assumptions\n\n* Time is in 24-hour notation (as was shown in the example: \"tgrep 23:59-0:03\")\n\n## Approach\n\nAttempt to do a binary search on the file, using the file size to estimate the\nmid points used to reduce the search area by (theoretically) half.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farusso%2Ftgrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farusso%2Ftgrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farusso%2Ftgrep/lists"}