{"id":20355468,"url":"https://github.com/dcoxall/log-summary","last_synced_at":"2026-05-07T22:34:38.516Z","repository":{"id":148714354,"uuid":"70095094","full_name":"dcoxall/log-summary","owner":"dcoxall","description":null,"archived":false,"fork":false,"pushed_at":"2016-10-05T20:06:51.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-15T01:03:28.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"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/dcoxall.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":"2016-10-05T20:06:31.000Z","updated_at":"2016-10-05T20:06:53.000Z","dependencies_parsed_at":"2023-05-28T18:15:29.563Z","dependency_job_id":null,"html_url":"https://github.com/dcoxall/log-summary","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/dcoxall%2Flog-summary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcoxall%2Flog-summary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcoxall%2Flog-summary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcoxall%2Flog-summary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcoxall","download_url":"https://codeload.github.com/dcoxall/log-summary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241889204,"owners_count":20037463,"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-11-14T23:12:58.580Z","updated_at":"2026-05-07T22:34:33.496Z","avatar_url":"https://github.com/dcoxall.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Log Summary\n===========\n\nLog Summary is a simple ruby application that can parse a basic log file format:\n\n    /homepage 192.168.0.1\n    /about/1 192.168.0.1\n    /videos/cats 127.0.0.1\n    /homepage 192.168.0.1\n\nUsage\n-----\n\nIt comes with a very simple CLI that can be used as follows:\n\n    $ bin/parser.rb /path/to/log_file.log\n    VIEWS\n      /homepage    2 views\n      /about       1 views\n      /viedos/cats 1 views\n    UNIQUE VIEWS\n      /homepage    1 unique views\n      /about       1 unique views\n      /viedos/cats 1 unique views\n\nDevelopment\n-----------\n\nTo run the test suite you can use:\n\n    $ bin/rspec -c\n\nArchitecture\n------------\n\n- Use dependency injection to support patterns such as **strategy pattern**. This could\n  then be used to parse more complex log lines without changing much code. The parser\n  could even be switched out based on command line arguments.\n- Avoid hashes in **favour of custom objects**. Ruby engineers have a tendency to favor hash\n  driven development but it makes code inflexible IMO.\n- **Keep logic outside of executables** and in classes instead. This makes even the CLI output\n  testable.\n\nRecommendations\n---------------\n\nRefactor the `Aggregator` to better support multiple aggregations. Potentially something like:\n\n    # pseudo code\n    result_builder = ResultBuilder.new\n    # aggregation classes have a basic interface\n    result_builder.add_aggregator(UniqueViewsAggregator.new)\n    result_builder.add_aggregator(ViewCountAggregator.new)\n    result_builder \u003c\u003c LogLine.new('/path', 'ip')\n    result_builder.to_s # =\u003e output results?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcoxall%2Flog-summary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcoxall%2Flog-summary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcoxall%2Flog-summary/lists"}