1 package org.kuali.ole.docstore.common.util;
2
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5
6
7
8
9
10
11
12
13 public class BatchExportStatistics extends BatchStatistics {
14
15 private static final Logger LOG = LoggerFactory.getLogger(BatchExportStatistics.class);
16
17 private String fileName;
18
19 private long timeTakenForBibMarcRecords;
20
21 private long timeTakenForProcessing;
22
23 private long timeTakenForWritingRecords;
24
25 private long totalTimeTaken;
26
27 public long getTotalTimeTaken() {
28 return totalTimeTaken;
29 }
30
31 public void setTotalTimeTaken(Long totalTimeTaken) {
32 this.totalTimeTaken = totalTimeTaken;
33 }
34
35 public String getFileName() {
36 return fileName;
37 }
38
39 public void setFileName(String fileName) {
40 this.fileName = fileName;
41 }
42
43
44
45 public long getTimeTakenForBibMarcRecords() {
46 return timeTakenForBibMarcRecords;
47 }
48
49 public void addTimeTakenForBibMarcRecords(long timeTakenForBibMarcRecords) {
50 this.timeTakenForBibMarcRecords = this.timeTakenForBibMarcRecords + timeTakenForBibMarcRecords;
51 }
52
53 public long getTimeTakenForProcessing() {
54 return timeTakenForProcessing;
55 }
56
57 public void addTimeTakenForProcessing(long timeTakenForProcessing) {
58 this.timeTakenForProcessing = this.timeTakenForProcessing + timeTakenForProcessing;
59 }
60
61 public long getTimeTakenForWritingRecords() {
62 return timeTakenForWritingRecords;
63 }
64
65 public void addTimeTakenForWritingRecords(long timeTakenForWritingRecords) {
66 this.timeTakenForWritingRecords = this.timeTakenForWritingRecords+ timeTakenForWritingRecords;
67 }
68
69 @Override
70 public String toString() {
71 return "BatchExportStatistics{" +
72 " fileName='" + fileName + '\'' +
73 ", Exported " + getBibCount() + " Bibs ," + getHoldingsCount() + " Holdings ," + getItemCount() + " Items." +
74 " Time Taken - fetch :" + getTimeTaken() +
75 ", parse=" + timeTakenForBibMarcRecords +
76 ", Process=" + timeTakenForProcessing +
77 ", Writing=" + timeTakenForWritingRecords +
78 ", Total =" + totalTimeTaken +
79 '}';
80 }
81
82
83 public void printExportStatistics(){
84 LOG.info(toString());
85 }
86 }