Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 66773 Details for
Bug 184564
show top N commands/actions on the community stats web page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
adds command usage and uses tables to display the data
patch184564.txt (text/plain), 13.10 KB, created by
meghan
on 2007-05-10 16:25:20 EDT
(
hide
)
Description:
adds command usage and uses tables to display the data
Filename:
MIME Type:
Creator:
meghan
Created:
2007-05-10 16:25:20 EDT
Size:
13.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.monitor.server >Index: WEB-INF/src/upload/UsageAnalysis.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/sandbox/org.eclipse.mylar.monitor.server/WEB-INF/src/upload/UsageAnalysis.java,v >retrieving revision 1.1 >diff -u -r1.1 UsageAnalysis.java >--- WEB-INF/src/upload/UsageAnalysis.java 22 Mar 2007 17:51:57 -0000 1.1 >+++ WEB-INF/src/upload/UsageAnalysis.java 10 May 2007 20:23:24 -0000 >@@ -6,11 +6,17 @@ > import java.io.InputStream; > import java.io.PrintStream; > import java.io.PrintWriter; >+import java.text.DateFormat; >+import java.text.SimpleDateFormat; > import java.util.ArrayList; >+import java.util.Calendar; > import java.util.Collections; >+import java.util.Date; > import java.util.HashMap; >+import java.util.Iterator; > import java.util.List; > import java.util.Map; >+import java.util.StringTokenizer; > import java.util.zip.ZipEntry; > import java.util.zip.ZipFile; > >@@ -21,23 +27,30 @@ > Map<Integer, Integer> usersNumSelections = new HashMap<Integer, Integer>(); > > Map<String, Integer> totalNumSelections = new HashMap<String, Integer>(); >- >+ >+ Map<String, Integer> totalNumCommands = new HashMap<String, Integer>(); >+ > final static String USAGE_DIRECTORY = MylarUsageUploadServlet.UPLOAD_DIRECTORY; >- >+ > final static String LOGGING_DIRECTORY = "home//study//logging//"; >- >+ > final static String ERROR_LOGGING_FILE = "MylarUsageAnalysisErrorLog.txt"; > > final static String USAGE_SUMMARY_FILE = "usageSummary.txt"; > > int MAX_NUM_VIEWS_TO_REPORT = 10; > >+ int MAX_NUM_COMMANDS_TO_REPORT = 25; >+ > int totalSelections = 0; > >- public static void main(String []args) { >+ int totalCommands = 0; >+ >+ public static void main(String[] args) { > UsageAnalysis ua = new UsageAnalysis(); > ua.analyzeLogs(); > } >+ > public void analyzeLogs() { > > try { >@@ -50,6 +63,7 @@ > userID = this.getUserId(currFile); > > int numSelections = 0; >+ int numCommands = 0; > if (usersNumSelections.containsKey(userID)) { > numSelections = usersNumSelections.get(userID); > } >@@ -70,7 +84,8 @@ > String endTag = "</originId>"; > > String kindTag = "<kind>"; >- String matchKind = "selection"; >+ String selectionKind = "selection"; >+ String commandKind = "command"; > > // they should all be zip files, ignore anything that's not > if (currFile.getName().endsWith(".zip")) { >@@ -90,7 +105,9 @@ > int kindIndex = buf.indexOf(kindTag); > kindIndex += kindTag.length(); > >- if (buf.substring(kindIndex, kindIndex + matchKind.length()).equals(matchKind)) { >+ String currKind = buf.substring(kindIndex, kindIndex + selectionKind.length()); >+ >+ if (currKind.contains(selectionKind)) { > > numSelections++; > totalSelections++; >@@ -109,6 +126,17 @@ > int totalNumViews = totalNumSelections.get(currOriginId) + 1; > totalNumSelections.put(currOriginId, totalNumViews); > >+ } else if (currKind.contains(commandKind)) { >+ numCommands++; >+ totalCommands++; >+ currOriginId = buf.substring(index, endIndex); >+ >+ if (!totalNumCommands.containsKey(currOriginId)) { >+ totalNumCommands.put(currOriginId, 0); >+ } >+ >+ int currNumCommands = totalNumCommands.get(currOriginId) + 1; >+ totalNumCommands.put(currOriginId, currNumCommands); > } > > buf = buf.substring(endIndex + endTag.length(), buf.length()); >@@ -214,29 +242,98 @@ > > PrintStream summaryLogStream = new PrintStream(new FileOutputStream(summaryFile, true)); > >- summaryLogStream.println("Total events: " + totalSelections); >- summaryLogStream.println("Number of unique users: " + userToViewMap.entrySet().size()); >- summaryLogStream.println(); >+ summaryLogStream.println("<h2>Mylar Community Usage Statistics</h2>"); >+ summaryLogStream.println("These statistics are updated once per day. They were last updated at " >+ + DateFormat.getTimeInstance(DateFormat.DEFAULT).format(Calendar.getInstance().getTime()) + " " >+ + new SimpleDateFormat("z").format(Calendar.getInstance().getTime()) + " on " >+ + DateFormat.getDateInstance().format(Calendar.getInstance().getTime()) + "."); >+ summaryLogStream.println("<br><br>"); >+ >+ summaryLogStream.println("<b>Total events: " + (totalSelections + totalCommands) + "</b><br>"); >+ summaryLogStream.println("<b>Number of unique users: " + userToViewMap.entrySet().size() + "</b><br><br>"); >+ summaryLogStream.println(""); >+ >+ summaryLogStream.println("<b>" + " " + MAX_NUM_VIEWS_TO_REPORT + " most used views: </b>"); > >- summaryLogStream.println(MAX_NUM_VIEWS_TO_REPORT + " most used views:"); >+ summaryLogStream.println("<table border=1 rules=rows|columns cellpadding=4>"); > > List<String> viewUsage = new ArrayList<String>(); > for (String view : totalNumSelections.keySet()) { > float numSelections = (float) (totalNumSelections.get(view)); > float viewUse = numSelections / totalSelections; > String formattedViewUse = formatAsPercentage(viewUse); >- viewUsage.add(formattedViewUse + ": " + view + " (" + totalNumSelections.get(view) + ")"); >+ viewUsage.add(formattedViewUse + "," + view + "," + totalNumSelections.get(view)); > } > Collections.sort(viewUsage, new PercentUsageComparator()); > int numViewsToReport = 0; >- for (String viewUsageSummary : viewUsage) { >- if (MAX_NUM_VIEWS_TO_REPORT == -1 || numViewsToReport < MAX_NUM_VIEWS_TO_REPORT) { >+ Iterator<String> listIterator = viewUsage.iterator(); >+ while (listIterator.hasNext() >+ && (MAX_NUM_VIEWS_TO_REPORT == -1 || numViewsToReport < MAX_NUM_VIEWS_TO_REPORT)) { > >- summaryLogStream.println(viewUsageSummary); >- numViewsToReport++; >- } >+ String[] nextRow = listIterator.next().split(","); >+ >+ summaryLogStream.println("<tr>"); >+ >+ summaryLogStream.println("<td>"); >+ summaryLogStream.println(nextRow[0]); >+ summaryLogStream.println("</td>"); >+ >+ summaryLogStream.println("<td>"); >+ summaryLogStream.println(nextRow[1]); >+ summaryLogStream.println("</td>"); >+ >+ summaryLogStream.println("<td>"); >+ summaryLogStream.println(nextRow[2]); >+ summaryLogStream.println("</td>"); >+ >+ summaryLogStream.println("</tr>"); >+ numViewsToReport++; >+ } >+ >+ summaryLogStream.println("</table>"); >+ summaryLogStream.println("<br><br>"); >+ >+ summaryLogStream.println("<b>" + " " + MAX_NUM_COMMANDS_TO_REPORT + " most used commands: </b>"); >+ >+ //Commands >+ summaryLogStream.println("<table border=1 rules=rows|columns cellpadding=4>"); >+ >+ List<String> commandUsage = new ArrayList<String>(); >+ for (String cmd : totalNumCommands.keySet()) { >+ float numCommands = (float) (totalNumCommands.get(cmd)); >+ float commandUse = numCommands / totalCommands; >+ String formattedCmdUse = formatAsPercentage(commandUse); >+ commandUsage.add(formattedCmdUse + "," + cmd + "," + totalNumCommands.get(cmd)); >+ } >+ Collections.sort(commandUsage, new PercentUsageComparator()); >+ int numCommandsToReport = 0; >+ >+ Iterator<String> cmdListIterator = commandUsage.iterator(); >+ while (cmdListIterator.hasNext() >+ && (MAX_NUM_COMMANDS_TO_REPORT == -1 || numCommandsToReport < MAX_NUM_COMMANDS_TO_REPORT)) { >+ >+ String[] nextRow = cmdListIterator.next().split(","); >+ >+ summaryLogStream.println("<tr>"); >+ >+ summaryLogStream.println("<td>"); >+ summaryLogStream.println(nextRow[0]); >+ summaryLogStream.println("</td>"); >+ >+ summaryLogStream.println("<td>"); >+ summaryLogStream.println(nextRow[1]); >+ summaryLogStream.println("</td>"); >+ >+ summaryLogStream.println("<td>"); >+ summaryLogStream.println(nextRow[2]); >+ summaryLogStream.println("</td>"); >+ >+ summaryLogStream.println("</tr>"); >+ numCommandsToReport++; > } > >+ summaryLogStream.println("</table>"); >+ summaryLogStream.close(); > } catch (IOException e) { > logError(e.getMessage()); > } >Index: .refactorings/2007/5/19/refactorings.history >=================================================================== >RCS file: .refactorings/2007/5/19/refactorings.history >diff -N .refactorings/2007/5/19/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2007/5/19/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,7 @@ >+<?xml version="1.0" encoding="utf-8"?> >+<session version="1.0"> >+<refactoring accessors="true" comment="Delete 1 element(s) from project 'org.eclipse.mylar.monitor.server' - Original project: 'org.eclipse.mylar.monitor.server' - Original element: 'upload.InteractionEventSummarySorter.java'" description="Delete element" element1="/WEB-INF\/src<upload{InteractionEventSummarySorter.java" elements="1" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1178657596406" subPackages="false" version="1.0"/> >+<refactoring comment="Rename local variable 'matchKind' in 'upload.UsageAnalysis.analyzeLogs()' to 'selectionKind' - Original project: 'org.eclipse.mylar.monitor.server' - Original element: 'upload.UsageAnalysis.analyzeLogs().matchKind' - Renamed element: 'upload.UsageAnalysis.analyzeLogs().selectionKind' - Update references to refactored element" description="Rename local variable 'matchKind'" id="org.eclipse.jdt.ui.rename.local.variable" input="/WEB-INF\/src<upload{UsageAnalysis.java" name="selectionKind" references="true" selection="2266 9" stamp="1178748252765" version="1.0"/> >+<refactoring accessors="true" comment="Delete 5 element(s) from project 'org.eclipse.mylar.monitor.server' - Original project: 'org.eclipse.mylar.monitor.server' - Original elements: upload.CommandUsageCollector.java upload.InteractionByTypeSummary.java upload.InteractionEvent.java upload.InteractionEventSummary.java upload.InteractionEventUtil.java" description="Delete elements" element1="/WEB-INF\/src<upload{CommandUsageCollector.java" element2="/WEB-INF\/src<upload{InteractionEventUtil.java" element3="/WEB-INF\/src<upload{InteractionEventSummary.java" element4="/WEB-INF\/src<upload{InteractionByTypeSummary.java" element5="/WEB-INF\/src<upload{InteractionEvent.java" elements="5" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1178827320640" subPackages="false" version="1.0"/> >+<refactoring accessors="true" comment="Delete 1 element(s) from project 'org.eclipse.mylar.monitor.server' - Original project: 'org.eclipse.mylar.monitor.server' - Original element: 'upload.IUsageCollector.java'" description="Delete element" element1="/WEB-INF\/src<upload{IUsageCollector.java" elements="1" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1178827326515" subPackages="false" version="1.0"/> >+</session> >Index: .refactorings/2007/4/17/refactorings.history >=================================================================== >RCS file: .refactorings/2007/4/17/refactorings.history >diff -N .refactorings/2007/4/17/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2007/4/17/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,5 @@ >+<?xml version="1.0" encoding="utf-8"?> >+<session version="1.0"> >+<refactoring comment="Move 1 elements(s) to 'lib' - Original project: 'org.eclipse.mylar.monitor.server' - Destination element: 'lib' - Original element: 'commons-fileupload-1.2.jar'" description="Move file" element1="WEB-INF/lib/lib/commons-fileupload-1.2.jar" files="1" flags="589830" folders="0" id="org.eclipse.jdt.ui.move" policy="org.eclipse.jdt.ui.moveResources" qualified="false" references="true" stamp="1177699968406" target="/org.eclipse.mylar.monitor.server/WEB-INF/lib" units="0" version="1.0"/> >+<refactoring accessors="true" comment="Delete 1 element(s) from project 'org.eclipse.mylar.monitor.server' - Original project: 'org.eclipse.mylar.monitor.server' - Original element: 'lib'" description="Delete element" element1="WEB-INF/lib/lib" elements="0" flags="589830" id="org.eclipse.jdt.ui.delete" resources="1" stamp="1177699973515" subPackages="false" version="1.0"/> >+</session> >Index: .refactorings/2007/5/19/refactorings.index >=================================================================== >RCS file: .refactorings/2007/5/19/refactorings.index >diff -N .refactorings/2007/5/19/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2007/5/19/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+1178657596406 Delete element >+1178748252765 Rename local variable 'matchKind' >+1178827320640 Delete elements >+1178827326515 Delete element >Index: .refactorings/2007/4/17/refactorings.index >=================================================================== >RCS file: .refactorings/2007/4/17/refactorings.index >diff -N .refactorings/2007/4/17/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2007/4/17/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+1177699968406 Move file >+1177699973515 Delete element
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 184564
: 66773 |
66789