Skip to content
a minimalist library to manage countings, rankings & overall leaderboard with Redis
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
samples/Toppler.Sample.RateLimiter
scripts
src
tests
tools/redis-64.2.8.2101
.gitignore
LICENSE
README.md
Toppler.nuspec
Toppler.sln
appveyor.yml

README.md

Build status Nuget Nuget Coverage Status

Toppler

a minimalist library to manage countings, rankings & overall leaderboard

Installing via NuGet

Install-Package Toppler

Overview

TODO

Use Cases

  1. Counting stuff ( in a Distributed environnment)
  2. Leaderboards & Ranking tables with Custom Time Ranges (Second, Minute, Hour, Day)
  3. Very Basic Recommendation system (mixing random & popular values)
  4. Rate limiter with a fixed/sliding time range (eg last N minutes, last N seconds, ...)

Show me the code !

##Step 1 : Setup Redis connection & Toppler Settings

    Top.Setup(redisConfiguration: "localhost:6379");

the string parameter is the redis configuration for SE.Redis Read more on available options here

Note : additional parameters are available for advanced usage.

Step 2 : Add hit(s) (when something interesing happened)

    //somewhere
    Top.Counter.HitAsync("myevent");
    //elsewhere
    Top.Counter.HitAsync("myevent");

Step 3 : Get Top events

//get all for the current day
var tops = await Top.Ranking.AllAsync(Granularity.Day);
//returns "myevent", 2

That'all ! Many additional options are available to manage granularities, resolutions, contexts, ... Read the wiki (Coming soon).

Acknowledgements

License

Licensed under the terms of the MIT License

Want to contribute ?

  • Beginner => Download, Star, Comment/Tweet, Kudo, ...
  • Amateur => Ask for help, send feature request, send bugs
  • Pro => Pull request, promote

Thank you

You can’t perform that action at this time.