Skip to content

Commit

Permalink
Improves profiling rendering
Browse files Browse the repository at this point in the history
Change-Id: I76d1e06b266c51a92afcfbaee2396f442a458c11
  • Loading branch information
wpiers authored and ylussaud committed Feb 20, 2023
1 parent 2b50a14 commit de20428
Show file tree
Hide file tree
Showing 56 changed files with 10 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.eclipse.acceleo.aql.ls.profile;

import org.eclipse.acceleo.Block;
import org.eclipse.acceleo.ExpressionStatement;
import org.eclipse.acceleo.TextStatement;
import org.eclipse.acceleo.aql.IAcceleoEnvironment;
import org.eclipse.acceleo.aql.evaluation.AcceleoEvaluator;
Expand Down Expand Up @@ -58,6 +60,7 @@ public Object doSwitch(EObject eObject) {
* @return <true> if the element must not appear in the profiling result.
*/
private boolean filter(EObject eObject) {
return eObject instanceof TextStatement;
return eObject instanceof TextStatement || eObject instanceof ExpressionStatement
|| eObject instanceof Block;
}
}
1 change: 1 addition & 0 deletions plugins/org.eclipse.acceleo.aql.profiler.edit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import java.text.NumberFormat;

import org.eclipse.acceleo.aql.profiler.LoopProfileEntry;
import org.eclipse.acceleo.aql.profiler.provider.LoopProfileEntryItemProvider;
import org.eclipse.acceleo.aql.profiler.provider.ProfilerEditPlugin;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EObject;

Expand Down Expand Up @@ -62,7 +60,7 @@ public String getText(Object object) {
format.setMaximumFractionDigits(2);

return format.format(loopProfileEntry.getPercentage()) + "% / " + loopProfileEntry.getDuration() //$NON-NLS-1$
+ "ms / " + loopProfileEntry.getCount() + " times [" //$NON-NLS-1$ //$NON-NLS-2$
+ "ms / " + loopProfileEntry.getCount() + " times " + monitored.eClass().getName() + " [" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ProfilerEditPlugin.LABEL_PROVIDER.getText(monitored) + "]"; //$NON-NLS-1$
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import java.text.NumberFormat;

import org.eclipse.acceleo.aql.profiler.ProfileEntry;
import org.eclipse.acceleo.aql.profiler.provider.ProfileEntryItemProvider;
import org.eclipse.acceleo.aql.profiler.provider.ProfilerEditPlugin;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EObject;

Expand Down Expand Up @@ -62,7 +60,7 @@ public String getText(Object object) {
format.setMaximumFractionDigits(2);

return format.format(profileEntry.getPercentage()) + "% / " + profileEntry.getDuration() + "ms / " //$NON-NLS-1$ //$NON-NLS-2$
+ profileEntry.getCount() + " times [" + ProfilerEditPlugin.LABEL_PROVIDER.getText(monitored) //$NON-NLS-1$
+ "]"; //$NON-NLS-1$
+ profileEntry.getCount() + " times " + monitored.eClass().getName() + " [" //$NON-NLS-1$ //$NON-NLS-2$
+ ProfilerEditPlugin.LABEL_PROVIDER.getText(monitored) + "]"; //$NON-NLS-1$
}
}
1 change: 1 addition & 0 deletions plugins/org.eclipse.acceleo.aql.profiler.editor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions plugins/org.eclipse.acceleo.aql.profiler/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
1 change: 0 additions & 1 deletion plugins/org.eclipse.acceleo.aql.profiler/bin/.gitignore

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit de20428

Please sign in to comment.