Util [BETA] bStats - A modern alternative to McStats

Discussion in 'Resources' started by BtoBastian, Oct 21, 2016.


Are you going to use bStats?

  1. Yes

    6 vote(s)
  2. Maybe

    6 vote(s)
  3. No

    1 vote(s)
Thread Status:
Not open for further replies.
  1. bStats
    Plugin Metrics made with ❤

    Hello and welcome!

    Today I want to show you my latest project I'm working on the last 2-3 month: bStats.

    What is bStats?

    bStats is a service/website which collects data for plugins. I started developing it about 3 month ago, because I was pretty annoyed that McStats was down for weeks (the last two month it was stable again) and I couldn't find any alternatives. In the first place it was intended to be only used by me and some friends, but finally I decided to make it accessible to everyone who wants to use it. bStats is still in development, but already supports everything a good metrics service should have.

    How do I use bStats?

    bStats is as very easy to setup. It's done in less than 5 minutes: All you need to do is to add the Metrics class to your plugin and register the plugin on the website. Just take a look here: Getting started.

    Are custom charts supported?

    Yes! Custom charts are very easy to implement.
    Let's say your plugin supports serveral languages which can be toggled in the config.yml and you want to know which languages are the most used:
    1. @Override
    2. public void onEnable() {
    3. Metrics metrics = new Metrics(this);
    4. metrics.addCustomChart(new Metrics.SimplePie("used_language") {
    5. @Override
    6. public String getValue() {
    7. return getConfig().getString("language", "en");
    8. }
    9. });
    10. }

    The result may look like this one:
    (Live preview)

    A more detailed tutorial on how to setup custom charts can be found here.

    What features are planned for the future
    Though there are already lot's of features which are still missing but planned:
    • More custom chart types (e.g. map charts)
    • Signature images!
    • Plugin Ranking
    • Customizable plugin page (e.g. adding a description)
    • Profile pages for developers (optional)
    • Support for Bungeecord, Sponge, ...
    • Maven Repo!
    • Login with GitHub, Google, Twitter, ...
    • A documented REST-Api.
    • ...
    Sounds great! Can I support you?
    The best way to support me/bStats is to try it and give me feedback:
    • Do you like the design of the website? Would you make things different?
    • Did you find any bugs?
    • Are all tutorials/descriptions clear or do you have any trouble using the service?
    • Are there any spelling or grammar mistakes? English isn't my mother tongue so there might be some mistakes.
    • Are you missing some charts?
    Beta? Is it already safe to use?

    There may be some small downtimes or in the worst case lost data, but's it's already very stable. Futures versions of bStats will be completely downwards compatible so you can already integrate bStats in your plugin without being afraid it may break in the future. I already use bStats for my own plugin (SafeTrade), so it's in my own interest not to break anything. :)

    Useful links

    Why does the website look so ugly on my browser?
    Sadly some adblockers (mainly uBlock) block some content of the website incorrectly because of it's name (There seems to be an ad service with bstats in its name...). Please disable the adblocker for this website to fix it. Don't be afraid, there aren't any ads. I already reported it as incorrectly blocked and waiting for the response (Thread link). I hope the problem is fixed soon.

    Update: bstats.org has been removed from the blacklist. Update your filters (or wait till your adblocker does it itself) and the problem is solved. :)
    Last edited: Jan 3, 2017
    Skyost likes this.
  2. Offline

    I Al Istannen

    You can find the domain "/bstats." on EasyList (Easy Privacy), which made uBlock go on a rampage.
    I have no idea why, maybe there is another service this filter was made for, or it is aimed at you?

    Just wanted to tell you that though :p

    Apart from that I have no experienced with metrics sites whatsoever, but it looks quite pleasant. A bit simplicistic, but that adds to it :p
    Last edited: Oct 21, 2016
  3. Offline


    @I Al Istannen @BtoBastian
    I also have uBlock (something everyone should have) and should be common with most devs/users that join your sever. *You may want to add something letting other devs know that they will have to turn off their add block if they want to go to your site. Hopefully they may be able to make an exception for your server.

    I have a few recommendations:
    • Add a "Copy to clipboard" button for your class. Should not have to scroll through all one-thousand lines just to copy it.
    • Instead of letting the Dev decide where your class should be located, you should specify a package. (For example, you can use 'com.bstats' for your package name.)
    • Adding an "Add Plugin" button to bar at the top of the page.
    • Adding a "Find a plugin" or "List all plugins that use bStat" page.
    Last edited: Oct 21, 2016
    I Al Istannen and bwfcwalshy like this.
  4. Thank you for your feedback.

    - A "Copy to clipboard" button is a great idea (a good alternative atm is to click on "view raw" and using Ctrl+A).
    - The package should be different for every plugin, otherwise there might be problems with the ClassLoader (I'll check this).
    - Good idea. I'll try and See how it looks.
    - A search function is planed together with the ranking.
  5. Offline



    BTW: It seems I forgot to add this to my original post.
    Since that is a deterrent for people who may want to use your site, letting them know why they are receiving this message will help keep them.
  6. I added a FAQ entry.
  7. Hey,
    It's time for an update: The last month I was very busy rewriting and cleaning up (nearly) the whole backend + database design.
    The changes were necessary to support all the different server types out there (Bukkit / Spigot, Bungeecord, Sponge, ...) without messing everything up like McStats did. bStats will have it's own charts and global stats for them. The Metrics classes aren't ready, but I'll try to publish them ASAP.

    But there are also some changes on the frontend:
    • Charts can now be reordered:
      Reodering (open)
    • There is now a list with all plugin: https://bstats.org/plugin-list (Looks very weird on mobile devices...)
    • The REST-API is finished and the documentation is coming soon, too: https://bstats.org/api/v1/plugins
    • The "Operating System" pie is now a Drilldown Pie.
    • Backend support for 3 different server types (even though there's only a Metrics-class for Bukkit / Spigot atm)
      Server software (open)

    I'll also publish the source code of bStats in the next few days on GitHub.
    Last edited: Nov 20, 2016
  8. Offline


    Oh man, this looks so good :D
  9. Offline


    @BtoBastian I was afraid I was necroposting, but then I looked at the number of things posted in this subforum, and realized I really wasn't. XD

    This is really cool. I'll be using it with all of my new plugins now, as MCStats is done. However, I wanted to give you a warning. Be careful about how often this plugin makes callbacks to the server and how much data it sends. MCStats is as unreliable as it is because they are pretty much DDOSing themselves: over a thousand queries a SECOND. Be careful!
    bwfcwalshy likes this.
  10. bStats doesn't care how many bStats plugins are used on one server because it submits all data in one single requests instead of McStats which sends a request for every plugin.
    I already did some calculations based on the data on http://McStats.org/status :
    With the same amount of servers as McStats has, bStats would "only" get ~70 requests per second.
  11. Offline


    @BtoBastian, not bad at all... How did you manage to pull that off with the same class running in potentially dozens of different namespaces? Statics wouldn't work.
  12. @Tecno_Wizard
    Looking at the code, it seems he uses Bukkit's ServiceManager to register a service, making sure to only add it if another plugin hasn't already registered it. It's quite a clever approach if I do say so myself.
  13. Hey,
    Happy New Year Everyone!

    Fist of all I want to say Thank You for the great support!
    At the moment bStats is actively used by over 40 plugins with a total amount of nearly 100 registered plugins.
    These plugins run on ~ 1'500 servers (Bukkit + Sponge) sending over 78'000 requests per day.
    Thank you very much!

    You may be interessted what has been changed in the last month:
    • Added support for Sponge.
    • Added support for Bungeecord (today!).
    • bStats is now Open Source!
    • Lot's of smaller improvements.
    • Bugfix: Improved filters. Some servers were wrongly throttled. This has been fixed now. (Which is the reason for the huge increase of +300 servers)
    Last edited: Jan 3, 2017
    Zombie_Striker likes this.
Thread Status:
Not open for further replies.

Share This Page