Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 170540

Summary: Create servlets for uploading data to mylar.eclipse.org
Product: z_Archived Reporter: meghan <meghan_allen>
Component: MylynAssignee: meghan <meghan_allen>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: mik.kersten, nhapke, robert.elves, steffen.pingel
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 178604    
Attachments:
Description Flags
zip of this package
none
patch with servlets
none
mylar/context/zip
none
updated patch for servlets
none
adds the javax servlet library none

Description meghan CLA 2007-01-15 16:01:02 EST
Create servlets to run on Tomcat at mylar.eclipse.org to accept usage data being uploaded.
Comment 1 meghan CLA 2007-01-15 18:30:01 EST
Mik, what would be the best way to submit this package?  I have it in /isd/se2/project/mylar/cvs, called org.eclipse.mylar.monitor.usage.upload right now.  Should I just create a .zip of the whole package and attach that?  Or, should I move it into the org.eclipse.mylar.monitor.usage package and just create a patch?  I'm not too sure where it's going to end up, which is why I'm not sure what to do with it right now.
Comment 2 meghan CLA 2007-01-19 13:21:58 EST
I'm attaching a zip of this...  Please let me know if I need to move it around before it can be committed.  The zip includes the external libraries (apache commons-io and apache fileupload).  I thought it was best to include them for completeness, but I guess they should be removed before it's committed?
Comment 3 meghan CLA 2007-01-19 13:22:34 EST
Created attachment 57158 [details]
zip of this package
Comment 4 Mik Kersten CLA 2007-01-21 22:02:17 EST
I figure that these should go into either 1) a sandbox/org.eclipse.mylar.monitor.server project that I can create, or into 2) a servlets folder under org.eclipse.mylar.monitor.usage.  That servlets folder can be a source folder, but we wouldn't distribute it.  How many files is this in total?

