Skip to content

Commit

Permalink
Corrected CI calculation, and changed several event names
Browse files Browse the repository at this point in the history
  • Loading branch information
fotisp committed Apr 22, 2012
1 parent 24864b7 commit 56d9512
Show file tree
Hide file tree
Showing 27 changed files with 542 additions and 263 deletions.
37 changes: 37 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#/bin/bash

DEV_DIR="/Users/fotis/Development/idea/"
EVENTS_DIR="$DEV_DIR/eu.alert-project.iccs.events/eu.alert-project.iccs.events.core"
REC_DIR="$DEV_DIR/Recommender/eu.alert-project.iccs.recommender.core"
STARDOM_DIR="$DEV_DIR/STARDOM/eu.alert-project.iccs.stardom.core"

LAUS_PORT="22"
LAUS_KEY="/Users/fotis/.ssh/id_rsa_2048"
LAUS_HOST="laus.perimeter.fzi.de"
LAUS_USER="alerticcs"

pwd

cd $EVENTS_DIR; pwd; mvn clean compile package install || exit 1
cd $REC_DIR; pwd; mvn clean compile package install -Denv=prod -Ddb.port=8889 -Dmaven.test.skip=true || exit 1
cd $STARDOM_DIR; pwd; mvn clean compile package install -Denv=prod -Ddb.port=8889 -DfilterDate=1970-01-01 -Dmaven.test.skip=true || exit 1


#upload
echo "Uploading...."

ssh -p$LAUS_PORT -i "$LAUS_KEY" $LAUS_USER@$LAUS_HOST "mkdir -p ICCS/dist/$(date +"%Y-%m-%d")/wars"
scp -P$LAUS_PORT -i "$LAUS_KEY" $STARDOM_DIR/eu.alert-project.iccs.stardom.alert-connector/target/alert-connector-0.0.2-SNAPSHOT.war $LAUS_USER@$LAUS_HOST:"ICCS/dist/$(date +"%Y-%m-%d")/wars" || exit 1;
scp -P$LAUS_PORT -i "$LAUS_KEY" $STARDOM_DIR/eu.alert-project.iccs.stardom.ui/target/ui.war $LAUS_USER@$LAUS_HOST:"ICCS/dist/$(date +"%Y-%m-%d")/wars" || exit 1;
scp -P$LAUS_PORT -i "$LAUS_KEY" $REC_DIR/eu.alert-project.iccs.recommender.connector/target/connector-0.0.1-SNAPSHOT.war $LAUS_USER@$LAUS_HOST:"ICCS/dist/$(date +"%Y-%m-%d")/wars" || exit 1;
scp -P$LAUS_PORT -i "$LAUS_KEY" $REC_DIR/eu.alert-project.iccs.recommender.ui/target/ui-0.0.1-SNAPSHOT.war $LAUS_USER@$LAUS_HOST:"ICCS/dist/$(date +"%Y-%m-%d")/wars" || exit 1;

