Package org.apache.jackrabbit.api.stats

Examples of org.apache.jackrabbit.api.stats.TimeSeries


     *             if the time series isnt available.
     */
    private TimeSeries getTimeSeries(String name)
            throws AttributeNotFoundException {
        try {
            TimeSeries ts = statistics.getTimeSeries(Type.valueOf(name));
            if (ts == null) {
                throw new AttributeNotFoundException("Attribute " + name
                        + " doesnt exist");
            }
            return ts;
View Full Code Here


    public RepositoryStatisticsImpl() {
        getOrCreateRecorder(Type.SESSION_COUNT);
        getOrCreateRecorder(Type.SESSION_LOGIN_COUNTER);

        TimeSeries src = getOrCreateRecorder(Type.SESSION_READ_COUNTER);
        TimeSeries srd = getOrCreateRecorder(Type.SESSION_READ_DURATION);
        avg.put(Type.SESSION_READ_AVERAGE, new TimeSeriesAverage(srd, src));

        TimeSeries swc = getOrCreateRecorder(Type.SESSION_WRITE_COUNTER);
        TimeSeries swd = getOrCreateRecorder(Type.SESSION_WRITE_DURATION);
        avg.put(Type.SESSION_WRITE_AVERAGE, new TimeSeriesAverage(swd, swc));

        TimeSeries brc = getOrCreateRecorder(Type.BUNDLE_READ_COUNTER);
        TimeSeries brd = getOrCreateRecorder(Type.BUNDLE_READ_DURATION);
        avg.put(Type.BUNDLE_READ_AVERAGE, new TimeSeriesAverage(brd, brc));

        TimeSeries bwc = getOrCreateRecorder(Type.BUNDLE_WRITE_COUNTER);
        TimeSeries bwd = getOrCreateRecorder(Type.BUNDLE_WRITE_DURATION);
        avg.put(Type.BUNDLE_WRITE_AVERAGE, new TimeSeriesAverage(bwd, bwc));
    }
View Full Code Here

    public static final String[] ITEM_NAMES = new String[] {
            "per second", "per minute", "per hour", "per week"};

    private CompositeData asCompositeData(Type type) {
        try {
            TimeSeries timeSeries = repoStats.getTimeSeries(type);
            long[][] values = new long[][] {
                timeSeries.getValuePerSecond(),
                timeSeries.getValuePerMinute(),
                timeSeries.getValuePerHour(),
                timeSeries.getValuePerWeek()};
            return new CompositeDataSupport(getCompositeType(type), ITEM_NAMES, values);
        } catch (Exception e) {
            LOG.error("Error creating CompositeData instance from TimeSeries", e);
            return null;
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.api.stats.TimeSeries

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.