Spring Batch extension for Yammer's Metrics library
The metrics-spring-batch
module integrates Yammer Metrics with Spring Batch listeners.
<dependency>
<groupId>com.bazoud.metrics</groupId>
<artifactId>metrics-spring-batch</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Spring Context XML:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd">
<context:annotation-config/>
<context:component-scan base-package="com.bazoud.metrics.springbatch"/>
<bean id="metricsRegistry" class="com.codahale.metrics.MetricRegistry" />
<job id="instrumentedJob" abstract="true" xmlns="http://www.springframework.org/schema/batch">
<listeners merge="true">
<listener ref="timedJobExecutionListener"/>
<listener ref="meteredJobExecutionListener"/>
</listeners>
</job>
<step id="instrumentedStep" abstract="true" xmlns="http://www.springframework.org/schema/batch">
<tasklet>
<listeners merge="true">
<listener ref="timedStepExecutionListener" />
<listener ref="timedChunkListener" />
<listener ref="timedItemReadListener" />
<listener ref="timedItemProcessListener" />
<listener ref="timedItemWriteListener" />
<listener ref="meteredStepExecutionListener" />
</listeners>
</tasklet>
</step>
<!-- Your own job -->
<job id="jobExemple" parent="instrumentedJob">
<step id="initialStep" parent="instrumentedStep">
<listeners merge="true">
<listener ref="myApplicationListener"/>
</listeners>
</step>
</job>
(...)
</beans>
Here's the most direct way to get your work merged into the project.
- Fork the project
- Clone down your fork
- Create a feature branch
- Hack away and add tests, not necessarily in that order
- Make sure everything still passes by running tests
- If necessary, rebase your commits into logical chunks without errors
- Push the branch up to your fork
- Send a pull request for your branch
This software is licensed under the Apache 2 license, quoted below.
Copyright 2013 Olivier Bazoud
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.