| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| SamplerConfig |
|
| 1.0;1 |
| 1 | /** | |
| 2 | * Copyright 2009 Martin Vysny. | |
| 3 | * | |
| 4 | * This file is part of WebVM. | |
| 5 | * | |
| 6 | * WebVM is free software: you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation, either version 3 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * WebVM is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with WebVM. If not, see <http://www.gnu.org/licenses/>. | |
| 18 | */ | |
| 19 | package sk.baka.webvm.analyzer; | |
| 20 | ||
| 21 | /** | |
| 22 | * Configures the sampler. | |
| 23 | * @author Martin Vysny | |
| 24 | */ | |
| 25 | public final class SamplerConfig { | |
| 26 | ||
| 27 | private final int historyLength; | |
| 28 | private final int initialDelay; | |
| 29 | ||
| 30 | /** | |
| 31 | * Sleep x milliseconds before sampling start. | |
| 32 | * @return | |
| 33 | */ | |
| 34 | public int getInitialDelay() { | |
| 35 | 4 | return initialDelay; |
| 36 | } | |
| 37 | ||
| 38 | /** | |
| 39 | * A number of samples to keep in the history. | |
| 40 | * @return | |
| 41 | */ | |
| 42 | public int getHistoryLength() { | |
| 43 | 4 | return historyLength; |
| 44 | } | |
| 45 | ||
| 46 | /** | |
| 47 | * Sample each x milliseconds | |
| 48 | * @return | |
| 49 | */ | |
| 50 | public int getHistorySampleDelayMs() { | |
| 51 | 28 | return historySampleDelayMs; |
| 52 | } | |
| 53 | private final int historySampleDelayMs; | |
| 54 | ||
| 55 | /** | |
| 56 | * Creates new object. | |
| 57 | * @param historyLength a number of samples to keep in the history. | |
| 58 | * @param historySampleDelayMs sample each x milliseconds | |
| 59 | * @param initialDelay sleep x milliseconds before sampling start | |
| 60 | */ | |
| 61 | 4 | public SamplerConfig(final int historyLength, final int historySampleDelayMs, final int initialDelay) { |
| 62 | 4 | this.historyLength = historyLength; |
| 63 | 4 | this.historySampleDelayMs = historySampleDelayMs; |
| 64 | 4 | this.initialDelay = initialDelay; |
| 65 | 4 | } |
| 66 | } |