Skip to content

a minimalist library to manage countings, rankings & overall leaderboard with Redis

License

Notifications You must be signed in to change notification settings

cybermaxs/Toppler

Repository files navigation

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

About

a minimalist library to manage countings, rankings & overall leaderboard with Redis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published