View Javadoc
1   /*
2    * Copyright 2012 The Kuali Foundation.
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.docstore.process;
17  
18  import org.kuali.ole.utility.DateTimeUtil;
19  
20  /**
21   * Class Bulk Ingest Time Manager.
22   *
23   * @author Rajesh Chowdary K
24   * @created Apr 4, 2012
25   */
26  public class BulkIngestTimeManager {
27  
28      private long recordsCount = 0;
29      private long ingestingTimer = 0;
30      private long indexingTimer = 0;
31      private long processTimer = 0;
32  
33      public void reset() {
34          recordsCount = 0;
35          ingestingTimer = 0;
36          indexingTimer = 0;
37          processTimer = 0;
38      }
39  
40      @Override
41      public String toString() {
42          return "Bulk Ingest Process Timer(" + recordsCount + "):\tIngesting Time: "
43                  + DateTimeUtil.formatTime(ingestingTimer) + "\tIndexing Time: " + DateTimeUtil.formatTime(indexingTimer)
44                  + "\tTotal Process Time: " + DateTimeUtil.formatTime(processTimer);
45      }
46  
47      public long getRecordsCount() {
48          return recordsCount;
49      }
50  
51      public void setRecordsCount(long recordsCount) {
52          this.recordsCount = recordsCount;
53      }
54  
55      public long getIngestingTimer() {
56          return ingestingTimer;
57      }
58  
59      public void setIngestingTimer(long ingestingTimer) {
60          this.ingestingTimer = ingestingTimer;
61      }
62  
63      public long getIndexingTimer() {
64          return indexingTimer;
65      }
66  
67      public void setIndexingTimer(long indexingTimer) {
68          this.indexingTimer = indexingTimer;
69      }
70  
71      public long getProcessTimer() {
72          return processTimer;
73      }
74  
75      public void setProcessTimer(long processTimer) {
76          this.processTimer = processTimer;
77      }
78  
79  }