Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Measuring file load time
Measuring file load time [message #903735] Sat, 25 August 2012 05:26 Go to next message
Alexander Jiteg is currently offline Alexander Jiteg
Messages: 14
Registered: August 2012
Junior Member
I'm trying to develope a plugin that measures the amount of time it takes for files to be loaded from the file system into Eclipse.

I have looked adround for a suitable listener to use to capture some kind of file load event but not been able to find any. Does such exist or do I have to dig into Eclipse's source code to create the missing hooks?
Re: Measuring file load time [message #904508 is a reply to message #903735] Tue, 28 August 2012 10:56 Go to previous messageGo to next message
Alexander Jiteg is currently offline Alexander Jiteg
Messages: 14
Registered: August 2012
Junior Member
So I managed to take this one step further.

By hooking in to EFS in my plugin and overriding the file system to use for schema "file:" I've been able to monitor the call to openInputStream() that Eclipse uses to read files from the local file system.

I'm then thinking of using the IPartListener.partActivated() to decide when the file has been loaded and opened in Eclipse.

I'm not sure if this is a good approach but it seems like a working solution?
Re: Measuring file load time [message #905115 is a reply to message #904508] Wed, 29 August 2012 14:08 Go to previous messageGo to next message
Alexander Jiteg is currently offline Alexander Jiteg
Messages: 14
Registered: August 2012
Junior Member
Continuing my monologue here.

Seems that my "hook" using EFS is of no use if the file is inside an open work space. Can't figure out why my override is not used then.

Seems that I need another solution after all.
Re: Measuring file load time [message #906050 is a reply to message #903735] Fri, 31 August 2012 10:19 Go to previous messageGo to next message
Curtis Windatt is currently offline Curtis Windatt
Messages: 166
Registered: July 2009
Senior Member
Have you checked out the tracing options that core resources provides? Perhaps they already have some debug tracing that collects information on load times. If they provide some information you could lookup where that information is collected and add additional steps.
Re: Measuring file load time [message #906067 is a reply to message #906050] Fri, 31 August 2012 10:50 Go to previous messageGo to next message
Alexander Jiteg is currently offline Alexander Jiteg
Messages: 14
Registered: August 2012
Junior Member
No I haven't. Can you please guide me to some useful documentation regarding this?

For now I have modified the source code for the org.eclipse.core.filesystem-plugin which handles the communication with the local file system. By doing that I've been able to trigger my own file opened/saved events when input and output streams are created. This works pretty well but I'm not very keen of the idea, having to modify the internal eclipse plugins to get the job done.

Thanks for you effort!

/Alex
Re: Measuring file load time [message #910799 is a reply to message #906067] Mon, 10 September 2012 08:07 Go to previous messageGo to next message
Alexander Jiteg is currently offline Alexander Jiteg
Messages: 14
Registered: August 2012
Junior Member
So I found out about the debug print out capabilities of the Eclipse core plugins (adding -debug and specifying the details in the .options-file to get them visible).

Now I want to catch the System.out-calls from the core plugins to be able to process the contents of them in my plugin. I've seen the org.eclipse.ui.console.consolePatternMatchListeners extension point but I guess it's of no help since the System.out is directed outside Eclipse.

Re: Measuring file load time [message #910897 is a reply to message #910799] Mon, 10 September 2012 11:26 Go to previous message
Curtis Windatt is currently offline Curtis Windatt
Messages: 166
Registered: July 2009
Senior Member
It depends on how the tracing options are supported in the plug-in you are looking at. OSGi has a variety of option to redirect tracing output, but many Eclipse plug-ins handle tracing by writing directly to system out, bypassing any settings.

Your plugin can modify the OSGi settings at runtime. Ankur wrote a blog post talking about it. You can also look at the code in org.eclipse.ui.tracing (owned by PDE UI). As there we make the options visible on a preference page.

http://blog.ankursharma.org/2011/12/osgi-tracing-in-equinox.html
Previous Topic:how to organize imports via command
Next Topic:developing a command line tool building on Eclipse plugins
Goto Forum:
  


Current Time: Wed Aug 27 19:20:17 EDT 2014

Powered by FUDForum. Page generated in 0.02260 seconds