Examples of Calculable


Examples of org.rioproject.watch.Calculable

                return;
            } else {
                if(nullReturnCount.get()>0)
                    nullReturnCount.decrementAndGet();
            }
            Calculable metric;
            if(value instanceof Calculable) {
                metric = (Calculable)value;
            } else {
                Double d = new Double(value.toString());
                metric = new Calculable(getId(), d, System.currentTimeMillis());
            }
            addWatchRecord(metric);
           
        } catch(Throwable t) {
            logger.warn("SamplingWatch [{}], Invoking [{}={}()]",
View Full Code Here

Examples of org.rioproject.watch.Calculable

    /**
     * @see org.rioproject.watch.WatchDataSource#getLastCalculable
     */
    public Calculable getLastCalculable() {
        Calculable c = null;
        try {
            synchronized(history) {
                c =  history.get(history.size() - 1);
            }
        } catch(IndexOutOfBoundsException ex) {
View Full Code Here

Examples of org.rioproject.watch.Calculable

            logger.info("ThreadMXBean set, monitoring current JVM for thread deadlocks");
    }

    public Calculable getThreadDeadlockCalculable() {
        int deadlockCount = findDeadlockedThreads();
        Calculable metric = new Calculable(ID, deadlockCount, System.currentTimeMillis());
        if(deadlockCount>0) {
            String detail = formatDeadlockedThreadInfo();
            metric.setDetail(detail);
            if(logger.isTraceEnabled())
                logger.trace(detail);
        } else {
             if(logger.isTraceEnabled())
                logger.trace("No deadlocked threads");
View Full Code Here

Examples of org.rioproject.watch.Calculable

     * Add a value
     *
     * @param value New value
     */
    public void addValue(long value) {
        addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis()));
    }
View Full Code Here

Examples of org.rioproject.watch.Calculable

     * Add a value
     *
     * @param value New value
     */
    public void addValue(double value) {
        addWatchRecord(new Calculable(id, value, System.currentTimeMillis()));
    }
View Full Code Here

Examples of org.rioproject.watch.Calculable

     * @param value New value.
     * @param detail Detail about the metric.
     */
    @SuppressWarnings("unused")
    public void addValue(double value, String detail) {
        Calculable calculable = new Calculable(id, value, System.currentTimeMillis());
        calculable.setDetail(detail);
        addWatchRecord(calculable);
    }
View Full Code Here

Examples of org.rioproject.watch.Calculable

    private class ReplicatorTask implements Runnable {
        public void run() {
            while(!closed) {
                try {
                    Calculable calculable = replicatorQ.poll(5, TimeUnit.SECONDS);
                    if(calculable!=null) {
                        replicate(calculable);
                    }
                } catch(IOException e) {
                    logger.warn("Replication communication failure: ", e);
View Full Code Here

Examples of org.rioproject.watch.Calculable

                    }
                } catch (IOException e) {
                    e.printStackTrace();
                }
                try {
                    Calculable c = checkAdd(s, "temperature", lastTemperature);
                    if(c!=null) {
                        lastTemperature = c;
                        temperatureTimeSeries.addOrUpdate(new FixedMillisecond(c.getWhen()), c.getValue());
                    }
                } catch (RemoteException e) {
                    e.printStackTrace();
                }
            }
View Full Code Here

Examples of org.rioproject.watch.Calculable

            super(id);
            super.setPeriod(1000);
        }

        public void checkValue() {
            super.addWatchRecord(new Calculable("taux", numberOfCalls / (getPeriod() / 1000)));
            numberOfCalls = 0;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.