mirror of
https://github.com/PaperMC/Waterfall.git
synced 2025-01-19 06:02:02 +01:00
c331e7fd00
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.
32 lines
1.3 KiB
Diff
32 lines
1.3 KiB
Diff
From 2f6ad505879900bc8504ae63336e67f17b8cac8a 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 81bd18f0..9408e6c2 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
|
|
@@ -435,9 +435,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.21.0
|
|
|