Skip to content

Commit

Permalink
Added batching stats
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 10, 2008
1 parent 668dfb3 commit 518de49
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Expand Up @@ -44,6 +44,8 @@
import org.jumpmind.symmetric.model.OutgoingBatch.Status;
import org.jumpmind.symmetric.service.INodeService;
import org.jumpmind.symmetric.service.IOutgoingBatchService;
import org.jumpmind.symmetric.statistic.IStatisticManager;
import org.jumpmind.symmetric.statistic.StatisticName;
import org.jumpmind.symmetric.util.MaxRowsStatementCreator;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ConnectionCallback;
Expand All @@ -59,6 +61,8 @@ public class OutgoingBatchService extends AbstractService implements IOutgoingBa
private INodeService nodeService;

private IDbDialect dbDialect;

private IStatisticManager statisticManager;

/**
* Create a batch and mark events as tied to that batch. We iterate through all the events so we can find
Expand Down Expand Up @@ -179,6 +183,8 @@ public Object doInConnection(Connection conn) throws SQLException, DataAccessExc
history.setDataEventCount(dataEventCount);
history.setDatabaseMillis(databaseMillis);
insertOutgoingBatchHistory(history);
statisticManager.getStatistic(StatisticName.OUTGOING_MS_PER_EVENT_BATCHED).add(databaseMillis, dataEventCount);
statisticManager.getStatistic(StatisticName.OUTGOING_EVENTS_PER_BATCH).add(dataEventCount, 1);

}

Expand Down Expand Up @@ -330,4 +336,8 @@ public void setNodeService(INodeService nodeService) {
this.nodeService = nodeService;
}

public void setStatisticManager(IStatisticManager statisticManager) {
this.statisticManager = statisticManager;
}

}
Expand Up @@ -30,6 +30,9 @@ public enum StatisticName {
INCOMING_BATCH_COUNT,
INCOMING_SKIP_BATCH_COUNT,

OUTGOING_MS_PER_EVENT_BATCHED,
OUTGOING_EVENTS_PER_BATCH,

OUTGOING_NETWORK_ERRORS,
OUTGOING_DATABASE_ERRORS,
OUTGOING_ROWS_PER_MS,
Expand Down
3 changes: 2 additions & 1 deletion symmetric/src/main/resources/symmetric-services.xml
Expand Up @@ -92,7 +92,8 @@
<property name="jdbcTemplate" ref="jdbcTemplate" />
<property name="runtimeConfiguration" ref="runtimeConfiguration" />
<property name="parameterService" ref="parameterService" />
<property name="nodeService" ref="nodeService" />
<property name="nodeService" ref="nodeService" />
<property name="statisticManager" ref="statisticManager" />
<property name="dbDialect" ref="dbDialect" />
</bean>

Expand Down

0 comments on commit 518de49

Please sign in to comment.