unit.java

来自「JAVA Servlet2.3外文书籍源码」· Java 代码 · 共 58 行

JAVA
58
字号
package monitor;public class Unit {        private String path;    private long minTime;    private long maxTime;    private long totalTime;    private int count;
    /** @link aggregation */
    /*#Request lnkRequest;*/
        public Unit(String path, long time) {                this.path = path;        minTime = time;        maxTime = time;        totalTime = time;        count = 1;            }        public String getPath() {        return path;    }        public long getMinTime() {        return minTime;    }        public long getMaxTime() {        return maxTime;    }        public long getTotalTime() {        return totalTime;    }        public long getAverageTime() {        return totalTime/count;    }        public int getCount() {        return count;    }        public void addRequest(long time) {                if(time < this.minTime) this.minTime = time;        if(time > this.maxTime) this.maxTime = time;        totalTime += time;        count++;            }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?