1 17 package org.apache.geronimo.management.stats; 18 19 import java.io.Serializable ; 20 import javax.management.j2ee.statistics.Statistic ; 21 22 27 public class StatisticImpl implements Statistic , Serializable { 28 public final static String UNIT_TIME_HOUR = "HOUR"; 30 public final static String UNIT_TIME_MINUTE = "MINUTE"; 31 public final static String UNIT_TIME_SECOND = "SECOND"; 32 public final static String UNIT_TIME_MILLISECOND = "MILLISECOND"; 33 public final static String UNIT_TIME_MICROSECOND = "MICROSECOND"; 34 public final static String UNIT_TIME_NANOSECOND = "NANOSECOND"; 35 public final static String UNIT_MEMORY_BYTES = "BYTE"; 37 public final static String UNIT_MEMORY_KILOBYTES = "KILOBYTE"; 38 public final static String UNIT_MEMORY_MEGABYTES = "MEGABYTE"; 39 public final static String UNIT_MEMORY_GIGABYTES = "GIGABYTE"; 40 public final static String UNIT_COUNT = "COUNT"; 41 42 private String name; 43 private String unit; 44 private String description; 45 private long startTime; 46 private long lastSampleTime; 47 48 public StatisticImpl(String name, String unit, String description) { 49 this.name = name; 50 this.unit = unit; 51 this.description = description; 52 } 53 54 public String getName() { 55 return name; 56 } 57 58 public String getUnit() { 59 return unit; 60 } 61 62 public String getDescription() { 63 return description; 64 } 65 66 public long getStartTime() { 67 return startTime; 68 } 69 70 public void setStartTime() { 71 this.startTime = System.currentTimeMillis(); 72 } 73 74 public void setStartTime(long startTime) { 75 this.startTime = startTime; 76 } 77 78 public long getLastSampleTime() { 79 return lastSampleTime; 80 } 81 82 public void setLastSampleTime(long lastSampleTime) { 83 this.lastSampleTime = lastSampleTime; 84 } 85 86 public void setLastSampleTime() { 87 this.lastSampleTime = System.currentTimeMillis(); 88 } 89 } 90 | Popular Tags |