1 28 29 package com.caucho.jmx.stats; 30 31 import com.caucho.util.Alarm; 32 33 36 public class RangeStats { 37 private String _name; 38 private long _startTime; 39 40 private long _current; 41 private long _lowWaterMark; 42 private long _highWaterMark; 43 44 47 public RangeStats() 48 { 49 _startTime = Alarm.getCurrentTime(); 50 } 51 52 55 public RangeStats(String name) 56 { 57 _startTime = Alarm.getCurrentTime(); 58 59 _name = name; 60 } 61 62 65 public long getCurrent() 66 { 67 return _current; 68 } 69 70 73 public long getLowWaterMark() 74 { 75 return _lowWaterMark; 76 } 77 78 81 public long getHighWaterMark() 82 { 83 return _highWaterMark; 84 } 85 86 89 public void setCurrent(long current) 90 { 91 _current = current; 92 93 if (current < _lowWaterMark) 94 _lowWaterMark = current; 95 96 if (_highWaterMark < current) 97 _highWaterMark = current; 98 } 99 100 103 public void reset() 104 { 105 _lowWaterMark = _highWaterMark = _current; 106 } 107 } 108 | Popular Tags |