Package org.onebusaway.watchdog.api
Class LongTermAveragesResource
- java.lang.Object
-
- org.onebusaway.watchdog.api.MetricResource
-
- org.onebusaway.watchdog.api.LongTermAveragesResource
-
- Direct Known Subclasses:
AveragesResource
public class LongTermAveragesResource extends MetricResource
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger_logprotected static intcurrentTripCtprotected static intearliestTripIdxprotected static intmatchedTripsAvgprotected static int[]recentMatchedTripsprotected static int[]recentUnmatchedTripsprotected static intROLLING_AVERAGE_COUNTprotected static intunmatchedTripsAvg-
Fields inherited from class org.onebusaway.watchdog.api.MetricResource
_configuration, _mapper
-
-
Constructor Summary
Constructors Constructor Description LongTermAveragesResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetAvgByAgency(String metricType, String agencyId)protected List<MonitoredDataSource>getDataSources()protected intgetMatchedTripsAvg()protected intgetUnmatchedTripsAvg()voidrefresh()voidsetMetricConfiguration(MetricConfiguration mc)voidsetRefreshInterval(int refreshInterval)voidsetScheduledExecutorService(ScheduledExecutorService scheduledExecutorService)voidstart()voidstop()protected voidupdateLongTermMatchedTrips(int currentMatchedTrips, int idx)protected voidupdateLongTermUnmatchedTrips(int currentUnmatchedTrips, int idx)-
Methods inherited from class org.onebusaway.watchdog.api.MetricResource
error, error, getAddedTripIdCt, getCancelledTripIdCt, getInvalidLocation, getLocationTotal, getMatchedStopCt, getScheduledTrips, getScheduledTrips, getTDS, getTotalRecordCount, getUnmatchedStopCt, getUnmatchedTripIdCt, getValidRealtimeTripIds, ok
-
-
-
-
Field Detail
-
_log
protected static final org.slf4j.Logger _log
-
matchedTripsAvg
protected static int matchedTripsAvg
-
unmatchedTripsAvg
protected static int unmatchedTripsAvg
-
ROLLING_AVERAGE_COUNT
protected static int ROLLING_AVERAGE_COUNT
-
recentMatchedTrips
protected static int[] recentMatchedTrips
-
recentUnmatchedTrips
protected static int[] recentUnmatchedTrips
-
currentTripCt
protected static int currentTripCt
-
earliestTripIdx
protected static int earliestTripIdx
-
-
Method Detail
-
setRefreshInterval
public void setRefreshInterval(int refreshInterval)
-
getMatchedTripsAvg
protected int getMatchedTripsAvg()
-
getUnmatchedTripsAvg
protected int getUnmatchedTripsAvg()
-
start
@PostConstruct public void start()
-
stop
@PreDestroy public void stop()
-
setScheduledExecutorService
@Autowired public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
-
setMetricConfiguration
@Autowired public void setMetricConfiguration(MetricConfiguration mc)
- Overrides:
setMetricConfigurationin classMetricResource
-
getDataSources
protected List<MonitoredDataSource> getDataSources()
- Overrides:
getDataSourcesin classMetricResource
-
updateLongTermMatchedTrips
protected void updateLongTermMatchedTrips(int currentMatchedTrips, int idx)
-
updateLongTermUnmatchedTrips
protected void updateLongTermUnmatchedTrips(int currentUnmatchedTrips, int idx)
-
refresh
public void refresh() throws IOException- Throws:
IOException
-
-