Waterfall/BungeeCord-Patches/0050-Report-slow-events-in-milliseconds.patch
Shane Freeder 3a793b886c
Updated Upstream (BungeeCord)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
d8c222ae Update date
d20e622b Apply checkstyle to javadoc
6c8a0cce Remove m2e settings, causes useless warnings
2f547f73 Fix some javadoc warnings
5f29e939 #2720: Send different log message for pings (vs login)
46521568 #2740: Fix BaseComponent#equals() stack overflow
d2ceccd6 #2725: Various improvements to chat API
7ed4c41d #2723: Improved Send Command
2020-01-06 19:43:23 +00:00

32 lines
1.3 KiB
Diff

From cdc746a9ee1c083ea0598a553647e17498fde3bc Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 26 Mar 2019 04:28:18 +0000
Subject: [PATCH] Report slow events in milliseconds
nanoseconds is an overly accurate measurement for event handers, and
only ends up confusing and overly worrying people.
milliseconds is a much more normal and expected measurement in the
community, especially when we do not care about nanosecond level
accuracy.
diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java
index 11abcbb7..5b99c84a 100644
--- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java
+++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java
@@ -438,9 +438,9 @@ public class PluginManager
long elapsed = System.nanoTime() - start;
if ( elapsed > 250000000 )
{
- ProxyServer.getInstance().getLogger().log( Level.WARNING, "Event {0} took {1}ns to process!", new Object[]
+ ProxyServer.getInstance().getLogger().log( Level.WARNING, "Event {0} took {1}ms to process!", new Object[] // Waterfall - human values
{
- event, elapsed
+ event, elapsed / 1000000 // Waterfall - human values
} );
}
return event;
--
2.24.1