Skip to content
Snippets Groups Projects
Commit 09633e39 authored by jeffliu's avatar jeffliu
Browse files

[93609] Performance: Need a way to verify that WTP plug-ins do not regress...

[93609] Performance: Need a way to verify that WTP plug-ins do not regress Eclipse platform performance
parent c570ca09
No related branches found
No related tags found
No related merge requests found
......@@ -502,12 +502,12 @@
<property name="performance.target.present" value="true"/>
<property name="extraVMargs" value="${perf.db} ${perf.config.wtp} ${perf.assert}"/>
</ant>
<mkdir dir="${build.home}/derby/eclipseperfgraphs"/>
<mkdir dir="${buildDirectory}/${buildLabel}/eclipsePerfResults"/>
<ant antfile="testScripts/test.xml" target="genPerfGraphs">
<property name="eclipseBuilderDirectory" value="${build.home}/${eclipse.builder}"/>
<property name="perf.ref.buildId" value="${buildType}${date}-${time}-base"/>
<property name="buildId" value="${buildType}${date}-${time}-wtp"/>
<property name="results" value="${build.home}/derby/eclipseperfgraphs"/>
<property name="results" value="${buildDirectory}/${buildLabel}/eclipsePerfResults"/>
</ant>
</target>
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src">
<attributes>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
bin
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>performance</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
package org.eclipse.wtp.releng.tools.performance;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Calendar;
public class Main
{
private static final String DOWNLOAD_URL = "http://download.eclipse.org/webtools/downloads/";
private static final String START = "href=\"drops/";
private static final String END = "/";
private static final String BUILD_TYPE_S = "S";
private static final String BUILD_TYPE_I = "I";
private static final String BUILD_TYPE_N = "N";
private static final String BUILD_TYPE_M = "M";
public static void main(String[] args)
{
int buildWeight = -1;
String buildType = null;
String buildId = null;
String date = null;
String time = null;
StringBuffer today = new StringBuffer();
Calendar c = Calendar.getInstance();
today.append(String.valueOf(c.get(Calendar.YEAR)));
int month = c.get(Calendar.MONTH) + 1;
if (month < 10)
today.append("0");
today.append(String.valueOf(month));
int dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
if (dayOfMonth < 10)
today.append("0");
today.append(String.valueOf(dayOfMonth));
try
{
URL url = new URL(DOWNLOAD_URL);
InputStream is = url.openConnection().getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String s = br.readLine();
while (s != null)
{
int sIndex = s.indexOf(START);
int eIndex = s.indexOf(END, sIndex + START.length());
while (sIndex != -1 && eIndex != -1)
{
String buildLabel = s.substring(sIndex + START.length(), eIndex);
if (buildLabel != null)
{
String[] buildFragments = buildLabel.split("-");
if (buildFragments.length > 2 && buildFragments[0].length() == 1 && buildFragments[2].length() == 12)
{
int weight = getWeigth(buildFragments[0]);
String type = buildFragments[0];
String id = buildFragments[1];
String d = buildFragments[2].substring(0, 8);
String t = buildFragments[2].substring(8, 12);
if (today.toString().equals(d) && weight > buildWeight)
{
buildWeight = weight;
buildType = type;
buildId = id;
date = d;
time = t;
}
}
}
sIndex = s.indexOf(START, eIndex + END.length());
eIndex = s.indexOf(END, sIndex + START.length());
}
s = br.readLine();
}
if (buildType != null && buildId != null && date != null && time != null)
{
BufferedWriter bw = new BufferedWriter(new FileWriter("label.properties"));
bw.write("buildType=");
bw.write(buildType);
bw.newLine();
bw.write("buildId=");
bw.write(buildId);
bw.newLine();
bw.write("date=");
bw.write(date);
bw.newLine();
bw.write("time=");
bw.write(time);
bw.newLine();
bw.close();
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
private static int getWeigth(String buildType)
{
if (BUILD_TYPE_S.equals(buildType))
return 40;
else if (BUILD_TYPE_I.equals(buildType))
return 30;
else if (BUILD_TYPE_N.equals(buildType))
return 20;
else if (BUILD_TYPE_M.equals(buildType))
return 10;
else
return 0;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment