Solved Get the server tps.

Discussion in 'Spigot Plugin Development' started by JoseGamer_PT, May 12, 2016.

Thread Status:
Not open for further replies.
  1. Hello spigot community! So i am working in a scoreboard plugin.
    I try various types for getting tps.
    I want a efficiently tps checker!

    Thanks for your time!
    - Jose

    PS: I try this: https://bukkit.org/threads/get-server-tps.143410/
    But don't work.
     
  2. The amount of topics about this
    Wow
     
  3. ....
    Dolphins?

    Now, seriosly, can you help me? :3
     
  4. Another one of those threads where op just states that something is not working without ever explaining what and why.
     
    • Agree Agree x 2
  5. Basic idea:

    Run a task for a certain amount of time and compare the start time to the end time (real time, not ticks). Then you can compare that total run time to the time it was expected to run in ticks. Etc etc.
     
  6. If you use spigot's api, that has a getTPS method
     
  7. I gave up.
    Thanks for all help!
     
  8. Code (Text):
    double[] tps = MinecraftServer.getServer().recentTps;

    // ??
     
  9. NMS drama alert in 3.. 2.. 1..
     
    • Funny Funny x 3
  10. [​IMG]

    Sorry, had to :p
     
    #11 BillyGalbreath, May 13, 2016
    Last edited: May 13, 2016
    • Funny Funny x 8
    • Winner Winner x 3
  11. I would love to have an api like this but i dont think there is one. I tried for quite some time to find anything on an API for getting it. NMS doesn't count (I know about that way).
     
  12. getServer().spigot().getTPS()
     
  13. I only see spigot().broadcast(BaseCompenent) and spigot().restart() am I doing something wrong?
     
    • Agree Agree x 3
  14. Yeah, i don't see.
     
  15. anyone? :c
     
    • Informative Informative x 1
  16. @JoseGamer_PT actually read all the comments on this thread, then you will find the truth.
     
  17. Okay
    If you're using Spigot API
    Bukkit.getServer().spigot().getTPS()
    Code (Text):
    Bukkit.getServer().spigot().getTPS()
    then use maths to round it to the nearest 20 which I used is
    Code (Text):
       double tps = Bukkit.getServer().spigot().getTPS();
            E.G
    player.sendMessage("ChatColor.YELLOW + "TPS: " + Math.round(tps * 100.0D) / 100.0D);
    Please ask if there is any errors as I just made this up

    UPDATE: This only works with a non-affiliated spigot versions
    E.G Paper Spigot
     
    #19 MannyPlays, May 14, 2016
    Last edited: May 14, 2016
  18. Nope.
    http://prntscr.com/b3x910
     
Thread Status:
Not open for further replies.