alluxio.metrics.MetricsSystem Maven / Gradle / Ivy
/*
* The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
* (the "License"). You may not use this work except in compliance with the License, which is
* available at www.apache.org/licenses/LICENSE-2.0
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied, as more fully set forth in the License.
*
* See the NOTICE file distributed with this work for information regarding copyright ownership.
*/
package alluxio.metrics;
import alluxio.Configuration;
import alluxio.Constants;
import alluxio.metrics.sink.MetricsServlet;
import alluxio.metrics.sink.Sink;
import alluxio.metrics.source.Source;
import com.codahale.metrics.MetricRegistry;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import javax.annotation.concurrent.NotThreadSafe;
/**
* A MetricsSystem is created by a specific instance(master, worker). It polls the metrics sources
* periodically and pass the data to the sinks.
*
* The syntax of the metrics configuration file is:
* [instance].[sink|source].[name].[options]=[value]
*/
@NotThreadSafe
public class MetricsSystem {
private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE);
public static final String SINK_REGEX = "^sink\\.(.+)\\.(.+)";
public static final String SOURCE_REGEX = "^source\\.(.+)\\.(.+)";
private static final TimeUnit MINIMAL_POLL_UNIT = TimeUnit.SECONDS;
private static final int MINIMAL_POLL_PERIOD = 1;
private String mInstance;
private List mSinks = new ArrayList();
private List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy