1 /* 2 * Copyright (C) 2017-2019 Centre National d'Etudes Spatiales (CNES). 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 3.0 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 * MA 02110-1301 USA 18 */ 19 package fr.cnes.doi.services; 20 21 /** 22 * Monitoring record containing: 23 * <ul> 24 * <li>Description of the record</li> 25 * <li>Average</li> 26 * <li>Nb total of recorded values (to compute the average)</li> 27 * </ul> 28 * 29 * @author Claire 30 * 31 */ 32 public class DoiMonitoringRecord { 33 34 /** 35 * Description (name) of the service to record * 36 */ 37 private String description; 38 39 /** 40 * Current average time to access this service * 41 */ 42 private float average = 0.0f; 43 44 /** 45 * Nb of values to compute the average * 46 */ 47 private int nbAccess = 0; 48 49 /** 50 * Constructor. 51 * 52 * @param description Service description 53 * @param average Average speed of the request 54 * @param nbAccess Number of access 55 */ 56 public DoiMonitoringRecord(final String description, final float average, final int nbAccess) { 57 super(); 58 this.description = description; 59 this.average = average; 60 this.nbAccess = nbAccess; 61 } 62 63 /** 64 * Returns the service description. 65 * 66 * @return the description 67 */ 68 public String getDescription() { 69 return description; 70 } 71 72 /** 73 * Sets the service description. 74 * 75 * @param description the description to set 76 */ 77 public void setDescription(final String description) { 78 this.description = description; 79 } 80 81 /** 82 * Returns the average speed of the request. 83 * 84 * @return the average 85 */ 86 public float getAverage() { 87 return average; 88 } 89 90 /** 91 * Sets the average speed of the request. 92 * 93 * @param average the average to set 94 */ 95 public void setAverage(final float average) { 96 this.average = average; 97 } 98 99 /** 100 * Returns the number of access. 101 * 102 * @return the nbAccess 103 */ 104 public int getNbAccess() { 105 return nbAccess; 106 } 107 108 /** 109 * Sets the number of access. 110 * 111 * @param nbAccess the nbAccess to set 112 */ 113 public void setNbAccess(final int nbAccess) { 114 this.nbAccess = nbAccess; 115 } 116 117 }