Miscellaneous

HeikoKlare edited this page Oct 25, 2016 · 3 revisions

This page contains miscellaneous information.

Table of Contents

Measurements

Performance Measurements for the Code Monitor

To execute the performance measurements for the code monitor using the Apache Hadoop project the following steps are necessary:

  1. prepare the development environment as mentioned above
  2. go to Run Configurations and create a new "Eclipse Application" and configure it as follows
    1. In the main tab: choose a workspace location for the nested Eclipse Application.
    2. Important: remove the check mark from "Clear" in order to not clear the workspace of the nested Eclipse Application on every restart
  3. start the nested Eclipse Application
  4. follow the steps from the Hadoop Wiki in order to download Apache Hadooop and include it into the nested Eclipse Application
    1. Important: use the version [1] of Hadoop
    2. after Hadoop is included make sure that the project "hadoop-hdfs" is in the workspace
  5. after Hadoop is included in the nested Eclipse Application close the nested Eclipse Application
  6. start the nested Eclipse Application again. Make sure that the tools.vitruv.domains.java.tests.monitorededitor plugin is activated (should be the case by default). The measurement should start 45 seconds after eclipse has been started.
  7. during the measurement the times are printed on the console
  8. after the execution the results of the measurement can be found in files located in the project folder
  9. Note: To adapt the runs which should be executed change the RUNS constant in the class tools.vitruv.domains.java.tests.monitorededitor.EditorManipulator.

Tools

Namespace migration script

We used a script for the migration of Vitruvius namespaces with all references, and file and folder names from edu.kit.ipd.sdq.vitruvius to tools.vitruvius, which can also be reused for other purposes:

function create_folder() {
  createFolder=$1;
  # Try SVN create
  if [ ! -d "$createFolder" ]; then
    echo "Create folder $createFolder (SVN)";
    svn mkdir --parents "$createFolder" > /dev/null;
  fi
  # If folder still not exists, it is not versioned, so try a normal mkdir
  if [ ! -d "$folder" ]; then
    echo "Create folder $createFolder (w/o SVN)";
    mkdir "$createFolder" > /dev/null;
  fi
}

function move_folder() {
  oldFolder=$1;
  newFolder=$2;
  # Try SVN move
  if [ -d "$oldFolder" ]; then
    echo "Moving folder $oldFolder (SVN)";
    svn mv "$oldFolder" "$newFolder" &>/dev/null;
  fi
  # If folder still exists, it is not versioned, so try a normal move
  if [ -d "$oldFolder" ]; then
    echo "Moving folder $oldFolder (w/o SVN)";
    mv "$oldFolder" "$newFolder" > /dev/null;
  fi
}

function remove_folder() {
  removeFolder=$1;
  # Try SVN remove
  if [ -d "$removeFolder" ]; then
    svn rm "$removeFolder" &> /dev/null;
  fi
  # If folder still exists, it is not versioned, so try a normal remove
  if [ -d "$removeFolder" ]; then
    rm -r "$removeFolder" > /dev/null;
  fi
}

function migrate_project() { 
  project=$1
  # Move edu folders
  EDUFOLDERS=$(find $project -type d -name "edu" -not -path "*bin*");
  for folder in $EDUFOLDERS
  do
    create_folder "$folder/../tools";
    move_folder "$folder/kit/ipd/sdq/vitruvius" "$folder/../tools/";
    #  Remove the old folders. Some may not be versioned (e.g. xtend-gen), so they have to be removed without svn
    remove_folder "$folder/kit/ipd/sdq/vitruvius/";
    remove_folder "$folder/kit/ipd/sdq/";
    remove_folder "$folder/kit/ipd/";
    remove_folder "$folder/kit/";
    remove_folder "$folder";
  done

  # Replace references in files
  find $project -type f -not -name "*.class" -not -name "*._trace" -not -name "*.xtendbin" -not -name "*.jar" -not -name "*.zip" -not -name "*.resource" | while read file
  do
    echo "Update file $file";
    sed -i "s/edu.kit.ipd.sdq.vitruvius/tools.vitruvius/g" "$file";
  done
 
  # Rename project
  echo "Rename project $project";
  newProjectName=$(echo "$project" | sed 's/edu.kit.ipd.sdq.vitruvius/tools.vitruvius/g');
  move_folder "$project" "$newProjectName";

  find $newProjectName -name "*edu.kit.ipd.sdq.vitruvius*" -not -name "$newProjectName" | while read renameFile
  do
    echo "Rename file $renameFile";
    newFileName=$(echo "$renameFile" | sed 's/edu.kit.ipd.sdq.vitruvius/tools.vitruvius/g');
    svn mv "$renameFile" "$newFileName" > /dev/null;
  done
}

Migrate the namespaces of each project in the current folder
for project in $(ls .); do   
  echo "------------------------";   
  echo "Migrate project $project";   
  migrate_project $project; 
done
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.