KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > common > TimeStatisticPanel


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.admin.common;
5
6 import org.jfree.data.time.Second;
7
8 import com.tc.admin.ConnectionContext;
9 import com.tc.stats.statistics.Statistic;
10 import com.tc.stats.statistics.TimeStatistic;
11
12 import java.util.Date JavaDoc;
13
14 public class TimeStatisticPanel extends StatisticPanel {
15   public TimeStatisticPanel(ConnectionContext cc) {
16     super(cc);
17   }
18
19   public void setStatistic(Statistic stat) {
20     super.setStatistic(stat);
21
22     TimeStatistic timeStat = (TimeStatistic)stat;
23     long ts = timeStat.getLastSampleTime();
24     long count = timeStat.getCount();
25
26     getTimeSeries().addOrUpdate(new Second(new Date JavaDoc(ts)), count);
27   }
28 }
29
Popular Tags