You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2014/10/22 20:12:19 UTC
[2/2] git commit: AMBARI-7818. Create Metrics Load Simulator.
AMBARI-7818. Create Metrics Load Simulator.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/55bc69d6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/55bc69d6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/55bc69d6
Branch: refs/heads/branch-metrics-dev
Commit: 55bc69d659bc73e297d02f4fcfbbac19165fb929
Parents: d2c2a60
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Wed Oct 22 11:11:39 2014 -0700
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Wed Oct 22 11:11:39 2014 -0700
----------------------------------------------------------------------
.../pom.xml | 72 +++++++
.../src/main/assemblies/simulator.xml | 68 ++++++
.../src/main/conf/simulator-log4j.xml | 45 ++++
.../metrics/loadsimulator/LoadRunner.java | 160 +++++++++++++++
.../loadsimulator/MetricsLoadSimulator.java | 120 +++++++++++
.../loadsimulator/MetricsSenderWorker.java | 65 ++++++
.../metrics/loadsimulator/data/AppID.java | 42 ++++
.../metrics/loadsimulator/data/AppMetrics.java | 48 +++++
.../loadsimulator/data/ApplicationInstance.java | 59 ++++++
.../data/HostMetricsGenerator.java | 63 ++++++
.../metrics/loadsimulator/data/Metric.java | 71 +++++++
.../data/MetricsGeneratorConfigurer.java | 95 +++++++++
.../loadsimulator/net/MetricsSender.java | 31 +++
.../loadsimulator/net/RestMetricsSender.java | 95 +++++++++
.../loadsimulator/net/StdOutMetricsSender.java | 56 +++++
.../metrics/loadsimulator/net/UrlService.java | 101 +++++++++
.../metrics/loadsimulator/util/Json.java | 63 ++++++
.../util/RandomMetricsProvider.java | 40 ++++
.../loadsimulator/util/TimeStampProvider.java | 52 +++++
.../src/main/resources/metrics_def/DATANODE.dat | 101 +++++++++
.../src/main/resources/metrics_def/HOST.dat | 23 +++
.../main/resources/metrics_def/MASTER_HBASE.dat | 69 +++++++
.../src/main/resources/metrics_def/NAMENODE.dat | 205 +++++++++++++++++++
.../main/resources/metrics_def/NODEMANAGER.dat | 67 ++++++
.../resources/metrics_def/RESOURCEMANAGER.dat | 88 ++++++++
.../main/resources/metrics_def/SLAVE_HBASE.dat | 178 ++++++++++++++++
.../src/main/resources/scripts/start.sh | 30 +++
.../src/main/resources/scripts/start_slaves.sh | 27 +++
.../src/main/resources/scripts/status_slaves.sh | 22 ++
.../src/main/resources/scripts/stop.sh | 32 +++
.../src/main/resources/scripts/stop_slaves.sh | 26 +++
.../loadsimulator/data/TestAppMetrics.java | 134 ++++++++++++
.../metrics/loadsimulator/data/TestMetric.java | 80 ++++++++
.../net/TestRestMetricsSender.java | 76 +++++++
.../net/TestStdOutMetricsSender.java | 37 ++++
.../util/TestRandomMetricsProvider.java | 36 ++++
.../util/TestTimeStampProvider.java | 51 +++++
pom.xml | 3 -
38 files changed, 2628 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-hadoop-timelineservice/pom.xml
index e1f11c9..8ed0e2d 100644
--- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/pom.xml
@@ -244,5 +244,77 @@
<version>1.8</version>
</dependency>
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-assert</artifactId>
+ <version>1.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>3.2</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
+
+ <profiles>
+ <profile>
+ <id>sim</id>
+ <build>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assemblies/simulator.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+ <executions>
+ <execution>
+ <id>build-tarball</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.3.1</version>
+ <!-- The configuration of the plugin -->
+ <configuration>
+ <!-- Configuration of the archiver -->
+ <finalName>${pom.artifactId}-simulator-${pom.version}</finalName>
+ <archive>
+ <!-- Manifest specific configuration -->
+ <manifest>
+ <!-- Classpath is added to the manifest of the created jar file. -->
+ <addClasspath>true</addClasspath>
+ <!--
+ Configures the classpath prefix. This configuration option is
+ used to specify that all needed libraries are found under lib/
+ directory.
+ -->
+ <classpathPrefix></classpathPrefix>
+ <!-- Specifies the main class of the application -->
+ <mainClass>
+ org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.loadsimulator.MetricsLoadSimulator
+ </mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ </profile>
+ </profiles>
</project>
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/assemblies/simulator.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/assemblies/simulator.xml b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/assemblies/simulator.xml
new file mode 100644
index 0000000..0f77976
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/assemblies/simulator.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<assembly>
+ <id>dist</id>
+ <formats>
+ <format>dir</format>
+ <format>tar.gz</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <files>
+ <file>
+ <source>${project.build.directory}/${artifact.artifactId}-simulator-${artifact.version}.jar</source>
+ <outputDirectory>ambari-metrics-${project.version}/lib/ambari-metrics</outputDirectory>
+ </file>
+ </files>
+ <fileSets>
+ <!--
+ Adds startup scripts to the root directory of zip package. The startup
+ scripts are located to src/main/scripts directory as stated by Maven
+ conventions.
+ -->
+ <fileSet>
+ <directory>${basedir}/src/main/resources/scripts</directory>
+ <outputDirectory>ambari-metrics-${project.version}/bin</outputDirectory>
+ <includes>
+ <include>*.sh</include>
+ </includes>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ <!-- adds jar package to the root directory of zip package -->
+<!-- <fileSet>
+ <directory>${project.build.directory}</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ </fileSet>-->
+ </fileSets>
+
+
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>ambari-metrics-${project.version}/lib/ambari-metrics</outputDirectory>
+<!--
+ <useProjectArtifact>false</useProjectArtifact>
+-->
+ <unpack>false</unpack>
+ <scope>compile</scope>
+
+ </dependencySet>
+ </dependencySets>
+
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/conf/simulator-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/conf/simulator-log4j.xml b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/conf/simulator-log4j.xml
new file mode 100644
index 0000000..ac505f6
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/conf/simulator-log4j.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration debug="false">
+
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="target" value="System.out" />
+ <param name="threshold" value="debug" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1}] - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
+ <param name="Threshold" value="INFO" />
+ <param name="File" value="loadsimulator.log"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c{1}] %m %n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value ="info" />
+ <!-- we may want async appender-->
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/LoadRunner.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/LoadRunner.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/LoadRunner.java
new file mode 100644
index 0000000..7974a5f
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/LoadRunner.java
@@ -0,0 +1,160 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator;
+
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data.AppID;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data.ApplicationInstance;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data.HostMetricsGenerator;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data.MetricsGeneratorConfigurer;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.net.MetricsSender;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.net.RestMetricsSender;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.net.StdOutMetricsSender;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.util.TimeStampProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.*;
+
+import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data.AppID.MASTER_APPS;
+import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data.AppID.SLAVE_APPS;
+
+/**
+ *
+ */
+public class LoadRunner {
+ private final static Logger LOG = LoggerFactory.getLogger(LoadRunner.class);
+
+ private final ScheduledExecutorService timer;
+ private final ExecutorService workersPool;
+ private final Collection<Callable<String>> workers;
+ private final long startTime = new Date().getTime();
+ private final int collectIntervalMillis;
+ private final int sendIntervalMillis;
+
+ public LoadRunner(String hostName,
+ int threadCount,
+ String metricsHostName,
+ int collectIntervalMillis,
+ int sendIntervalMillis,
+ boolean createMaster) {
+ this.collectIntervalMillis = collectIntervalMillis;
+ this.workersPool = Executors.newFixedThreadPool(threadCount);
+ this.timer = Executors.newScheduledThreadPool(1);
+ this.sendIntervalMillis = sendIntervalMillis;
+
+ workers = prepareWorkers(hostName, threadCount, metricsHostName, createMaster);
+ }
+
+ private Collection<Callable<String>> prepareWorkers(String hostName,
+ int threadCount,
+ String metricsHost,
+ Boolean createMaster) {
+ Collection<Callable<String>> senderWorkers =
+ new ArrayList<Callable<String>>(threadCount);
+
+ int startIndex = 0;
+ if (createMaster) {
+ String simHost = hostName + ".0";
+ addMetricsWorkers(senderWorkers, simHost, metricsHost, MASTER_APPS);
+ startIndex++;
+ }
+
+ for (int i = startIndex; i < threadCount; i++) {
+ String simHost = hostName + "." + i;
+ addMetricsWorkers(senderWorkers, simHost, metricsHost, SLAVE_APPS);
+ }
+
+ return senderWorkers;
+ }
+
+ private void addMetricsWorkers(Collection<Callable<String>> senderWorkers,
+ String specificHostName,
+ String metricsHostName,
+ AppID[] apps) {
+ for (AppID app : apps) {
+ HostMetricsGenerator metricsGenerator =
+ createApplicationMetrics(specificHostName, app);
+ MetricsSender sender = new RestMetricsSender(metricsHostName);
+ senderWorkers.add(new MetricsSenderWorker(sender, metricsGenerator));
+ }
+ }
+
+ private HostMetricsGenerator createApplicationMetrics(String simHost, AppID host) {
+ ApplicationInstance appInstance = new ApplicationInstance(simHost, host, "");
+ TimeStampProvider timeStampProvider = new TimeStampProvider(startTime,
+ collectIntervalMillis, sendIntervalMillis);
+
+ return MetricsGeneratorConfigurer
+ .createMetricsForHost(appInstance, timeStampProvider);
+ }
+
+ public void start() {
+ timer.scheduleAtFixedRate(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ runOnce();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }
+ }, 0, sendIntervalMillis, TimeUnit.MILLISECONDS);
+ }
+
+ public void runOnce() throws InterruptedException {
+ List<Future<String>> futures = workersPool.invokeAll(workers,
+ sendIntervalMillis / 2,
+ TimeUnit.MILLISECONDS);
+ int done = 0;
+
+ // TODO: correctly count the failed tasks
+ for (Future<String> future : futures) {
+ done += future.isDone() ? 1 : 0;
+ }
+
+ LOG.info("Finished successfully " + done + " tasks ");
+ }
+
+ public void shutdown() {
+ timer.shutdownNow();
+ workersPool.shutdownNow();
+ }
+
+ public static void main(String[] args) {
+ LoadRunner runner =
+ new LoadRunner("local", 2, "metrics", 10000, 20000, false);
+
+ runner.start();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/MetricsLoadSimulator.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/MetricsLoadSimulator.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/MetricsLoadSimulator.java
new file mode 100644
index 0000000..a0c1bd2
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/MetricsLoadSimulator.java
@@ -0,0 +1,120 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Sample Usage:
+ * <pre>
+ * $ java -cp "dependency/*":LoadSimulator-1.0-SNAPSHOT.jar \
+ * org.apache.ambari.metrics.MetricsLoadSimulator \
+ * -h "bartosz.laptop" -n 2 -m "162.216.148.45" -c 10000 -s 30000</pre>
+ */
+public class MetricsLoadSimulator {
+ private final static Logger LOG = LoggerFactory.getLogger(MetricsLoadSimulator
+ .class);
+
+ public static void main(String[] args) throws IOException, InterruptedException {
+ Map<String, String> mapArgs = parseArgs(args);
+
+ LoadRunner loadRunner = new LoadRunner(
+ mapArgs.get("hostName"),
+ Integer.valueOf(mapArgs.get("numberOfHosts")),
+ mapArgs.get("metricsHostName"),
+ Integer.valueOf(mapArgs.get("collectInterval")),
+ Integer.valueOf(mapArgs.get("sendInterval")),
+ Boolean.valueOf(mapArgs.get("master"))
+ );
+
+ loadRunner.start();
+ }
+
+ private static Map<String, String> parseArgs(String[] args) {
+ Map<String, String> mapProps = new HashMap<String, String>();
+ mapProps.put("hostName", "host");
+ mapProps.put("numberOfHosts", "20");
+ mapProps.put("trafficType", "burst");
+ mapProps.put("metricsHostName", "localhost");
+ mapProps.put("collectInterval", "10000");
+ mapProps.put("sendInterval", "60000");
+
+ if (args.length == 0) {
+ printUsage();
+ throw new RuntimeException("Unexpected argument, See usage message.");
+ } else {
+ for (int i = 0; i < args.length; i += 2) {
+ String arg = args[i];
+ if (arg.equals("-h")) {
+ mapProps.put("hostName", args[i + 1]);
+ } else if (arg.equals("-n")) {
+ mapProps.put("numberOfHosts", args[i + 1]);
+ } else if (arg.equals("-t")) {
+ mapProps.put("trafficType", args[i + 1]);
+ } else if (arg.equals("-m")) {
+ mapProps.put("metricsHostName", args[i + 1]);
+ } else if (arg.equals("-c")) {
+ mapProps.put("collectInterval", args[i + 1]);
+ } else if (arg.equals("-s")) {
+ mapProps.put("sendInterval", args[i + 1]);
+ } else if (arg.equals("-M")) {
+ mapProps.put("master", args[i + 1]);
+ } else if (arg.equals("-d")) {
+ // a dummy switch - it says that we agree with defaults
+ } else {
+ printUsage();
+ throw new RuntimeException("Unexpected argument, See usage message.");
+ }
+ }
+ }
+
+ LOG.info("Recognized options: baseHostName={} hosts#={} trafficMode={} " +
+ "metricsHostName={} collectIntervalMillis={} sendIntervalMillis={} " +
+ "simulateMaster={}",
+ mapProps.get("hostName"),
+ Integer.valueOf(mapProps.get("numberOfHosts")),
+ mapProps.get("trafficType"),
+ mapProps.get("metricsHostName"),
+ Integer.valueOf(mapProps.get("collectInterval")),
+ Integer.valueOf(mapProps.get("sendInterval")),
+ Boolean.valueOf(mapProps.get("master"))
+ );
+
+ return mapProps;
+ }
+
+ public static void printUsage() {
+ System.err.println("Usage: java MetricsLoadSimulator [OPTIONS]");
+ System.err.println("Options: ");
+ System.err.println("[-h hostName] [-n numberOfHosts] "
+ + "[-t trafficMode {burst, staggered}] [-m metricsHostName] "
+ + "[-c collectIntervalMillis {10 sec}] [-s sendIntervalMillis {60 sec}]"
+ + "[-M simulateMaster {true, false}] ");
+ System.err.println();
+ System.err.println("When you select a master, then one simulated host will play");
+ System.err.println("a role of a master, and the rest will be slaves. Otherwise");
+ System.err.println("all simulation threads (single thread is for single host)");
+ System.err.println("will be slave hosts");
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/MetricsSenderWorker.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/MetricsSenderWorker.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/MetricsSenderWorker.java
new file mode 100644
index 0000000..c027933
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/MetricsSenderWorker.java
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.loadsimulator;
+
+
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data.AppMetrics;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data.HostMetricsGenerator;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.net.MetricsSender;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.net.RestMetricsSender;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.util.Json;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.concurrent.Callable;
+
+/**
+ */
+public class MetricsSenderWorker implements Callable<String> {
+ private final static Logger LOG = LoggerFactory.getLogger(RestMetricsSender.class);
+
+ MetricsSender sender;
+ HostMetricsGenerator hmg;
+
+ public MetricsSenderWorker(MetricsSender sender, HostMetricsGenerator metricsGenerator) {
+ this.sender = sender;
+ hmg = metricsGenerator;
+ }
+
+ @Override
+ public String call() throws Exception {
+ AppMetrics hostMetrics = hmg.createMetrics();
+
+ try {
+ String request = new Json().serialize(hostMetrics);
+ String response = sender.pushMetrics(request);
+
+ return response;
+ } catch (IOException e) {
+ LOG.error("Error while pushing metrics: ", e);
+ throw e;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/AppID.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/AppID.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/AppID.java
new file mode 100644
index 0000000..4f58dc5
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/AppID.java
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data;
+
+public enum AppID {
+ HOST("HOST"),
+ NAMENODE("namenode"),
+ RESOURCEMANAGER("resourcemanager"),
+ DATANODE("datanode"),
+ NODEMANAGER("nodemanager"),
+ MASTER_HBASE("hbase"),
+ SLAVE_HBASE("hbase");
+
+ public static final AppID[] MASTER_APPS = {HOST, NAMENODE, RESOURCEMANAGER, MASTER_HBASE};
+ public static final AppID[] SLAVE_APPS = {HOST, DATANODE, NODEMANAGER, SLAVE_HBASE};
+
+ private String id;
+
+ private AppID(String id) {
+ this.id = id;
+ }
+
+ public String getId() {
+ return id;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/AppMetrics.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/AppMetrics.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/AppMetrics.java
new file mode 100644
index 0000000..d9cec2b
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/AppMetrics.java
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * AppMetrics is a class that helps to create properly initialized metrics for
+ * current app. It also holds the
+ * metrics and can be serialized to json.
+ */
+public class AppMetrics {
+
+ private final Collection<Metric> metrics = new ArrayList<Metric>();
+ private final transient ApplicationInstance applicationId;
+ private final transient long startTime;
+
+ public AppMetrics(ApplicationInstance applicationId, long startTime) {
+ this.applicationId = applicationId;
+ this.startTime = startTime;
+ }
+
+ public Metric createMetric(String metricName) {
+ return new Metric(applicationId, metricName, startTime);
+ }
+
+ public void addMetric(Metric metric) {
+ metrics.add(metric);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/ApplicationInstance.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/ApplicationInstance.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/ApplicationInstance.java
new file mode 100644
index 0000000..d99ecc9
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/ApplicationInstance.java
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.data;
+
+/**
+ * AppId is a helper class that encapsulates the common part of metrics message.
+ * It contains hostName, appId and instanceId. It is immutable,
+ * and it can not hold null values.
+ */
+public final class ApplicationInstance {
+
+ private final transient String hostName;
+ private final transient AppID appId;
+ private final transient String instanceId;
+
+ /**
+ * @param hostname
+ * @param appId
+ * @param instanceId
+ */
+ public ApplicationInstance(String hostname, AppID appId, String instanceId) {
+ if (hostname == null || appId == null || instanceId == null)
+ throw new IllegalArgumentException("ApplicationInstance can not be " +
+ "instantiated with null values");
+
+ this.hostName = hostname;
+ this.appId = appId;
+ this.instanceId = instanceId;
+ }
+
+ public String getInstanceId() {
+ return instanceId;
+ }
+
+ public AppID getAppId() {
+ return appId;
+ }
+
+ public String getHostName() {
+ return hostName;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/HostMetricsGenerator.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/HostMetricsGenerator.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/HostMetricsGenerator.java
new file mode 100644
index 0000000..61a6624
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/HostMetricsGenerator.java
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.loadsimulator.data;
+
+
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.util.RandomMetricsProvider;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.util.TimeStampProvider;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ */
+public class HostMetricsGenerator {
+
+ private Map<String, RandomMetricsProvider> metricDataProviders = new HashMap<String, RandomMetricsProvider>();
+ private final TimeStampProvider tsp;
+ private final ApplicationInstance id;
+
+ public HostMetricsGenerator(ApplicationInstance id,
+ TimeStampProvider timeStamps,
+ Map<String, RandomMetricsProvider> metricDataProviders) {
+ this.id = id;
+ this.tsp = timeStamps;
+ this.metricDataProviders = metricDataProviders;
+ }
+
+ public AppMetrics createMetrics() {
+ long[] timestamps = tsp.timestampsForNextInterval();
+ AppMetrics appMetrics = new AppMetrics(id, timestamps[0]);
+
+ for (Map.Entry<String, RandomMetricsProvider> entry : metricDataProviders.entrySet()) {
+ String metricName = entry.getKey();
+ RandomMetricsProvider metricData = entry.getValue();
+
+ Metric metric = appMetrics.createMetric(metricName);
+ for (long timestamp : timestamps) {
+ metric.putMetric(timestamp, String.valueOf(metricData.next()));
+ }
+ appMetrics.addMetric(metric);
+ }
+
+ return appMetrics;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/Metric.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/Metric.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/Metric.java
new file mode 100644
index 0000000..f274263
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/Metric.java
@@ -0,0 +1,71 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.loadsimulator.data;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public class Metric {
+
+ private String instanceid;
+ private String hostname;
+ private Map<String, String> metrics = new LinkedHashMap<String, String>();
+ private String starttime;
+ private String appid;
+ private String metricname;
+
+ // i don't like this ctor, but it has to be public for json deserialization
+ public Metric() {
+ }
+
+ public Metric(ApplicationInstance app, String metricName, long startTime) {
+ this.hostname = app.getHostName();
+ this.appid = app.getAppId().getId();
+ this.instanceid = app.getInstanceId();
+ this.metricname = metricName;
+ this.starttime = Long.toString(startTime);
+ }
+
+ public void putMetric(long timestamp, String value) {
+ metrics.put(Long.toString(timestamp), value);
+ }
+
+ public String getInstanceid() {
+ return instanceid;
+ }
+
+ public String getHostname() {
+ return hostname;
+ }
+
+ public Map<String, String> getMetrics() {
+ return metrics;
+ }
+
+ public String getStarttime() {
+ return starttime;
+ }
+
+ public String getAppid() {
+ return appid;
+ }
+
+ public String getMetricname() {
+ return metricname;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/MetricsGeneratorConfigurer.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/MetricsGeneratorConfigurer.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/MetricsGeneratorConfigurer.java
new file mode 100644
index 0000000..b3401b2
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/data/MetricsGeneratorConfigurer.java
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.loadsimulator.data;
+
+
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.util.RandomMetricsProvider;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.util.TimeStampProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * MetricsGeneratorConfigurer is a factory that reads metrics definition from a file,
+ * and returns an Single HostMetricsGenerator. Check createMetricsForHost method
+ * for details.
+ */
+public class MetricsGeneratorConfigurer {
+
+ private final static Logger LOG = LoggerFactory.getLogger
+ (MetricsGeneratorConfigurer.class);
+
+ /**
+ * Creates HostMetricsGenerator configured with metric names loaded from file.
+ *
+ * @param id ApplicationInstance descriptor, will be used to create
+ * HostMetricsGenerator, cannot be null
+ * @param timeStamps configured TimeStampProvider that can provide next
+ * timestamp, cannot be null
+ * @return HostMetricsGenerator with given ApplicationInstance id and configured
+ * mapping of
+ * metric names to data providers
+ */
+ public static HostMetricsGenerator createMetricsForHost(
+ ApplicationInstance id,
+ TimeStampProvider timeStamps) {
+ return new HostMetricsGenerator(id, timeStamps, readMetrics(id.getAppId()));
+ }
+
+ private static Map<String, RandomMetricsProvider> readMetrics(AppID type) {
+ InputStream input = null;
+ Map<String, RandomMetricsProvider> metrics =
+ new HashMap<String, RandomMetricsProvider>();
+ String fileName = "metrics_def/" + type.toString() + ".dat";
+
+ try {
+ LOG.info("Loading " + fileName);
+
+ input = MetricsGeneratorConfigurer.class.getClassLoader()
+ .getResourceAsStream(fileName);
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(input));
+
+ String line;
+ while ((line = reader.readLine()) != null) {
+ metrics.put(line.trim(), new RandomMetricsProvider(100, 200));
+ }
+
+ } catch (IOException e) {
+ LOG.error("Cannot read file " + fileName + " for appID " + type.toString(), e);
+ } finally {
+ if (input != null) {
+ try {
+ input.close();
+ } catch (IOException ex) {
+ // intentionally left blank, here we cannot do anything
+ }
+ }
+ }
+
+ return metrics;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/MetricsSender.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/MetricsSender.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/MetricsSender.java
new file mode 100644
index 0000000..35c0fc3
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/MetricsSender.java
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.loadsimulator.net;
+
+/**
+ * MetricSender should provides a simple way of pushing metrics to some service.
+ */
+public interface MetricsSender {
+ /**
+ * Push metrics to the metric service (e.g. a metrics storage system).
+ *
+ * @param payload the payload to be sent to metrics service
+ * @return response message either acknowledgement or error
+ */
+ String pushMetrics(String payload);
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/RestMetricsSender.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/RestMetricsSender.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/RestMetricsSender.java
new file mode 100644
index 0000000..5130ae3
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/RestMetricsSender.java
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.loadsimulator.net;
+
+import com.google.common.base.Stopwatch;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.ProtocolException;
+
+/**
+ * Implements MetricsSender and provides a way of pushing metrics to application metrics history service using REST
+ * endpoint.
+ */
+public class RestMetricsSender implements MetricsSender {
+ private final static Logger LOG = LoggerFactory.getLogger(RestMetricsSender.class);
+
+ private final static String COLLECTOR_URL = "http://%s:8188/ws/v1/timeline/metrics";
+ private final String collectorServiceAddress;
+
+ /**
+ * Creates unconnected RestMetricsSender with endpoint configured as
+ * http://${metricsHost}:8188/ws/v1/timeline/metrics,
+ * where ${metricsHost} is specified by metricHost param.
+ *
+ * @param metricsHost the hostname that will be used to access application metrics history service.
+ */
+ public RestMetricsSender(String metricsHost) {
+ collectorServiceAddress = String.format(COLLECTOR_URL, metricsHost);
+ }
+
+ /**
+ * Push metrics to the REST endpoint. Connection is always open and closed on every call.
+ *
+ * @param payload the payload with metrics to be sent to metrics service
+ * @return response message either acknowledgement or error, empty on exception
+ */
+ @Override
+ public String pushMetrics(String payload) {
+ String responseString = "";
+ UrlService svc = null;
+ Stopwatch timer = new Stopwatch().start();
+
+ try {
+ LOG.info("server: {}", collectorServiceAddress);
+
+ svc = getConnectedUrlService();
+ responseString = svc.send(payload);
+
+ timer.stop();
+ LOG.info("http response time: " + timer.elapsedMillis() + " ms");
+
+ if (responseString.length() > 0) {
+ LOG.debug("POST response from server: " + responseString);
+ }
+ } catch (MalformedURLException e) {
+ LOG.error("", e);
+ } catch (ProtocolException e) {
+ LOG.error("", e);
+ } catch (IOException e) {
+ LOG.error("", e);
+ } finally {
+ if (svc != null) {
+ svc.disconnect();
+ }
+ }
+
+ return responseString;
+ }
+
+ /**
+ * Relaxed to protected for testing.
+ */
+ protected UrlService getConnectedUrlService() throws IOException {
+ return UrlService.newConnection(collectorServiceAddress);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/StdOutMetricsSender.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/StdOutMetricsSender.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/StdOutMetricsSender.java
new file mode 100644
index 0000000..aeb4ca8
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/StdOutMetricsSender.java
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.loadsimulator.net;
+
+import java.io.PrintStream;
+
+/**
+ * StdOutMetricsSender dumps metrics to defined PrintStream out. It is useful for testing.
+ */
+public class StdOutMetricsSender implements MetricsSender {
+ public final PrintStream out;
+ private String metricsHostName;
+
+ /**
+ * Creates new StdOutMetricsSender with specified hostname (only used in messages) and sends output to System.out
+ *
+ * @param metricsHostName a name used in printed messages
+ */
+ public StdOutMetricsSender(String metricsHostName) {
+ this(metricsHostName, System.out);
+ }
+
+ /**
+ * Creates new StdOutMetricsSender with specified hostname (only used in messages) and PrintStream which is used as
+ * an output.
+ *
+ * @param metricsHostName a name used in printed messages
+ * @param out PrintStream that the Sender will write to, can be System.out
+ */
+ public StdOutMetricsSender(String metricsHostName, PrintStream out) {
+ this.metricsHostName = metricsHostName;
+ this.out = out;
+ }
+
+ @Override
+ public String pushMetrics(String payload) {
+ out.println("Sending to " + metricsHostName + ": " + payload);
+
+ return "OK";
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/UrlService.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/UrlService.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/UrlService.java
new file mode 100644
index 0000000..7402438
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/net/UrlService.java
@@ -0,0 +1,101 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.net;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+public class UrlService {
+
+ public static final int CONNECT_TIMEOUT = 20000;
+ public static final int READ_TIMEOUT = 20000;
+ private final String address;
+ private HttpURLConnection conn;
+
+ private UrlService(String address) {
+ this.address = address;
+ }
+
+ /**
+ * Returns a new UrlService connected to specified address.
+ *
+ * @param address
+ * @return
+ * @throws IOException
+ */
+ public static UrlService newConnection(String address) throws IOException {
+ UrlService svc = new UrlService(address);
+ svc.connect();
+
+ return svc;
+ }
+
+ public HttpURLConnection connect() throws IOException {
+ URL url = new URL(address);
+ conn = (HttpURLConnection) url.openConnection();
+
+ //TODO: make timeouts configurable
+ conn.setConnectTimeout(CONNECT_TIMEOUT);
+ conn.setReadTimeout(READ_TIMEOUT);
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+ conn.setRequestMethod("POST");
+ conn.setRequestProperty("Content-Type", "application/json");
+ conn.setRequestProperty("Accept", "*/*");
+
+ return conn;
+ }
+
+ public String send(String payload) throws IOException {
+ if (conn == null)
+ throw new IllegalStateException("Cannot use unconnected UrlService");
+ write(payload);
+
+ return read();
+ }
+
+ private String read() throws IOException {
+ StringBuilder response = new StringBuilder();
+
+ BufferedReader br = new BufferedReader(new InputStreamReader(
+ conn.getInputStream()));
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ response.append(line);
+ }
+ br.close();
+
+ return response.toString();
+ }
+
+ private void write(String payload) throws IOException {
+ OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream(),
+ "UTF-8");
+ writer.write(payload);
+ writer.close();
+ }
+
+ public void disconnect() {
+ conn.disconnect();
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/Json.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/Json.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/Json.java
new file mode 100644
index 0000000..61a3903
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/Json.java
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.util;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonMethod;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
+
+import java.io.IOException;
+
+/**
+ * Small wrapper that configures the ObjectMapper with some defaults.
+ */
+public class Json {
+ private ObjectMapper myObjectMapper;
+
+ /**
+ * Creates default Json ObjectMapper that maps fields.
+ */
+ public Json() {
+ this(false);
+ }
+
+ /**
+ * Creates a Json ObjectMapper that maps fields and optionally pretty prints the
+ * serialized objects.
+ *
+ * @param pretty a flag - if true the output will be pretty printed.
+ */
+ public Json(boolean pretty) {
+ myObjectMapper = new ObjectMapper();
+ myObjectMapper.setVisibility(JsonMethod.FIELD, JsonAutoDetect.Visibility.ANY);
+ if (pretty) {
+ myObjectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+ }
+ }
+
+ public String serialize(Object o) throws IOException {
+ return myObjectMapper.writeValueAsString(o);
+ }
+
+ public <T> T deserialize(String content, Class<T> paramClass) throws IOException {
+ return myObjectMapper.readValue(content, paramClass);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/RandomMetricsProvider.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/RandomMetricsProvider.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/RandomMetricsProvider.java
new file mode 100644
index 0000000..7910711
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/RandomMetricsProvider.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.util;
+
+import java.util.Random;
+
+/**
+ */
+public class RandomMetricsProvider {
+
+ private double min;
+ private double max;
+ private Random rnd;
+
+ public RandomMetricsProvider(double min, double max) {
+ this.min = min;
+ this.max = max;
+ this.rnd = new Random();
+ }
+
+ public double next() {
+ return rnd.nextDouble() * (max - min) + min;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/TimeStampProvider.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/TimeStampProvider.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/TimeStampProvider.java
new file mode 100644
index 0000000..ad7ec86
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/loadsimulator/util/TimeStampProvider.java
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics
+ .loadsimulator.util;
+
+/**
+ */
+public class TimeStampProvider {
+ private int timeStep;
+ private long currentTime;
+ private int sendInterval;
+
+ public TimeStampProvider(long startTime, int timeStep, int sendInterval) {
+ this.timeStep = timeStep;
+ this.currentTime = startTime - timeStep;
+ this.sendInterval = sendInterval;
+ }
+
+ public long next() {
+ return currentTime += timeStep;
+ }
+
+ public long[] timestampsForNextInterval() {
+ return timestampsForInterval(sendInterval);
+ }
+
+ private long[] timestampsForInterval(int sendInterval) {
+ int steps = sendInterval / timeStep;
+ long[] timestamps = new long[steps];
+
+ for (int i = 0; i < timestamps.length; i++) {
+ timestamps[i] = next();
+ }
+
+ return timestamps;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/DATANODE.dat
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/DATANODE.dat b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/DATANODE.dat
new file mode 100644
index 0000000..e157630
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/DATANODE.dat
@@ -0,0 +1,101 @@
+| dfs.datanode.BlockChecksumOpAvgTime | datanode |
+| dfs.datanode.BlockChecksumOpNumOps | datanode |
+| dfs.datanode.BlockReportsAvgTime | datanode |
+| dfs.datanode.BlockReportsNumOps | datanode |
+| dfs.datanode.BlockVerificationFailures | datanode |
+| dfs.datanode.BlocksCached | datanode |
+| dfs.datanode.BlocksGetLocalPathInfo | datanode |
+| dfs.datanode.BlocksRead | datanode |
+| dfs.datanode.BlocksRemoved | datanode |
+| dfs.datanode.BlocksReplicated | datanode |
+| dfs.datanode.BlocksUncached | datanode |
+| dfs.datanode.BlocksVerified | datanode |
+| dfs.datanode.BlocksWritten | datanode |
+| dfs.datanode.BytesRead | datanode |
+| dfs.datanode.BytesWritten | datanode |
+| dfs.datanode.CacheReportsAvgTime | datanode |
+| dfs.datanode.CacheReportsNumOps | datanode |
+| dfs.datanode.CopyBlockOpAvgTime | datanode |
+| dfs.datanode.CopyBlockOpNumOps | datanode |
+| dfs.datanode.FlushNanosAvgTime | datanode |
+| dfs.datanode.FlushNanosNumOps | datanode |
+| dfs.datanode.FsyncCount | datanode |
+| dfs.datanode.FsyncNanosAvgTime | datanode |
+| dfs.datanode.FsyncNanosNumOps | datanode |
+| dfs.datanode.HeartbeatsAvgTime | datanode |
+| dfs.datanode.HeartbeatsNumOps | datanode |
+| dfs.datanode.PacketAckRoundTripTimeNanosAvgTime | datanode |
+| dfs.datanode.PacketAckRoundTripTimeNanosNumOps | datanode |
+| dfs.datanode.ReadBlockOpAvgTime | datanode |
+| dfs.datanode.ReadBlockOpNumOps | datanode |
+| dfs.datanode.ReadsFromLocalClient | datanode |
+| dfs.datanode.ReadsFromRemoteClient | datanode |
+| dfs.datanode.ReplaceBlockOpAvgTime | datanode |
+| dfs.datanode.ReplaceBlockOpNumOps | datanode |
+| dfs.datanode.SendDataPacketBlockedOnNetworkNanosAvgTime | datanode |
+| dfs.datanode.SendDataPacketBlockedOnNetworkNanosNumOps | datanode |
+| dfs.datanode.SendDataPacketTransferNanosAvgTime | datanode |
+| dfs.datanode.SendDataPacketTransferNanosNumOps | datanode |
+| dfs.datanode.VolumeFailures | datanode |
+| dfs.datanode.WriteBlockOpAvgTime | datanode |
+| dfs.datanode.WriteBlockOpNumOps | datanode |
+| dfs.datanode.WritesFromLocalClient | datanode |
+| dfs.datanode.WritesFromRemoteClient | datanode |
+| jvm.JvmMetrics.GcCount | datanode |
+| jvm.JvmMetrics.GcCountCopy | datanode |
+| jvm.JvmMetrics.GcCountMarkSweepCompact | datanode |
+| jvm.JvmMetrics.GcTimeMillis | datanode |
+| jvm.JvmMetrics.GcTimeMillisCopy | datanode |
+| jvm.JvmMetrics.GcTimeMillisMarkSweepCompact | datanode |
+| jvm.JvmMetrics.LogError | datanode |
+| jvm.JvmMetrics.LogFatal | datanode |
+| jvm.JvmMetrics.LogInfo | datanode |
+| jvm.JvmMetrics.LogWarn | datanode |
+| jvm.JvmMetrics.MemHeapCommittedM | datanode |
+| jvm.JvmMetrics.MemHeapMaxM | datanode |
+| jvm.JvmMetrics.MemHeapUsedM | datanode |
+| jvm.JvmMetrics.MemMaxM | datanode |
+| jvm.JvmMetrics.MemNonHeapCommittedM | datanode |
+| jvm.JvmMetrics.MemNonHeapMaxM | datanode |
+| jvm.JvmMetrics.MemNonHeapUsedM | datanode |
+| jvm.JvmMetrics.ThreadsBlocked | datanode |
+| jvm.JvmMetrics.ThreadsNew | datanode |
+| jvm.JvmMetrics.ThreadsRunnable | datanode |
+| jvm.JvmMetrics.ThreadsTerminated | datanode |
+| jvm.JvmMetrics.ThreadsTimedWaiting | datanode |
+| jvm.JvmMetrics.ThreadsWaiting | datanode |
+| metricssystem.MetricsSystem.DroppedPubAll | datanode |
+| metricssystem.MetricsSystem.NumActiveSinks | datanode |
+| metricssystem.MetricsSystem.NumActiveSources | datanode |
+| metricssystem.MetricsSystem.NumAllSinks | datanode |
+| metricssystem.MetricsSystem.NumAllSources | datanode |
+| metricssystem.MetricsSystem.PublishAvgTime | datanode |
+| metricssystem.MetricsSystem.PublishNumOps | datanode |
+| metricssystem.MetricsSystem.Sink_timelineAvgTime | datanode |
+| metricssystem.MetricsSystem.Sink_timelineDropped | datanode |
+| metricssystem.MetricsSystem.Sink_timelineNumOps | datanode |
+| metricssystem.MetricsSystem.Sink_timelineQsize | datanode |
+| metricssystem.MetricsSystem.SnapshotAvgTime | datanode |
+| metricssystem.MetricsSystem.SnapshotNumOps | datanode |
+| rpc.rpc.CallQueueLength | datanode |
+| rpc.rpc.NumOpenConnections | datanode |
+| rpc.rpc.ReceivedBytes | datanode |
+| rpc.rpc.RpcAuthenticationFailures | datanode |
+| rpc.rpc.RpcAuthenticationSuccesses | datanode |
+| rpc.rpc.RpcAuthorizationFailures | datanode |
+| rpc.rpc.RpcAuthorizationSuccesses | datanode |
+| rpc.rpc.RpcProcessingTimeAvgTime | datanode |
+| rpc.rpc.RpcProcessingTimeNumOps | datanode |
+| rpc.rpc.RpcQueueTimeAvgTime | datanode |
+| rpc.rpc.RpcQueueTimeNumOps | datanode |
+| rpc.rpc.SentBytes | datanode |
+| rpcdetailed.rpcdetailed.InitReplicaRecoveryAvgTime | datanode |
+| rpcdetailed.rpcdetailed.InitReplicaRecoveryNumOps | datanode |
+| rpcdetailed.rpcdetailed.UpdateReplicaUnderRecoveryAvgTime | datanode |
+| rpcdetailed.rpcdetailed.UpdateReplicaUnderRecoveryNumOps | datanode |
+| ugi.UgiMetrics.GetGroupsAvgTime | datanode |
+| ugi.UgiMetrics.GetGroupsNumOps | datanode |
+| ugi.UgiMetrics.LoginFailureAvgTime | datanode |
+| ugi.UgiMetrics.LoginFailureNumOps | datanode |
+| ugi.UgiMetrics.LoginSuccessAvgTime | datanode |
+| ugi.UgiMetrics.LoginSuccessNumOps | datanode |
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/HOST.dat
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/HOST.dat b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/HOST.dat
new file mode 100644
index 0000000..c940800
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/HOST.dat
@@ -0,0 +1,23 @@
+bytes_in
+bytes_out
+cpu_idle
+cpu_intr
+cpu_nice
+cpu_sintr
+cpu_system
+cpu_user
+cpu_wio
+disk_free
+disk_percent
+disk_total
+disk_used
+load_fifteen
+load_five
+load_one
+mem_buffered
+mem_cached
+mem_free
+mem_shared
+pkts_in
+pkts_out
+swap_free
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/MASTER_HBASE.dat
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/MASTER_HBASE.dat b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/MASTER_HBASE.dat
new file mode 100644
index 0000000..9ba90f1
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/MASTER_HBASE.dat
@@ -0,0 +1,69 @@
+ipc.IPC.authenticationFailures
+ipc.IPC.authenticationSuccesses
+ipc.IPC.authorizationFailures
+ipc.IPC.authorizationSuccesses
+ipc.IPC.numCallsInGeneralQueue
+ipc.IPC.numCallsInPriorityQueue
+ipc.IPC.numCallsInReplicationQueue
+ipc.IPC.numOpenConnections
+ipc.IPC.ProcessCallTime_75th_percentile
+ipc.IPC.ProcessCallTime_95th_percentile
+ipc.IPC.ProcessCallTime_99th_percentile
+ipc.IPC.ProcessCallTime_max
+ipc.IPC.ProcessCallTime_mean
+ipc.IPC.ProcessCallTime_median
+ipc.IPC.ProcessCallTime_min
+ipc.IPC.ProcessCallTime_num_ops
+ipc.IPC.QueueCallTime_75th_percentile
+ipc.IPC.QueueCallTime_95th_percentile
+ipc.IPC.QueueCallTime_99th_percentile
+ipc.IPC.QueueCallTime_max
+ipc.IPC.QueueCallTime_mean
+ipc.IPC.QueueCallTime_median
+ipc.IPC.QueueCallTime_min
+ipc.IPC.QueueCallTime_num_ops
+ipc.IPC.queueSize
+ipc.IPC.receivedBytes
+ipc.IPC.sentBytes
+jvm.JvmMetrics.GcCount
+jvm.JvmMetrics.GcCountConcurrentMarkSweep
+jvm.JvmMetrics.GcCountCopy
+jvm.JvmMetrics.GcTimeMillis
+jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep
+jvm.JvmMetrics.GcTimeMillisCopy
+jvm.JvmMetrics.LogError
+jvm.JvmMetrics.LogFatal
+jvm.JvmMetrics.LogInfo
+jvm.JvmMetrics.LogWarn
+jvm.JvmMetrics.MemHeapCommittedM
+jvm.JvmMetrics.MemHeapMaxM
+jvm.JvmMetrics.MemHeapUsedM
+jvm.JvmMetrics.MemMaxM
+jvm.JvmMetrics.MemNonHeapCommittedM
+jvm.JvmMetrics.MemNonHeapMaxM
+jvm.JvmMetrics.MemNonHeapUsedM
+jvm.JvmMetrics.ThreadsBlocked
+jvm.JvmMetrics.ThreadsNew
+jvm.JvmMetrics.ThreadsRunnable
+jvm.JvmMetrics.ThreadsTerminated
+jvm.JvmMetrics.ThreadsTimedWaiting
+jvm.JvmMetrics.ThreadsWaiting
+metricssystem.MetricsSystem.DroppedPubAll
+metricssystem.MetricsSystem.NumActiveSinks
+metricssystem.MetricsSystem.NumActiveSources
+metricssystem.MetricsSystem.NumAllSinks
+metricssystem.MetricsSystem.NumAllSources
+metricssystem.MetricsSystem.PublishAvgTime
+metricssystem.MetricsSystem.PublishNumOps
+metricssystem.MetricsSystem.Sink_timelineAvgTime
+metricssystem.MetricsSystem.Sink_timelineDropped
+metricssystem.MetricsSystem.Sink_timelineNumOps
+metricssystem.MetricsSystem.Sink_timelineQsize
+metricssystem.MetricsSystem.SnapshotAvgTime
+metricssystem.MetricsSystem.SnapshotNumOps
+ugi.UgiMetrics.GetGroupsAvgTime
+ugi.UgiMetrics.GetGroupsNumOps
+ugi.UgiMetrics.LoginFailureAvgTime
+ugi.UgiMetrics.LoginFailureNumOps
+ugi.UgiMetrics.LoginSuccessAvgTime
+ugi.UgiMetrics.LoginSuccessNumOps
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NAMENODE.dat
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NAMENODE.dat b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NAMENODE.dat
new file mode 100644
index 0000000..6e98a9c
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NAMENODE.dat
@@ -0,0 +1,205 @@
+default.StartupProgress.ElapsedTime
+default.StartupProgress.LoadingEditsCount
+default.StartupProgress.LoadingEditsElapsedTime
+default.StartupProgress.LoadingEditsPercentComplete
+default.StartupProgress.LoadingEditsTotal
+default.StartupProgress.LoadingFsImageCount
+default.StartupProgress.LoadingFsImageElapsedTime
+default.StartupProgress.LoadingFsImagePercentComplete
+default.StartupProgress.LoadingFsImageTotal
+default.StartupProgress.PercentComplete
+default.StartupProgress.SafeModeCount
+default.StartupProgress.SafeModeElapsedTime
+default.StartupProgress.SafeModePercentComplete
+default.StartupProgress.SafeModeTotal
+default.StartupProgress.SavingCheckpointCount
+default.StartupProgress.SavingCheckpointElapsedTime
+default.StartupProgress.SavingCheckpointPercentComplete
+default.StartupProgress.SavingCheckpointTotal
+dfs.FSNamesystem.BlockCapacity
+dfs.FSNamesystem.BlocksTotal
+dfs.FSNamesystem.CapacityRemaining
+dfs.FSNamesystem.CapacityRemainingGB
+dfs.FSNamesystem.CapacityTotal
+dfs.FSNamesystem.CapacityTotalGB
+dfs.FSNamesystem.CapacityUsed
+dfs.FSNamesystem.CapacityUsedGB
+dfs.FSNamesystem.CapacityUsedNonDFS
+dfs.FSNamesystem.CorruptBlocks
+dfs.FSNamesystem.ExcessBlocks
+dfs.FSNamesystem.ExpiredHeartbeats
+dfs.FSNamesystem.FilesTotal
+dfs.FSNamesystem.LastCheckpointTime
+dfs.FSNamesystem.LastWrittenTransactionId
+dfs.FSNamesystem.MillisSinceLastLoadedEdits
+dfs.FSNamesystem.MissingBlocks
+dfs.FSNamesystem.PendingDataNodeMessageCount
+dfs.FSNamesystem.PendingDeletionBlocks
+dfs.FSNamesystem.PendingReplicationBlocks
+dfs.FSNamesystem.PostponedMisreplicatedBlocks
+dfs.FSNamesystem.ScheduledReplicationBlocks
+dfs.FSNamesystem.Snapshots
+dfs.FSNamesystem.SnapshottableDirectories
+dfs.FSNamesystem.StaleDataNodes
+dfs.FSNamesystem.TotalFiles
+dfs.FSNamesystem.TotalLoad
+dfs.FSNamesystem.TransactionsSinceLastCheckpoint
+dfs.FSNamesystem.TransactionsSinceLastLogRoll
+dfs.FSNamesystem.UnderReplicatedBlocks
+dfs.namenode.AddBlockOps
+dfs.namenode.AllowSnapshotOps
+dfs.namenode.BlockReceivedAndDeletedOps
+dfs.namenode.BlockReportAvgTime
+dfs.namenode.BlockReportNumOps
+dfs.namenode.CacheReportAvgTime
+dfs.namenode.CacheReportNumOps
+dfs.namenode.CreateFileOps
+dfs.namenode.CreateSnapshotOps
+dfs.namenode.CreateSymlinkOps
+dfs.namenode.DeleteFileOps
+dfs.namenode.DeleteSnapshotOps
+dfs.namenode.DisallowSnapshotOps
+dfs.namenode.FileInfoOps
+dfs.namenode.FilesAppended
+dfs.namenode.FilesCreated
+dfs.namenode.FilesDeleted
+dfs.namenode.FilesInGetListingOps
+dfs.namenode.FilesRenamed
+dfs.namenode.FsImageLoadTime
+dfs.namenode.GetAdditionalDatanodeOps
+dfs.namenode.GetBlockLocations
+dfs.namenode.GetEditAvgTime
+dfs.namenode.GetEditNumOps
+dfs.namenode.GetImageAvgTime
+dfs.namenode.GetImageNumOps
+dfs.namenode.GetLinkTargetOps
+dfs.namenode.GetListingOps
+dfs.namenode.ListSnapshottableDirOps
+dfs.namenode.PutImageAvgTime
+dfs.namenode.PutImageNumOps
+dfs.namenode.RenameSnapshotOps
+dfs.namenode.SafeModeTime
+dfs.namenode.SnapshotDiffReportOps
+dfs.namenode.StorageBlockReportOps
+dfs.namenode.SyncsAvgTime
+dfs.namenode.SyncsNumOps
+dfs.namenode.TransactionsAvgTime
+dfs.namenode.TransactionsBatchedInSync
+dfs.namenode.TransactionsNumOps
+jvm.JvmMetrics.GcCount
+jvm.JvmMetrics.GcCountConcurrentMarkSweep
+jvm.JvmMetrics.GcCountParNew
+jvm.JvmMetrics.GcTimeMillis
+jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep
+jvm.JvmMetrics.GcTimeMillisParNew
+jvm.JvmMetrics.LogError
+jvm.JvmMetrics.LogFatal
+jvm.JvmMetrics.LogInfo
+jvm.JvmMetrics.LogWarn
+jvm.JvmMetrics.MemHeapCommittedM
+jvm.JvmMetrics.MemHeapMaxM
+jvm.JvmMetrics.MemHeapUsedM
+jvm.JvmMetrics.MemMaxM
+jvm.JvmMetrics.MemNonHeapCommittedM
+jvm.JvmMetrics.MemNonHeapMaxM
+jvm.JvmMetrics.MemNonHeapUsedM
+jvm.JvmMetrics.ThreadsBlocked
+jvm.JvmMetrics.ThreadsNew
+jvm.JvmMetrics.ThreadsRunnable
+jvm.JvmMetrics.ThreadsTerminated
+jvm.JvmMetrics.ThreadsTimedWaiting
+jvm.JvmMetrics.ThreadsWaiting
+metricssystem.MetricsSystem.DroppedPubAll
+metricssystem.MetricsSystem.NumActiveSinks
+metricssystem.MetricsSystem.NumActiveSources
+metricssystem.MetricsSystem.NumAllSinks
+metricssystem.MetricsSystem.NumAllSources
+metricssystem.MetricsSystem.PublishAvgTime
+metricssystem.MetricsSystem.PublishNumOps
+metricssystem.MetricsSystem.Sink_timelineAvgTime
+metricssystem.MetricsSystem.Sink_timelineDropped
+metricssystem.MetricsSystem.Sink_timelineNumOps
+metricssystem.MetricsSystem.Sink_timelineQsize
+metricssystem.MetricsSystem.SnapshotAvgTime
+metricssystem.MetricsSystem.SnapshotNumOps
+rpc.RetryCache.NameNodeRetryCache.CacheCleared
+rpc.RetryCache.NameNodeRetryCache.CacheHit
+rpc.RetryCache.NameNodeRetryCache.CacheUpdated
+rpc.rpc.CallQueueLength
+rpc.rpc.NumOpenConnections
+rpc.rpc.ReceivedBytes
+rpc.rpc.RpcAuthenticationFailures
+rpc.rpc.RpcAuthenticationSuccesses
+rpc.rpc.RpcAuthorizationFailures
+rpc.rpc.RpcAuthorizationSuccesses
+rpc.rpc.RpcProcessingTimeAvgTime
+rpc.rpc.RpcProcessingTimeNumOps
+rpc.rpc.RpcQueueTimeAvgTime
+rpc.rpc.RpcQueueTimeNumOps
+rpc.rpc.SentBytes
+rpcdetailed.rpcdetailed.AbandonBlockAvgTime
+rpcdetailed.rpcdetailed.AbandonBlockNumOps
+rpcdetailed.rpcdetailed.AddBlockAvgTime
+rpcdetailed.rpcdetailed.AddBlockNumOps
+rpcdetailed.rpcdetailed.BlockReceivedAndDeletedAvgTime
+rpcdetailed.rpcdetailed.BlockReceivedAndDeletedNumOps
+rpcdetailed.rpcdetailed.BlockReportAvgTime
+rpcdetailed.rpcdetailed.BlockReportNumOps
+rpcdetailed.rpcdetailed.CommitBlockSynchronizationAvgTime
+rpcdetailed.rpcdetailed.CommitBlockSynchronizationNumOps
+rpcdetailed.rpcdetailed.CompleteAvgTime
+rpcdetailed.rpcdetailed.CompleteNumOps
+rpcdetailed.rpcdetailed.CreateAvgTime
+rpcdetailed.rpcdetailed.CreateNumOps
+rpcdetailed.rpcdetailed.DeleteAvgTime
+rpcdetailed.rpcdetailed.DeleteNumOps
+rpcdetailed.rpcdetailed.FsyncAvgTime
+rpcdetailed.rpcdetailed.FsyncNumOps
+rpcdetailed.rpcdetailed.GetAdditionalDatanodeAvgTime
+rpcdetailed.rpcdetailed.GetAdditionalDatanodeNumOps
+rpcdetailed.rpcdetailed.GetBlockLocationsAvgTime
+rpcdetailed.rpcdetailed.GetBlockLocationsNumOps
+rpcdetailed.rpcdetailed.GetEditLogManifestAvgTime
+rpcdetailed.rpcdetailed.GetEditLogManifestNumOps
+rpcdetailed.rpcdetailed.GetFileInfoAvgTime
+rpcdetailed.rpcdetailed.GetFileInfoNumOps
+rpcdetailed.rpcdetailed.GetListingAvgTime
+rpcdetailed.rpcdetailed.GetListingNumOps
+rpcdetailed.rpcdetailed.GetServerDefaultsAvgTime
+rpcdetailed.rpcdetailed.GetServerDefaultsNumOps
+rpcdetailed.rpcdetailed.GetTransactionIdAvgTime
+rpcdetailed.rpcdetailed.GetTransactionIdNumOps
+rpcdetailed.rpcdetailed.IsFileClosedAvgTime
+rpcdetailed.rpcdetailed.IsFileClosedNumOps
+rpcdetailed.rpcdetailed.MkdirsAvgTime
+rpcdetailed.rpcdetailed.MkdirsNumOps
+rpcdetailed.rpcdetailed.RecoverLeaseAvgTime
+rpcdetailed.rpcdetailed.RecoverLeaseNumOps
+rpcdetailed.rpcdetailed.RegisterDatanodeAvgTime
+rpcdetailed.rpcdetailed.RegisterDatanodeNumOps
+rpcdetailed.rpcdetailed.RenameAvgTime
+rpcdetailed.rpcdetailed.RenameNumOps
+rpcdetailed.rpcdetailed.RenewLeaseAvgTime
+rpcdetailed.rpcdetailed.RenewLeaseNumOps
+rpcdetailed.rpcdetailed.ReportBadBlocksAvgTime
+rpcdetailed.rpcdetailed.ReportBadBlocksNumOps
+rpcdetailed.rpcdetailed.RollEditLogAvgTime
+rpcdetailed.rpcdetailed.RollEditLogNumOps
+rpcdetailed.rpcdetailed.SendHeartbeatAvgTime
+rpcdetailed.rpcdetailed.SendHeartbeatNumOps
+rpcdetailed.rpcdetailed.SetSafeModeAvgTime
+rpcdetailed.rpcdetailed.SetSafeModeNumOps
+rpcdetailed.rpcdetailed.SetTimesAvgTime
+rpcdetailed.rpcdetailed.SetTimesNumOps
+rpcdetailed.rpcdetailed.UpdateBlockForPipelineAvgTime
+rpcdetailed.rpcdetailed.UpdateBlockForPipelineNumOps
+rpcdetailed.rpcdetailed.UpdatePipelineAvgTime
+rpcdetailed.rpcdetailed.UpdatePipelineNumOps
+rpcdetailed.rpcdetailed.VersionRequestAvgTime
+rpcdetailed.rpcdetailed.VersionRequestNumOps
+ugi.UgiMetrics.GetGroupsAvgTime
+ugi.UgiMetrics.GetGroupsNumOps
+ugi.UgiMetrics.LoginFailureAvgTime
+ugi.UgiMetrics.LoginFailureNumOps
+ugi.UgiMetrics.LoginSuccessAvgTime
+ugi.UgiMetrics.LoginSuccessNumOps
http://git-wip-us.apache.org/repos/asf/ambari/blob/55bc69d6/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NODEMANAGER.dat
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NODEMANAGER.dat b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NODEMANAGER.dat
new file mode 100644
index 0000000..239b3d4
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NODEMANAGER.dat
@@ -0,0 +1,67 @@
+jvm.JvmMetrics.GcCount
+jvm.JvmMetrics.GcCountCopy
+jvm.JvmMetrics.GcCountMarkSweepCompact
+jvm.JvmMetrics.GcTimeMillis
+jvm.JvmMetrics.GcTimeMillisCopy
+jvm.JvmMetrics.GcTimeMillisMarkSweepCompact
+jvm.JvmMetrics.LogError
+jvm.JvmMetrics.LogFatal
+jvm.JvmMetrics.LogInfo
+jvm.JvmMetrics.LogWarn
+jvm.JvmMetrics.MemHeapCommittedM
+jvm.JvmMetrics.MemHeapMaxM
+jvm.JvmMetrics.MemHeapUsedM
+jvm.JvmMetrics.MemMaxM
+jvm.JvmMetrics.MemNonHeapCommittedM
+jvm.JvmMetrics.MemNonHeapMaxM
+jvm.JvmMetrics.MemNonHeapUsedM
+jvm.JvmMetrics.ThreadsBlocked
+jvm.JvmMetrics.ThreadsNew
+jvm.JvmMetrics.ThreadsRunnable
+jvm.JvmMetrics.ThreadsTerminated
+jvm.JvmMetrics.ThreadsTimedWaiting
+jvm.JvmMetrics.ThreadsWaiting
+mapred.ShuffleMetrics.ShuffleConnections
+mapred.ShuffleMetrics.ShuffleOutputBytes
+mapred.ShuffleMetrics.ShuffleOutputsFailed
+mapred.ShuffleMetrics.ShuffleOutputsOK
+metricssystem.MetricsSystem.DroppedPubAll
+metricssystem.MetricsSystem.NumActiveSinks
+metricssystem.MetricsSystem.NumActiveSources
+metricssystem.MetricsSystem.NumAllSinks
+metricssystem.MetricsSystem.NumAllSources
+metricssystem.MetricsSystem.PublishAvgTime
+metricssystem.MetricsSystem.PublishNumOps
+metricssystem.MetricsSystem.Sink_timelineAvgTime
+metricssystem.MetricsSystem.Sink_timelineDropped
+metricssystem.MetricsSystem.Sink_timelineNumOps
+metricssystem.MetricsSystem.Sink_timelineQsize
+metricssystem.MetricsSystem.SnapshotAvgTime
+metricssystem.MetricsSystem.SnapshotNumOps
+rpc.rpc.CallQueueLength
+rpc.rpc.NumOpenConnections
+rpc.rpc.ReceivedBytes
+rpc.rpc.RpcAuthenticationFailures
+rpc.rpc.RpcAuthenticationSuccesses
+rpc.rpc.RpcAuthorizationFailures
+rpc.rpc.RpcAuthorizationSuccesses
+rpc.rpc.RpcProcessingTimeAvgTime
+rpc.rpc.RpcProcessingTimeNumOps
+rpc.rpc.RpcQueueTimeAvgTime
+rpc.rpc.RpcQueueTimeNumOps
+rpc.rpc.SentBytes
+ugi.UgiMetrics.GetGroupsAvgTime
+ugi.UgiMetrics.GetGroupsNumOps
+ugi.UgiMetrics.LoginFailureAvgTime
+ugi.UgiMetrics.LoginFailureNumOps
+ugi.UgiMetrics.LoginSuccessAvgTime
+ugi.UgiMetrics.LoginSuccessNumOps
+yarn.NodeManagerMetrics.AllocatedContainers
+yarn.NodeManagerMetrics.AllocatedGB
+yarn.NodeManagerMetrics.AvailableGB
+yarn.NodeManagerMetrics.ContainersCompleted
+yarn.NodeManagerMetrics.ContainersFailed
+yarn.NodeManagerMetrics.ContainersIniting
+yarn.NodeManagerMetrics.ContainersKilled
+yarn.NodeManagerMetrics.ContainersLaunched
+yarn.NodeManagerMetrics.ContainersRunning