001 package com.khubla.pragmatach.framework.jmx.impl; 002 003 import java.util.Date; 004 005 import com.khubla.pragmatach.framework.jmx.PerformanceStatisticsMXBean; 006 007 /** 008 * @author tome 009 */ 010 public class PerformanceStatistics implements PerformanceStatisticsMXBean { 011 /** 012 * last render time (ms) 013 */ 014 private long lastRenderTime; 015 /** 016 * start time 017 */ 018 private final String serverStartTime = new Date().toString(); 019 /** 020 * total requests 021 */ 022 private long totalRequests; 023 024 @Override 025 public long getLastRenderTime() { 026 return lastRenderTime; 027 } 028 029 @Override 030 public String getServerStartTime() { 031 return serverStartTime; 032 } 033 034 @Override 035 public long getTotalRequests() { 036 return totalRequests; 037 } 038 039 public void incrementTotalRequests() { 040 totalRequests++; 041 } 042 043 public void setLastRenderTime(long lastRenderTime) { 044 this.lastRenderTime = lastRenderTime; 045 } 046 047 public void setTotalRequests(long totalRequests) { 048 this.totalRequests = totalRequests; 049 } 050 }