java
and mvn
should be installed.
- Clone this repo, and cd to the project directory.
- Edit the content of
src/main/resources/job_processor.properties
as per your preference. You may only want to edit the path of the files. There are two file paths of interest:
- The local file that the individual jobs read and write to. It is given by :
job.execution.io.path
property. This file has been used to simulate IO calls during execution of the jobs. - The output file that contains the job statistics over a period of time. It is given by :
job.tracker.output.path
property.
Execute mvn clean;mvn package
to build a uber jar.
From the project directory, run the below command:
java -classpath ./target/job-processor-0.0.1-SNAPSHOT.jar bharati.binita.job.processor.Main
In another terminal, open the file as referred by the job.tracker.output.path
property. It will contain the below sample entries:
time = Sun Jun 06 13:24:42 IST 2021 ;numJobsSubmitted = 29 ;avgProcessingTime = 0.67 ms ;successRate = 15/29 ;failureRate = 0/29
time = Sun Jun 06 13:25:12 IST 2021 ;numJobsSubmitted = 29 ;avgProcessingTime = 0.53 ms ;successRate = 15/29 ;failureRate = 0/29