Once we figure out what to do, I'll get you to make a patch.  But could you first check if commons-io and apache fileupload are Orbit projects?  If they're not, then we need to go with option (1), since the Sandbox can have external dependencies.
Comment 5 Eugene Kuleshov CLA 2007-01-21 22:09:35 EST
+1 for mylar.server project. It should be easy to build a war file from those...
Comment 6 meghan CLA 2007-01-22 12:52:59 EST
They are not in Orbit.  So, I guess we'll go with option 1.  Let me know when the project is ready and then I'll create a patch.  There are 2 .java files so far in WEB-INF/src, but I have a 3rd I'd like to add which will show a brief summary of the data that has been uploaded and we need to include the WEB-INF/web.xml file too.
Comment 7 Mik Kersten CLA 2007-01-25 15:22:16 EST
*** Bug 114124 has been marked as a duplicate of this bug. ***
Comment 8 Mik Kersten CLA 2007-01-26 14:38:11 EST
Meghan: I have created the sandbox/org.eclipse.mylar.monitor.server project, and you should now create patches for that.  As for the Apache libraries:
* Add the libraries to the "lib" folder.  
* Create a .cvsignore file in that folder, and add the name of each library so that it is not checked in
* Add a link to each library into lib/readme.txt, so that it's easy for others to download
Comment 9 meghan CLA 2007-01-29 01:25:37 EST
thanks Mik, I'll make a patch tomorrow.
Comment 10 meghan CLA 2007-01-29 12:48:14 EST
just trying to move the stuff from the old project to this new project, and I'm wondering if the new project needed to be created as a Tomcat project? The structure in the current project is: WEB-INF/src/upload/*.java, WEB-INF/web.xml, and WEB-INF/lib/*.jar but the new project is just a normal java project (I think) and it won't let me mimic the structure of the other project.
Comment 11 Mik Kersten CLA 2007-01-29 14:33:59 EST
Feel free to make it whatever kind of project you like.  You should be able to do that by having the files be in the spots that the Tomcat support expects (is it WTP you're using?), and also copying the appropriate nature and builders into the .project file in that project.  Might be easiest to just copy over the entire .project (and maybe also .classpath) file, and then just change the project name to be the right one (should be first entry in .project file).
Comment 12 meghan CLA 2007-02-09 13:42:36 EST
Created attachment 58678 [details]
patch with servlets

This patch contains the necessary chages to the project and 3 servlets, 1 to get a user id, 1 to upload data and 1 to show the (very simple) usage analysis.
Comment 13 meghan CLA 2007-02-09 13:42:37 EST
Created attachment 58679 [details]
mylar/context/zip
Comment 14 meghan CLA 2007-02-09 13:45:21 EST
The (very simple) Usage Analysis servlet just reads a text file and displays it.  There is a java class that reads the uploaded data and populates this text file - I will set that up as a cron job to run daily.  The output looks like this (on sample data):

Total events: 153671
Number of unique users: 8

10 most used views:
14.12%: org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart (21712)
12.70%: org.eclipse.jdt.ui.PackageExplorer (19528)
12.27%: org.eclipse.jdt.ui.CompilationUnitEditor (18857)
10.96%: org.eclipse.jst.jsp.core.jspsource.source (16845)
6.78%: org.eclipse.mylar.java.ui.editor.MylarCompilationUnitEditor (10419)
4.04%: org.eclipse.ui.DefaultTextEditor (6218)
4.03%: org.eclipse.wst.html.core.htmlsource.source (6202)
3.93%: org.eclipse.pde.ui.manifestEditor (6041)
3.58%: org.eclipse.team.sync.views.SynchronizeView (5515)
3.53%: com.something.eclipse.shelled.ui.editors.SHEditor (5437)


This could obviously be easily added to...
Comment 15 Mik Kersten CLA 2007-02-09 16:39:59 EST
When it's working can you point me at the URL to try it out?
Comment 16 meghan CLA 2007-03-21 12:49:42 EDT
Created attachment 61568 [details]
updated patch for servlets

The project used to be building the .class files to /bin, but this became a problem when I tried to deploy it becuase Tomcat expects the .class files to be in /WEB-INF/classes/packageName - this patch fixes the error.
Comment 17 Mik Kersten CLA 2007-03-22 13:51:43 EDT
Patch applied.  I got the commons-fileupaload-1.2 instead of 1.1.1.  The only problem I saw is that we still need the javax servlet stuff, and you seem to be getting the dependencies from your C:

Severity and Description	Path	Resource	Location	Creation Time	Id
Project 'org.eclipse.mylar.monitor.server' is missing required library: 'C:\Temp\tomcat\apache-tomcat-6.0.2\lib\servlet-api.jar'		org.eclipse.mylar.monitor.server	Build path	1174585662384	766198

What's the right place to get this from?  Please update the readme.txt when you get that too.  Note that I've added the libraries to a .cvsignore file in the WEB-INF/lib directory.
Comment 18 meghan CLA 2007-03-22 17:30:54 EDT
Created attachment 61754 [details]
adds the javax servlet library
Comment 19 meghan CLA 2007-03-22 17:32:25 EDT
I updated the readme.txt, but I'm not sure if I've got the .cvsignore file working correctly.  I created one (and thought it was included in the last patch), but I guess it wasn't - sorry about that.  Let me know if this change fixes the problem with the javax.servlet stuff.
Comment 20 Mik Kersten CLA 2007-03-22 18:22:25 EDT
Patch applied.  Anything left on this bug?
Comment 21 meghan CLA 2007-03-22 18:33:22 EDT
no, I don't think so
Comment 22 meghan CLA 2007-05-15 17:53:37 EDT
I think this one can be closed.
Comment 23 Mik Kersten CLA 2007-05-16 13:33:28 EDT
Great, closing.
Comment 24 Eugene Kuleshov CLA 2007-05-16 15:11:28 EDT
Hmm. It seems like stats pages as well as upload pages are down...
Comment 25 Mik Kersten CLA 2007-05-16 21:17:38 EDT
Argh, the server keeps crashing.  Steffen, Rob, any ideas?  This feature is now live so we need to figure out a way to ensure that the server stays running.
Comment 26 Steffen Pingel CLA 2007-05-16 21:28:46 EDT
Putting the JIRA repository on a separate server would be a good start (assuming that the monitor servlet does not have a terrible memory leak): bug 178392.
Comment 27 Mik Kersten CLA 2007-05-16 21:45:30 EDT
The monitor servlet could easily use up a large amount of memory because the analysis puts each interaction event in memory.  The servlet needs to make sure that there are no references to the events (e.g. in maps) after each run.  

Meghan: could you create a new bug to look into this?