ssh -p$LAUS_PORT -i "$LAUS_KEY" $LAUS_USER@$LAUS_HOST "./reset-db.sh"
ssh -p$LAUS_PORT -i "$LAUS_KEY" $LAUS_USER@$LAUS_HOST "ls ICCS/dist/$(date +"%Y-%m-%d")"
ssh -p$LAUS_PORT -i "$LAUS_KEY" $LAUS_USER@$LAUS_HOST "./deploy.sh ICCS/dist/$(date +"%Y-%m-%d")"






Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,20 @@ public void updateIndentityCI(AnnotatedUpdateEvent event) {

try {
if(metrics.containsKey(cim.getName())){


Integer value = metrics.get(cim.getName()).getValue(metricDao, (Identity) event.getPayload());
if(cim.getStandardDeviation() > 0.0){
NormalDistribution d = new NormalDistributionImpl(cim.getMean(),cim.getStandardDeviation());
prob *= d.density(Double.valueOf(value));
if(value >= cim.getMean()){
prob *= d.density(cim.getMean());
}else{
prob *= d.density(Double.valueOf(value));
}
}else{
prob *=1;
}

}
} catch (RuntimeException e) {
logger.warn("The metric standard deviation is incorrect",e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
</bean>


<bean id="ALERT_KEUI_MailNew_Annotated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<bean id="ALERT_METADATA_MailNew_Updated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="destination">
<bean
class="org.apache.activemq.command.ActiveMQTopic">
<constructor-arg>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_KEUI_MailNew_Annotated"/>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_METADATA_MailNew_Updated"/>
</constructor-arg>
</bean>
</property>
Expand All @@ -56,13 +56,13 @@
<property name="cacheLevel" value="3" />
</bean>

<bean id="ALERT_KEUI_CommitNew_Annotated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<bean id="ALERT_METADATA_CommitNew_Updated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="destination">
<bean
class="org.apache.activemq.command.ActiveMQTopic">
<constructor-arg>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_KEUI_CommitNew_Annotated"/>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_METADATA_CommitNew_Updated"/>
</constructor-arg>
</bean>
</property>
Expand All @@ -71,13 +71,13 @@
<property name="cacheLevel" value="3" />
</bean>

<bean id="ALERT_KEUI_IssueNew_Annotated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<bean id="ALERT_METADATA_IssueNew_Updated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="destination">
<bean
class="org.apache.activemq.command.ActiveMQTopic">
<constructor-arg>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_KEUI_IssueNew_Annotated"/>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_METADATA_IssueNew_Updated"/>
</constructor-arg>
</bean>
</property>
Expand All @@ -86,13 +86,13 @@
<property name="cacheLevel" value="3" />
</bean>

<bean id="ALERT_KEUI_IssueUpdate_Annotated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<bean id="ALERT_METADATA_IssueUpdate_Updated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="destination">
<bean
class="org.apache.activemq.command.ActiveMQTopic">
<constructor-arg>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_KEUI_IssueUpdate_Annotated"/>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_METADATA_IssueUpdate_Updated"/>
</constructor-arg>
</bean>
</property>
Expand All @@ -101,13 +101,13 @@
<property name="cacheLevel" value="3" />
</bean>

<bean id="ALERT_KEUI_ForumPost_Annotated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<bean id="ALERT_METADATA_ForumPost_Updated" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="destination">
<bean
class="org.apache.activemq.command.ActiveMQTopic">
<constructor-arg>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_KEUI_ForumPost_Annotated"/>
<util:constant static-field="eu.alertproject.iccs.events.api.Topics.ALERT_METADATA_ForumPost_Updated"/>
</constructor-arg>
</bean>
</property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void testEvent() throws IOException {
public void testSendEvent() throws IOException {

jmsTemplate.send(
Topics.ALERT_KEUI_CommitNew_Annotated,
Topics.ALERT_METADATA_CommitNew_Updated,
new TextMessageCreator(
IOUtils.toString(this.getClass().getResourceAsStream("/connector/ALERT.KEUI.CommitNew.Annotated.xml"))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void testEvent() throws IOException {
public void testSendEvent() throws IOException {

jmsTemplate.send(
Topics.ALERT_KEUI_IssueNew_Annotated,
Topics.ALERT_METADATA_IssueNew_Updated,
new TextMessageCreator(
IOUtils.toString(this.getClass().getResourceAsStream("/connector/ALERT.KEUI.IssueNew.Annotated.xml"))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void testEvent() throws IOException {
public void testSendEvent() throws IOException {

jmsTemplate.send(
Topics.ALERT_KEUI_IssueUpdate_Annotated,
Topics.ALERT_METADATA_IssueUpdate_Updated,
new TextMessageCreator(
IOUtils.toString(this.getClass().getResourceAsStream("/connector/ALERT.KEUI.IssueUpdate.Annotated.xml"))
)
Expand All @@ -96,7 +96,7 @@ private void assertAction(){

List<Profile> all = profileDao.findAll();
Assert.assertNotNull(all);
Assert.assertEquals(6, all.size(), 0);
Assert.assertEquals(5, all.size(), 0);


Iterator<Profile> profileIterator = all.iterator();
Expand All @@ -111,7 +111,7 @@ private void assertAction(){

List<Identity> all1 = identityDao.findAll();

Assert.assertEquals(5,all1.size(),0);
Assert.assertEquals(4,all1.size(),0);

Identity identity = all1.get(1);//drf;
List<ItsTemporalMetric> idenity1Metric = metricDao.getForIdentity(identity, ItsTemporalMetric.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void testEvent() throws IOException {
public void testSendEvent() throws IOException {

jmsTemplate.send(
Topics.ALERT_KEUI_MailNew_Annotated,
Topics.ALERT_METADATA_MailNew_Updated,
new TextMessageCreator(
IOUtils.toString(this.getClass().getResourceAsStream("/connector/ALERT.KEUI.MailNew.Annotated.xml"))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public void event(ItsEvent event){
handleDirtyProfile(action.getAssigned(),action);
handleDirtyProfile(action.getReporter(), action);

Bus.publish(STARDOMTopics.IssueUpdated,new AnnotatedUpdateEvent(this,action.getBugId(),action.getConcepts()));



}

Expand Down Expand Up @@ -153,7 +156,6 @@ private void handleDirtyProfile(Profile dirty, DefaultItsAction action ){
} finally {

Bus.publish(STARDOMTopics.IdentityUpdated,new AnnotatedUpdateEvent(this,identity,action.getConcepts()));
Bus.publish(STARDOMTopics.IssueUpdated,new AnnotatedUpdateEvent(this,action.getBugId(),action.getConcepts()));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<artifactId>orm</artifactId>
</dependency>


<dependency>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
Expand All @@ -70,7 +69,6 @@
<artifactId>datastore</artifactId>
</dependency>


</dependencies>

</project>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.zip
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void handle(InputStream inputStream) throws IOException {


template.send(
Topics.ALERT_KEUI_IssueUpdate_Annotated,
Topics.ALERT_METADATA_IssueUpdate_Updated,
new TextMessageCreator(s));


Expand Down
Loading

0 comments on commit 56d9512

Please sign in to comment.