001/**
002 * Copyright (C) 2007-2011, Jens Lehmann
003 *
004 * This file is part of DL-Learner.
005 *
006 * DL-Learner is free software; you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation; either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * DL-Learner is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU General Public License for more details.
015 *
016 * You should have received a copy of the GNU General Public License
017 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018 */
019
020package org.dllearner.experiments;
021
022import java.io.Serializable;
023
024import com.jamonapi.MonKey;
025import com.jamonapi.Monitor;
026
027/**
028 * This a class to make a Jamon monitor persistent
029 * @author Sebastian Hellmann <hellmann@informatik.uni-leipzig.de>
030 *
031 */
032public class FinalizedMonitor implements Serializable{
033        private static final long serialVersionUID = 6617125369204663530L;
034        
035        final String header;
036        final String units;
037        
038        final double avg;
039        final double hits;
040        final double stdDev;
041        final double lastValue;
042        final double max;
043        final double min;
044        final double total;
045        
046        
047        public FinalizedMonitor(Monitor m){
048                header = (String)m.getMonKey().getValue(MonKey.LABEL_HEADER);
049                units = (String)m.getMonKey().getValue(MonKey.UNITS_HEADER);
050                avg = m.getAvg();
051                hits = m.getHits();
052                stdDev = m.getStdDev();
053                lastValue = m.getLastValue();
054                max = m.getMax();
055                min = m.getMin();
056                total = m.getTotal();
057                
058                
059        }
060
061        public String getHeader() {
062                return header;
063        }
064
065        public String getUnits() {
066                return units;
067        }
068
069        public double getAvg() {
070                return avg;
071        }
072
073        public double getHits() {
074                return hits;
075        }
076
077        public double getStdDev() {
078                return stdDev;
079        }
080
081        public double getLastValue() {
082                return lastValue;
083        }
084
085        public double getMax() {
086                return max;
087        }
088
089        public double getMin() {
090                return min;
091        }
092        public double getTotal() {
093                return total;
094        }
095        
096        
097        
098}