{"id":17239238,"url":"https://github.com/dinomite/forgetsy-jvm","last_synced_at":"2026-05-16T17:02:10.938Z","repository":{"id":136500482,"uuid":"90732872","full_name":"dinomite/forgetsy-jvm","owner":"dinomite","description":"JVM port of Forgetsy, a trending library, backed by Redis","archived":false,"fork":false,"pushed_at":"2017-06-26T21:12:53.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-25T23:49:26.417Z","etag":null,"topics":["data-structures","java","jvm","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dinomite.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-09T10:22:41.000Z","updated_at":"2017-05-09T20:58:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"62fbaac6-53d5-428e-ba0b-77d5158d3a68","html_url":"https://github.com/dinomite/forgetsy-jvm","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/dinomite/forgetsy-jvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinomite%2Fforgetsy-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinomite%2Fforgetsy-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinomite%2Fforgetsy-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinomite%2Fforgetsy-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinomite","download_url":"https://codeload.github.com/dinomite/forgetsy-jvm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinomite%2Fforgetsy-jvm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33111497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["data-structures","java","jvm","kotlin"],"created_at":"2024-10-15T05:48:07.120Z","updated_at":"2026-05-16T17:02:10.933Z","avatar_url":"https://github.com/dinomite.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# forgetsy-jvm\n\nA JVM port of [Forgetsy](https://github.com/cavvia/forgetsy) in Kotlin.  Data is stored in Redis, so you'll need one of those.\n\n# Synopsis\n\n```kotlin\n...\njedisPool = JedisPool(redisHost, redisPort)\n\nval followsData = Delta(jedisPool, name, 7.days(), true)\n\nfollowsData.increment(\"UserFoo\", date = 14.daysAgo())\nfollowsData.increment(\"UserBar\", date = 10.daysAgo())\nfollowsData.increment(\"UserBar\", date = 7.daysAgo())\nfollowsData.increment(\"UserFoo\", date = 1.daysAgo())\nfollowsData.increment(\"UserFoo\")\n\nprintln(followsData.fetch())\n```\n\nOutputs:\n\n```{UserFoo=0.6666666666666666, UserBar=0.5}```\n\n# Usage\n\nforgetsy-jvm is distributed included in [jcenter](https://bintray.com/bintray/jcenter).  If you're using Gradle, add\n`jcenter()` to your repositories block:\n\n    repositories {\n        jcenter()\n    }\n\nIf you use Maven, rethink your life choices (Maven is fine to keep using, but for new projects it's worth [learning Gradle](https://bitbucket.org/marshallpierce/java-quickstart)):\n\n    \u003crepositories\u003e\n        \u003crepository\u003e\n          \u003cid\u003ejcenter\u003c/id\u003e\n          \u003curl\u003ehttps://jcenter.bintray.com/\u003c/url\u003e\n        \u003c/repository\u003e\n    \u003c/repositories\u003e\n\nThen just add the dependency.\n\nIn Gradle:\n\n    compile 'net.dinomite:forgetsy:0.3.3'\n\nIn Maven (ick):\n\n    \u003cdependency\u003e\n      \u003cgroupId\u003enet.dinomite\u003c/groupId\u003e\n      \u003cartifactId\u003eforgetsy\u003c/artifactId\u003e\n      \u003cversion\u003e0.3.3\u003c/version\u003e\n      \u003ctype\u003epom\u003c/type\u003e\n    \u003c/dependency\u003e\n\n## Delta creation\n\n[`Delta`](https://github.com/dinomite/forgetsy-jvm/blob/master/src/main/kotlin/net/dinomite/forgetsy/Delta.kt) will\nattempt to use existing data in Redis if you don't provide a lifetime for and the underlying Sorted Sets exist,\nthrowing `IllegalStateException` if the data isn't found.  If you want to re-use existing data upon restart of your app,\nbut create a new one if necessary, do something like this:\n\n```kotlin\nvar delta = reifyOrMakeDelta(jedisPool)\n\nfun reifyOrMakeDelta(jedisPool: JedisPool): Delta {\n    try {\n        return Delta(jedisPool, \"namesy\")\n    } catch (e: IllegalStateException) {\n        return Delta(jedisPool, \"namesy\", Duration.ofDays(10))\n    }\n}\n```\n\n## Incrementing\n\nThe most common interaction with your delta will be incrementing bins:\n\n```kotlin\ndelta.increment(\"$binName\")\n```\n\n## Fetching\n\nUse the `fetch()` method to get the stats about what is trending:\n\n```kotlin\ndelta.fetch()\n```\n\nDeltas are likely to contain more bins than you want to see.  Pass a count to fetch to get the top n buckets:\n\n```kotlin\ndelta.fetch(25)\n```\n\n# Kotlin (and Java)\n\nThis library is written in Kotlin and I use it from Kotlin.  Kotlin has great Java interop…but this library makes use of\nnamed arguments which Java doesn't support and likely makes the API as viewed from Java pretty janky.  If you want to\nuse this from Java provide a PR or just let me know and we can work on it together.\n\n# See also\n\n- [Forgetsy](https://github.com/cavvia/forgetsy)\n- [bitly's post on Forget Table](http://word.bitly.com/post/41284219720/forget-table)\n- [bitly's Forget Table source](https://github.com/bitly/forgettable)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinomite%2Fforgetsy-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinomite%2Fforgetsy-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinomite%2Fforgetsy-jvm/lists"}