001/*
002 * Copyright 2012-2018 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.boot.actuate.autoconfigure.metrics.export.simple;
018
019import java.time.Duration;
020
021import io.micrometer.core.instrument.simple.CountingMode;
022import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
023
024import org.springframework.boot.context.properties.ConfigurationProperties;
025
026/**
027 * {@link ConfigurationProperties} for configuring metrics export to a
028 * {@link SimpleMeterRegistry}.
029 *
030 * @author Jon Schneider
031 * @author Stephane Nicoll
032 * @since 2.0.0
033 */
034@ConfigurationProperties(prefix = "management.metrics.export.simple")
035public class SimpleProperties {
036
037        /**
038         * Step size (i.e. reporting frequency) to use.
039         */
040        private Duration step = Duration.ofMinutes(1);
041
042        /**
043         * Counting mode.
044         */
045        private CountingMode mode = CountingMode.CUMULATIVE;
046
047        public Duration getStep() {
048                return this.step;
049        }
050
051        public void setStep(Duration step) {
052                this.step = step;
053        }
054
055        public CountingMode getMode() {
056                return this.mode;
057        }
058
059        public void setMode(CountingMode mode) {
060                this.mode = mode;
061        }
062
063}