1 /*******************************************************************************
2 * Copyright (c) 2012 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 * Alexandre Montplaisir - Initial API
11 ******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.statistics
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfTimestamp
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfStatsUpdatedSignal
;
21 * Provider for statistics, which is assigned to a trace. This can be used to
22 * populate views like the Statistics View or the Histogram.
24 * As a guideline, since any trace type can use this interface, all timestamps
25 * should be normalized to nanoseconds when using these methods
26 * ({@link ITmfTimestamp#NANOSECOND_SCALE}).
28 * @author Alexandre Montplaisir
31 public interface ITmfStatistics
{
34 * This method provides a centralized and asynchronous way of querying
35 * statistics information. It is an alternative to the other get* methods,
36 * and should not block the caller for too long.
38 * Implementors can usually call their own getEventTotal(),
39 * getEventsInRange(), etc. but should do so in a separate thread, and
40 * should send a {@link TmfStatsUpdatedSignal} whenever they are done (that
41 * signal will carry the results).
44 * Is this for a global query (whole time range of a trace), or
45 * just for a specific time range.
47 * The start time of the query range. Has no effect if isGlobal
50 * The end time of the query range. Has no effect if isGlobal is
53 public void updateStats(boolean isGlobal
, long start
, long end
);
56 * Return the total number of events in the trace.
58 * @return The total number of events
60 public long getEventsTotal();
63 * Return a Map of the total events in the trace, per event type. The event
64 * type should come from ITmfEvent.getType().getName().
66 * @return The map of <event_type, count>, for the whole trace
68 public Map
<String
, Long
> getEventTypesTotal();
71 * Retrieve the number of events in the trace in a given time interval.
74 * Start time of the time range
76 * End time of the time range
77 * @return The number of events found
79 public long getEventsInRange(long start
, long end
);
82 * Retrieve the number of events in the trace, per event type, in a given
86 * Start time of the time range
88 * End time of the time range
89 * @return The map of <event_type, count>, for the given time range
91 public Map
<String
, Long
> getEventTypesInRange(long start
, long end
);
94 * Notify the statistics back-end that the trace is being closed, so it
95 * should dispose itself as appropriate (release file descriptors, etc.)
97 public void dispose();
This page took 0.032173 seconds and 5 git commands to generate.