mirror of
https://github.com/PaperMC/Waterfall.git
synced 2025-01-03 22:47:38 +01:00
32 lines
1.3 KiB
Diff
32 lines
1.3 KiB
Diff
From 89fc27a7357e908a0ab107d90dd982a55d266a41 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.24.0
|
|
|