MAPREDUCE-4666. JVM metrics for history server. (jlowe via jeagles)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1407669 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Turner Eagles 2012-11-09 22:14:06 +00:00
parent e8d7891e78
commit 3ccc76c29b
2 changed files with 7 additions and 0 deletions

View File

@ -589,6 +589,8 @@ Release 0.23.5 - UNRELEASED
MAPREDUCE-4266. remove Ant remnants from MR (tgraves via bobby)
MAPREDUCE-4666. JVM metrics for history server (jlowe via jeagles)
OPTIMIZATIONS
BUG FIXES

View File

@ -27,6 +27,8 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapreduce.MRConfig;
import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig;
import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
import org.apache.hadoop.metrics2.source.JvmMetrics;
import org.apache.hadoop.security.SecurityUtil;
import org.apache.hadoop.util.ShutdownHookManager;
import org.apache.hadoop.util.StringUtils;
@ -106,6 +108,8 @@ public class JobHistoryServer extends CompositeService {
@Override
public void start() {
DefaultMetricsSystem.initialize("JobHistoryServer");
JvmMetrics.initSingleton("JobHistoryServer", null);
try {
jhsDTSecretManager.startThreads();
} catch(IOException io) {
@ -118,6 +122,7 @@ public class JobHistoryServer extends CompositeService {
@Override
public void stop() {
jhsDTSecretManager.stopThreads();
DefaultMetricsSystem.shutdown();
super.stop();
}