1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Yann N. Dauphin (dhaemon@gmail.com) - Implementation for stats
11 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.statistics
.evProcessor
;
14 import org
.eclipse
.linuxtools
.lttng
.core
.event
.LttngEvent
;
15 import org
.eclipse
.linuxtools
.lttng
.core
.state
.StateStrings
.Events
;
16 import org
.eclipse
.linuxtools
.lttng
.core
.state
.evProcessor
.ILttngEventProcessor
;
17 import org
.eclipse
.linuxtools
.lttng
.core
.state
.model
.LttngTraceState
;
18 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.statistics
.model
.StatisticsData
;
19 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.statistics
.model
.StatisticsTreeRootFactory
;
21 abstract class AbstractStatsEventHandler
implements ILttngEventProcessor
{
22 private Events fEventType
;
24 public AbstractStatsEventHandler(Events eventType
) {
26 fEventType
= eventType
;
30 * @return root of of the tree for this experiment.
32 protected StatisticsData
getStatisticsTree(LttngTraceState trcState
) {
33 String experimentName
= trcState
.getContext().getExperimentName();
34 return StatisticsTreeRootFactory
.getStatTree(experimentName
);
37 public Events
getEventHandleType() {
41 protected void stepCount(LttngEvent event
, LttngTraceState traceState
) {
42 StatisticsData tree
= getStatisticsTree(traceState
);
43 tree
.registerEvent(event
, traceState
);