BukkitInsider
BukkitInsider: inspect events and plugins. On the fly.
Version: 1.4
This quick, small and dirty plugin is able to get all event subscriptions and list them to you. Also, of particular interest is the ability to calculate average time to process a certain event.
Some technical details: it works partly because of some black magic called Reflections. I substitute Bukkit's own PluginManager with my own that is very similar to the original, but allows me to intercept all events prior to another plugins and pull out my millisecond-precise stopwatch. Please note that this may add a few nanoseconds to the bill.
As you might know, black magic doesn't like to cooperate, so if you have any other plugin that does its own sacred rituals, be aware of possible bad interaction.
Screenshot:
Commands:
- introspect - dumps information about event hooks into console. You can call it from chat though, but you won't get any output. Requires you to be an Op. Amount of imformation is just huge, you just won't see everything in that tiny Minecraft chat.
Bukkit 1.1 introduces a new event system. This plugin will have to be updated to use it.
It worked when I was running 1.0.1, but with 1.1 all sorts of errors happen at startup. This is one such example:
2012-01-18 02:43:24 [INFO] This server is running Craftbukkit version git-Bukkit-1.0.1-R1-92-ga260c85-b1782jnks (MC: 1.1) (Implementing API version 1.1-R1-SNAPSHOT)
2012-01-18 02:43:25 [INFO] [LogBlock] Version check: Your version is up to date
2012-01-18 02:43:25 [INFO] [LogBlock] Connecting to 2194@jdbc:mysql://mysqlus2.fragnet.net:3306/2194_clientdb...
2012-01-18 02:43:26 [INFO] [BukkitInsider] Loading BukkitInsider v1.1.
2012-01-18 02:43:26 [INFO] [BukkitInsider] Injecting reflection...
2012-01-18 02:43:26 [INFO] [BukkitInsider] Reflection OK, now able to intercept.
2012-01-18 02:43:26 [INFO] BukkitInsider loaded. Use /introspect to get some info.
2012-01-18 02:43:26 [INFO] [CleanroomGenerator] Loading CleanroomGenerator v0.0.4.
2012-01-18 02:43:26 [INFO] CleanroomGenerator version 0.0.4 is enabled!
2012-01-18 02:43:26 [INFO] [Vault] Loading Vault v1.2.5-b59.
2012-01-18 02:43:26 [SEVERE] Error occurred while enabling Vault v1.2.5-b59 (Is it up to date?): org.bukkit.plugin.RegisteredListener.<init>(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Event$Priority;Lorg/bukkit/plugin/Plugin;Lorg/bukkit/event/Event$Type;)V
java.lang.NoSuchMethodError org.bukkit.plugin.RegisteredListener.<init>(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Event$Priority;Lorg/bukkit/plugin/Plugin;Lorg/bukkit/event/Event$Type;)V
at im.creep.bukkitinsider.smartassery.SmartassPluginManager.registerEvent(SmartassPluginManager.java:53)
at net.milkbowl.vault.permission.plugins.Permission_PermissionsBukkit.<init>(Permission_PermissionsBukkit.java:34)
at net.milkbowl.vault.Vault.loadPermission(Vault.java:316)
at net.milkbowl.vault.Vault.onEnable(Vault.java:107)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:232)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:1034)
at im.creep.bukkitinsider.smartassery.ModifiableSimplePluginManager.enablePlugin(ModifiableSimplePluginManager.java:273)
at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:190)
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:173)
at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:132)
at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52)
at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:407)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
Just a heads up for preparing a 1.1 supported release.
Having 2 issues:
Trouble passing WORLD_INIT to a plugin named ChunkScrambler, only occurs with BukkitInsider loaded:
2012-01-16 17:41:40 [SEVERE] Could not pass event WORLD_INIT to ChunkScrambler java.lang.NullPointerException at im.creep.bukkitinsider.smartassery.SmartassPluginManager.callEvent(SmartassPluginManager.java:93) at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:287) at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:175) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:407) at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
Unhandled exception when performing introspect all (output to file still succeeded however):
2012-01-16 17:45:27 [WARNING] Unexpected exception while parsing console command org.bukkit.command.CommandException: Unhandled exception executing command 'introspect' in plugin BukkitInsider v1.1 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:385) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:381) at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:573) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:550) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434) at net.minecraft.server.ThreadServerApplication.run(SourceFile:465) Caused by: java.lang.NullPointerException at im.creep.bukkitinsider.printers.IntrospectionPrinter.eventSubscription(IntrospectionPrinter.java:113) at im.creep.bukkitinsider.BukkitIntrospector.introspectRegisteredListener(BukkitIntrospector.java:175) at im.creep.bukkitinsider.BukkitIntrospector.introspectEvent(BukkitIntrospector.java:163) at im.creep.bukkitinsider.BukkitIntrospector.introspectAll(BukkitIntrospector.java:145) at im.creep.bukkitinsider.BukkitIntrospector.introspect(BukkitIntrospector.java:66) at im.creep.bukkitinsider.BukkitInsiderPlugin.onCommand(BukkitInsiderPlugin.java:82) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) ... 7 more
Thanks for such an incredibly useful tool!
Same as Etsija here, Mike Primm mentioned BukkitInsider and I have found gold! Thanks for such a valuable tool!
May I compliment you on a real lifesaver plugin! We have been experiencing some serious lag problems on our server, and I have been wishing for weeks for this kind of plugin. Luckily, Mike Primm (dynmap's author) hinted on this. It is JUST the tool I need - being able to pinpoint, which of the plugins hog the processing power, is a killer app. Well done!
And r7 404's.
Ohhhhh this is spectacular. Giving her a shot tonight.
I tried a couple methods of zipping it up into a jar, but I just do not know what to do with the r6 release. Guide?
@MonsterTKE Well, it's not huge - it is two Longs for each listener and two Longs for each event, so probably not. I didn't use pex's debug, so can't say anything about it - including whether it does the same as this plugin with the same methods.
This just logs how many times each event was called and how long did it take for each listener to process it - it doesn't log the time events arrived, nothing like that.
@darkslayer201 I am not surprised - Spout has something to do with pluginManager, and I substitute it - so there's probably a conflict. I'll see what I can do.
This plugin seems to conflict with spout. Keep getting those "Cannot pass {EVENT} to Spout" errors with basically every event.
This is pretty cool..... People have been clamoring for a way to monitor individual plugins from the beginning. This looks like the beginnings of that.
I wonder if this will kill a large server though, just due to the huge amount of data being pushed to the log? I have ran permissionsEX debug command a few times on my production server with 100 or so ppl on. Lets just say that the results arent pretty. 50 Mb log in 10 seconds and it kills the server.