{"id":24545735,"url":"https://github.com/nevill/timebased","last_synced_at":"2025-10-09T14:18:35.316Z","repository":{"id":57704511,"uuid":"497978391","full_name":"nevill/timebased","owner":"nevill","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-01T07:11:37.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-03T07:28:53.227Z","etag":null,"topics":["statistics","timebased"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nevill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-30T14:31:15.000Z","updated_at":"2022-05-30T14:41:37.000Z","dependencies_parsed_at":"2022-09-26T21:21:07.640Z","dependency_job_id":null,"html_url":"https://github.com/nevill/timebased","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nevill/timebased","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevill%2Ftimebased","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevill%2Ftimebased/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevill%2Ftimebased/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevill%2Ftimebased/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nevill","download_url":"https://codeload.github.com/nevill/timebased/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevill%2Ftimebased/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001528,"owners_count":26083117,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["statistics","timebased"],"created_at":"2025-01-22T21:29:36.900Z","updated_at":"2025-10-09T14:18:35.299Z","avatar_url":"https://github.com/nevill.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Timebased\nThis repo contains useful methods can be used in your daily development.\n\n### Timebased stats for a period of time.\nYou want to know most viewed products within 3 hours. Assume we have 3 buckets to store recent 3 hours views into them, here is a list\n\n| Hour 1:00 | Hour 2:00 | Hour 3:00 |\n| - | - | - |\n|P1: 0|P1: 13|p1: 9|\n|P2: 5|P2: 11|p2: 29|\n|P3: 7|P3: 0|p3: 0|\n|P4: 0|P4: 0|p4: 21|\n\nNow, we are at fourth hour, (assume it's 3:10), we can get a rank list at the end.\n\n1. P2: 45\n1. p1: 22\n1. p4: 21\n1. p3: 7\n\nYou can check the implementation under `examples/`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnevill%2Ftimebased","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnevill%2Ftimebased","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnevill%2Ftimebased/lists"}