当前位置: 首页 > news >正文

手机网站图片切换特效成都市住建局平台官网

手机网站图片切换特效,成都市住建局平台官网,wordpress是什么写的,工程机械网官网HiveMetaStore的指标分析#xff08;一#xff09; 文章目录 HiveMetaStore的指标分析#xff08;一#xff09;背景目标部署架构 hive-site.xml相关配置元数据服务的指标相关配置 源码部分#xff08;hive2.3系#xff09;JvmPauseMonitor.javaHiveMetaStore的内部类HMS…HiveMetaStore的指标分析一 文章目录 HiveMetaStore的指标分析一背景目标部署架构 hive-site.xml相关配置元数据服务的指标相关配置 源码部分hive2.3系JvmPauseMonitor.javaHiveMetaStore的内部类HMSHandlerMetricsFactory的init(conf)方法CodahaleMetrics.java具体指标对象 指标导出JsonFileReporter输出的文件内容示例 其他 腾讯云的hive-metastore指标参考资料 背景 对当前单独部署的HiveMetaStore服务进行指标监控。 目标部署架构 #mermaid-svg-fPZFZSo8C2bT7BYt {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-fPZFZSo8C2bT7BYt .error-icon{fill:#552222;}#mermaid-svg-fPZFZSo8C2bT7BYt .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-fPZFZSo8C2bT7BYt .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-fPZFZSo8C2bT7BYt .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-fPZFZSo8C2bT7BYt .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-fPZFZSo8C2bT7BYt .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-fPZFZSo8C2bT7BYt .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-fPZFZSo8C2bT7BYt .marker{fill:#333333;stroke:#333333;}#mermaid-svg-fPZFZSo8C2bT7BYt .marker.cross{stroke:#333333;}#mermaid-svg-fPZFZSo8C2bT7BYt svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-fPZFZSo8C2bT7BYt .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-fPZFZSo8C2bT7BYt .cluster-label text{fill:#333;}#mermaid-svg-fPZFZSo8C2bT7BYt .cluster-label span{color:#333;}#mermaid-svg-fPZFZSo8C2bT7BYt .label text,#mermaid-svg-fPZFZSo8C2bT7BYt span{fill:#333;color:#333;}#mermaid-svg-fPZFZSo8C2bT7BYt .node rect,#mermaid-svg-fPZFZSo8C2bT7BYt .node circle,#mermaid-svg-fPZFZSo8C2bT7BYt .node ellipse,#mermaid-svg-fPZFZSo8C2bT7BYt .node polygon,#mermaid-svg-fPZFZSo8C2bT7BYt .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-fPZFZSo8C2bT7BYt .node .label{text-align:center;}#mermaid-svg-fPZFZSo8C2bT7BYt .node.clickable{cursor:pointer;}#mermaid-svg-fPZFZSo8C2bT7BYt .arrowheadPath{fill:#333333;}#mermaid-svg-fPZFZSo8C2bT7BYt .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-fPZFZSo8C2bT7BYt .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-fPZFZSo8C2bT7BYt .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-fPZFZSo8C2bT7BYt .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-fPZFZSo8C2bT7BYt .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-fPZFZSo8C2bT7BYt .cluster text{fill:#333;}#mermaid-svg-fPZFZSo8C2bT7BYt .cluster span{color:#333;}#mermaid-svg-fPZFZSo8C2bT7BYt div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-fPZFZSo8C2bT7BYt :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} HiveServer2组 Metastore组 mysql组 HiveServer2_1 HiveServer2_2 HiveServer2_3 Metastore1 Metastore2 Metastore3 master slave 验证步骤 场景一 Metastore服务开启监控指标输出方式采用默认。HiveServer2采用直连数据库的方式创建MetaStoreClient其配置文件中也开启了metastore指标监控同时开启WebUI。 现象每个HiveServer2服务都可以通过WebUI看到指标dump。但是每个HiveServer2的实际访问的指标并非从Metastore组中获取的指标。是Client端侧的指标且每个节点之间没有关联。 场景二 Metastore服务开启监控指标输出方式采用默认。。HiveServer2采用连接Metastore服务组的方式工作其配置文件中也开启了metastore指标监控同时开启WebUI。 现象每个HiveServer2服务都可以通过WebUI看到指标dump。但是没有Metastore相关的指标。 结论以上两种方式通过HiveServer2的WebUI服务都无法获取到单独的Metastore的服务指标。 场景三 单纯的开启Metastore服务的监控并将指标输出json文件中。 现象每个Metastore服务都生成自己的json文件但是目前的版本在更新问价的时候会无法.json文件只会定时的更新.json.tmp文件。 说明以目标部署架构为例单纯的MetaStore服务的指标是单纯的自己输出的。要么读取json文件通过开启服务的JMX在通过分别访问各个Metastore节点的JMX服务获取指标。 hive-site.xml相关配置 元数据服务的指标相关配置 开启指标功能 hive.metastore.metrics.enabled true 指定指标功能实现类 hive.service.metrics.classorg.apache.hadoop.hive.common.metrics.metrics2.CodahaleMetrics 指标输出的类型 hive.service.metrics.reporterJMX,CONSOLE,JSON_FILE,HADOOP2 指标输出的JSON文件位置 hive.service.metrics.file.location“/tmp/report.json” 指标输出的JSON文件更新频率 hive.service.metrics.file.frequency 5s 指标输出到hadoop2组件指标中的名称 hive.service.metrics.hadoop2.componenthivemetestore 指标输出到hadoop2组件指标中的时间间隔 hive.service.metrics.hadoop2.frequency30s 源码部分hive2.3系 在HiveMetaStore.java文件中main方法内会根据配置去决定是否启动指标服务类。 //Start Metrics for Standalone (Remote) Mode - hive.metastore.metrics.enabledif (conf.getBoolVar(ConfVars.METASTORE_METRICS)) {try {MetricsFactory.init(conf);} catch (Exception e) {// log exception, but ignore inability to startLOG.error(error in Metrics init: e.getClass().getName() e.getMessage(), e);}}Lock startLock new ReentrantLock();Condition startCondition startLock.newCondition();AtomicBoolean startedServing new AtomicBoolean();// 方法中会启动JvmPauseMonitor监控器startMetaStoreThreads(conf, startLock, startCondition, startedServing);// 方法中去实例化了HMSHandler用户处理客户端过来的请求startMetaStore(cli.getPort(), ShimLoader.getHadoopThriftAuthBridge(), conf, startLock,startCondition, startedServing);JvmPauseMonitor.java 用来监控JVM的暂停情况。通过Daemon线程默认每隔500ms计算一次。jvm暂停统计级别分为warn和info级别。如果暂停超过1000ms则info级别次数1如果超过10000ms则warn级别1。 private class Monitor implements Runnable {Overridepublic void run() {Stopwatch sw new Stopwatch();// 获取GC情况GC次数和GC耗时msMapString, GcTimes gcTimesBeforeSleep getGcTimes();while (shouldRun) {sw.reset().start();try {// 监控线程自我休眠500msThread.sleep(SLEEP_INTERVAL_MS);} catch (InterruptedException ie) {return;}// 上次查询时间-减去休眠就是暂停的耗时long extraSleepTime sw.elapsed(TimeUnit.MILLISECONDS) - SLEEP_INTERVAL_MS;MapString, GcTimes gcTimesAfterSleep getGcTimes();// warnThresholdMs默认10000msif (extraSleepTime warnThresholdMs) {numGcWarnThresholdExceeded;LOG.warn(formatMessage(extraSleepTime, gcTimesAfterSleep, gcTimesBeforeSleep));// 指标jvm.pause.info-threshold进行1incrementMetricsCounter(MetricsConstant.JVM_PAUSE_WARN, 1);} // infoThresholdMs默认1000ms else if (extraSleepTime infoThresholdMs) {numGcInfoThresholdExceeded;LOG.info(formatMessage(extraSleepTime, gcTimesAfterSleep, gcTimesBeforeSleep));// 指标jvm.pause.warn-threshold进行1incrementMetricsCounter(MetricsConstant.JVM_PAUSE_INFO, 1);}// jvm.pause.extraSleepTime 累计时间? msincrementMetricsCounter(MetricsConstant.JVM_EXTRA_SLEEP, extraSleepTime);totalGcExtraSleepTime extraSleepTime;gcTimesBeforeSleep gcTimesAfterSleep;}}private void incrementMetricsCounter(String name, long count) {Metrics metrics MetricsFactory.getInstance();if (metrics ! null) {try {metrics.incrementCounter(name, count);} catch (Exception e) {LOG.warn(Error Reporting JvmPauseMonitor to Metrics system, e);}}}}HiveMetaStore的内部类HMSHandler #mermaid-svg-Ug9lCZAlEQkRGjsw {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-Ug9lCZAlEQkRGjsw .error-icon{fill:#552222;}#mermaid-svg-Ug9lCZAlEQkRGjsw .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Ug9lCZAlEQkRGjsw .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-Ug9lCZAlEQkRGjsw .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Ug9lCZAlEQkRGjsw .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Ug9lCZAlEQkRGjsw .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Ug9lCZAlEQkRGjsw .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Ug9lCZAlEQkRGjsw .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Ug9lCZAlEQkRGjsw .marker.cross{stroke:#333333;}#mermaid-svg-Ug9lCZAlEQkRGjsw svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Ug9lCZAlEQkRGjsw g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-Ug9lCZAlEQkRGjsw g.classGroup text .title{font-weight:bolder;}#mermaid-svg-Ug9lCZAlEQkRGjsw .nodeLabel,#mermaid-svg-Ug9lCZAlEQkRGjsw .edgeLabel{color:#131300;}#mermaid-svg-Ug9lCZAlEQkRGjsw .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-Ug9lCZAlEQkRGjsw .label text{fill:#131300;}#mermaid-svg-Ug9lCZAlEQkRGjsw .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-Ug9lCZAlEQkRGjsw .classTitle{font-weight:bolder;}#mermaid-svg-Ug9lCZAlEQkRGjsw .node rect,#mermaid-svg-Ug9lCZAlEQkRGjsw .node circle,#mermaid-svg-Ug9lCZAlEQkRGjsw .node ellipse,#mermaid-svg-Ug9lCZAlEQkRGjsw .node polygon,#mermaid-svg-Ug9lCZAlEQkRGjsw .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-Ug9lCZAlEQkRGjsw .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw g.clickable{cursor:pointer;}#mermaid-svg-Ug9lCZAlEQkRGjsw g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-Ug9lCZAlEQkRGjsw g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-Ug9lCZAlEQkRGjsw .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-Ug9lCZAlEQkRGjsw .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-Ug9lCZAlEQkRGjsw .dashed-line{stroke-dasharray:3;}#mermaid-svg-Ug9lCZAlEQkRGjsw #compositionStart,#mermaid-svg-Ug9lCZAlEQkRGjsw .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw #compositionEnd,#mermaid-svg-Ug9lCZAlEQkRGjsw .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw #dependencyStart,#mermaid-svg-Ug9lCZAlEQkRGjsw .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw #dependencyStart,#mermaid-svg-Ug9lCZAlEQkRGjsw .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw #extensionStart,#mermaid-svg-Ug9lCZAlEQkRGjsw .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw #extensionEnd,#mermaid-svg-Ug9lCZAlEQkRGjsw .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw #aggregationStart,#mermaid-svg-Ug9lCZAlEQkRGjsw .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw #aggregationEnd,#mermaid-svg-Ug9lCZAlEQkRGjsw .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-Ug9lCZAlEQkRGjsw .edgeTerminals{font-size:11px;}#mermaid-svg-Ug9lCZAlEQkRGjsw :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} HMSHandler -String startFunction(String function, String extraLogInfo) -void endFunction(String function, MetaStoreEndFunctionContext context) startFunction和endFunction是包裹以下元数据的操作进行指标的采集控制。由这两个包裹的方法除了本身的Timer指标(增加前缀api_)外还会增加counters类型指标不过在Timer指标名的基础上再增加active_calls_前缀即active_calls_api_。 以下指标还会增加前缀api_ 库相关 create_databaseget_databasealter_databasedrop_databaseget_databasesget_all_databases 表相关 create_tabledrop_tableget_tableget_tablesget_tables_by_typeget_all_tablesget_table_metasget_multi_tableget_table_names_by_filterget_table_statistics_reqalter_table 分区相关 append_partitionappend_partition_by_namedrop_partition_by_nameget_partitions_psget_partitions_ps_with_authget_partitions_names_psadd_partitionsadd_partitiondrop_partitionget_partitionalter_partitionget_partition_with_authget_partitions_pspecget_partition_namesget_partition_by_nameget_partitions_by_exprget_num_partitions_by_filterget_num_partitions_by_exprget_partitions_by_namesget_partitions_by_filterget_partitions_by_filter_pspecget_partitions_statistics_req 其他 create_typeget_typedrop_typedrop_constraintadd_primary_keyadd_foreign_keyget_column_privilege_setadd_indexalter_indexdrop_index_by_nameget_index_by_nameget_index_namesget_indexesget_column_statistics_by_tableget_fields_with_environment_contextget_schema_with_environment_contextget_column_statistics_by_partitionwrite_column_statisticswrite_partition_column_statisticsdelete_column_statistics_by_partitiondelete_column_statistics_by_tableget_config_valuedelete_column_statistics_by_partitioncancel_delegation_tokenrenew_delegation_tokenget_delegation_tokenadd_tokenremove_tokenget_token forXXXget_all_token_identifiers.add_master_key.update_master_key.remove_master_key.get_master_keys.partition_name_has_valid_charactersget_functionsget_all_functionsget_functionget_aggr_stats_forget_foreign_keys 例如get_database操作 public Database get_database(final String name) throws NoSuchObjectException, MetaException {startFunction(get_database, : name);Database db null;Exception ex null;try {db get_database_core(name);firePreEvent(new PreReadDatabaseEvent(db, this));} catch (MetaException e) {ex e;throw e;} catch (NoSuchObjectException e) {ex e;throw e;} finally {endFunction(get_database, db ! null, ex);}return db;}MetricsFactory的init(conf)方法 /*** Initializes static Metrics instance. 目前默认的实现类是 org.apache.hadoop.hive.common.metrics.metrics2.CodahaleMetrics*/ public synchronized static void init(HiveConf conf) throws Exception {if (metrics null) {Class metricsClass conf.getClassByName(conf.getVar(HiveConf.ConfVars.HIVE_METRICS_CLASS));Constructor constructor metricsClass.getConstructor(HiveConf.class);metrics (Metrics) constructor.newInstance(conf);} }CodahaleMetrics.java 通过有参构造函数实例化CodahaleMetrics。里面一共涉及4个指标类型。timers,counters,meters,gauges。 public CodahaleMetrics(HiveConf conf) {this.conf conf;//Codahale artifacts are lazily-created.timers CacheBuilder.newBuilder().build(new CacheLoaderString, com.codahale.metrics.Timer() {Overridepublic com.codahale.metrics.Timer load(String key) {Timer timer new Timer(new ExponentiallyDecayingReservoir());metricRegistry.register(key, timer);return timer;}});counters CacheBuilder.newBuilder().build(new CacheLoaderString, Counter() {Overridepublic Counter load(String key) {Counter counter new Counter();metricRegistry.register(key, counter);return counter;}});meters CacheBuilder.newBuilder().build(new CacheLoaderString, Meter() {Overridepublic Meter load(String key) {Meter meter new Meter();metricRegistry.register(key, meter);return meter;}});gauges new ConcurrentHashMapString, Gauge();//register JVM metrics - java虚拟机的相关指标集registerAll(gc, new GarbageCollectorMetricSet());registerAll(buffers, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));registerAll(memory, new MemoryUsageGaugeSet());registerAll(threads, new ThreadStatesGaugeSet());registerAll(classLoading, new ClassLoadingGaugeSet());//Metrics reporter -进行指标的输出SetMetricsReporting finalReporterList new HashSetMetricsReporting();// 默认的导出类型是JSON_FILE, JMX。ListString metricsReporterNames Lists.newArrayList(Splitter.on(,).trimResults().omitEmptyStrings().split(conf.getVar(HiveConf.ConfVars.HIVE_METRICS_REPORTER)));if (metricsReporterNames ! null) {for (String metricsReportingName : metricsReporterNames) {try {MetricsReporting reporter MetricsReporting.valueOf(metricsReportingName.trim().toUpperCase());finalReporterList.add(reporter);} catch (IllegalArgumentException e) {LOGGER.warn(Metrics reporter skipped due to invalid configured reporter: metricsReportingName);}}}initReporting(finalReporterList);}具体指标对象 GarbageCollectorMetricSet一组用于垃圾收集计数和运行时间的仪表。BufferPoolMetricSet一组测量JVM的直接和映射缓冲池的计数、使用情况和容量的指标。这些JMX对象仅在Java 7及以上版本上可用。MemoryUsageGaugeSet一组用于JVM内存使用的指标包括堆与非堆内存的统计信息以及特定于gc的内存池。ThreadStatesGaugeSet一组用于各种状态和死锁检测的线程数量的量规。ClassLoadingGaugeSetJVM类加载器使用情况的一组指标。 #mermaid-svg-S4XekQ1ze59tRTlf {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-S4XekQ1ze59tRTlf .error-icon{fill:#552222;}#mermaid-svg-S4XekQ1ze59tRTlf .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-S4XekQ1ze59tRTlf .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-S4XekQ1ze59tRTlf .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-S4XekQ1ze59tRTlf .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-S4XekQ1ze59tRTlf .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-S4XekQ1ze59tRTlf .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-S4XekQ1ze59tRTlf .marker{fill:#333333;stroke:#333333;}#mermaid-svg-S4XekQ1ze59tRTlf .marker.cross{stroke:#333333;}#mermaid-svg-S4XekQ1ze59tRTlf svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-S4XekQ1ze59tRTlf g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-S4XekQ1ze59tRTlf g.classGroup text .title{font-weight:bolder;}#mermaid-svg-S4XekQ1ze59tRTlf .nodeLabel,#mermaid-svg-S4XekQ1ze59tRTlf .edgeLabel{color:#131300;}#mermaid-svg-S4XekQ1ze59tRTlf .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-S4XekQ1ze59tRTlf .label text{fill:#131300;}#mermaid-svg-S4XekQ1ze59tRTlf .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-S4XekQ1ze59tRTlf .classTitle{font-weight:bolder;}#mermaid-svg-S4XekQ1ze59tRTlf .node rect,#mermaid-svg-S4XekQ1ze59tRTlf .node circle,#mermaid-svg-S4XekQ1ze59tRTlf .node ellipse,#mermaid-svg-S4XekQ1ze59tRTlf .node polygon,#mermaid-svg-S4XekQ1ze59tRTlf .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-S4XekQ1ze59tRTlf .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-S4XekQ1ze59tRTlf g.clickable{cursor:pointer;}#mermaid-svg-S4XekQ1ze59tRTlf g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-S4XekQ1ze59tRTlf g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-S4XekQ1ze59tRTlf .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-S4XekQ1ze59tRTlf .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-S4XekQ1ze59tRTlf .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-S4XekQ1ze59tRTlf .dashed-line{stroke-dasharray:3;}#mermaid-svg-S4XekQ1ze59tRTlf #compositionStart,#mermaid-svg-S4XekQ1ze59tRTlf .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-S4XekQ1ze59tRTlf #compositionEnd,#mermaid-svg-S4XekQ1ze59tRTlf .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-S4XekQ1ze59tRTlf #dependencyStart,#mermaid-svg-S4XekQ1ze59tRTlf .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-S4XekQ1ze59tRTlf #dependencyStart,#mermaid-svg-S4XekQ1ze59tRTlf .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-S4XekQ1ze59tRTlf #extensionStart,#mermaid-svg-S4XekQ1ze59tRTlf .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-S4XekQ1ze59tRTlf #extensionEnd,#mermaid-svg-S4XekQ1ze59tRTlf .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-S4XekQ1ze59tRTlf #aggregationStart,#mermaid-svg-S4XekQ1ze59tRTlf .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-S4XekQ1ze59tRTlf #aggregationEnd,#mermaid-svg-S4XekQ1ze59tRTlf .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-S4XekQ1ze59tRTlf .edgeTerminals{font-size:11px;}#mermaid-svg-S4XekQ1ze59tRTlf :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} «interface» MetricSet Map getMetrics() GarbageCollectorMetricSet BufferPoolMetricSet MemoryUsageGaugeSet ThreadStatesGaugeSet ClassLoadingGaugeSet 指标导出 /*** Should be only called once to initialize the reporters*/private void initReporting(SetMetricsReporting reportingSet) {for (MetricsReporting reporting : reportingSet) {switch (reporting) {case CONSOLE:final ConsoleReporter consoleReporter ConsoleReporter.forRegistry(metricRegistry).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build();consoleReporter.start(1, TimeUnit.SECONDS);reporters.add(consoleReporter);break;case JMX:final JmxReporter jmxReporter JmxReporter.forRegistry(metricRegistry).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build();jmxReporter.start();reporters.add(jmxReporter);break;case JSON_FILE:final JsonFileReporter jsonFileReporter new JsonFileReporter();jsonFileReporter.start();reporters.add(jsonFileReporter);break;case HADOOP2:String applicationName conf.get(HiveConf.ConfVars.HIVE_METRICS_HADOOP2_COMPONENT_NAME.varname);long reportingInterval HiveConf.toTime(conf.get(HiveConf.ConfVars.HIVE_METRICS_HADOOP2_INTERVAL.varname),TimeUnit.SECONDS, TimeUnit.SECONDS);final HadoopMetrics2Reporter metrics2Reporter HadoopMetrics2Reporter.forRegistry(metricRegistry).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build(DefaultMetricsSystem.initialize(applicationName), // The application-level nameapplicationName, // Component nameapplicationName, // Component descriptionGeneral); // Name for each metric recordmetrics2Reporter.start(reportingInterval, TimeUnit.SECONDS);break;}}}#mermaid-svg-n8F5V33vJvi68HqK {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-n8F5V33vJvi68HqK .error-icon{fill:#552222;}#mermaid-svg-n8F5V33vJvi68HqK .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-n8F5V33vJvi68HqK .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-n8F5V33vJvi68HqK .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-n8F5V33vJvi68HqK .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-n8F5V33vJvi68HqK .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-n8F5V33vJvi68HqK .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-n8F5V33vJvi68HqK .marker{fill:#333333;stroke:#333333;}#mermaid-svg-n8F5V33vJvi68HqK .marker.cross{stroke:#333333;}#mermaid-svg-n8F5V33vJvi68HqK svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-n8F5V33vJvi68HqK g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-n8F5V33vJvi68HqK g.classGroup text .title{font-weight:bolder;}#mermaid-svg-n8F5V33vJvi68HqK .nodeLabel,#mermaid-svg-n8F5V33vJvi68HqK .edgeLabel{color:#131300;}#mermaid-svg-n8F5V33vJvi68HqK .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-n8F5V33vJvi68HqK .label text{fill:#131300;}#mermaid-svg-n8F5V33vJvi68HqK .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-n8F5V33vJvi68HqK .classTitle{font-weight:bolder;}#mermaid-svg-n8F5V33vJvi68HqK .node rect,#mermaid-svg-n8F5V33vJvi68HqK .node circle,#mermaid-svg-n8F5V33vJvi68HqK .node ellipse,#mermaid-svg-n8F5V33vJvi68HqK .node polygon,#mermaid-svg-n8F5V33vJvi68HqK .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-n8F5V33vJvi68HqK .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-n8F5V33vJvi68HqK g.clickable{cursor:pointer;}#mermaid-svg-n8F5V33vJvi68HqK g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-n8F5V33vJvi68HqK g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-n8F5V33vJvi68HqK .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-n8F5V33vJvi68HqK .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-n8F5V33vJvi68HqK .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-n8F5V33vJvi68HqK .dashed-line{stroke-dasharray:3;}#mermaid-svg-n8F5V33vJvi68HqK #compositionStart,#mermaid-svg-n8F5V33vJvi68HqK .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-n8F5V33vJvi68HqK #compositionEnd,#mermaid-svg-n8F5V33vJvi68HqK .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-n8F5V33vJvi68HqK #dependencyStart,#mermaid-svg-n8F5V33vJvi68HqK .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-n8F5V33vJvi68HqK #dependencyStart,#mermaid-svg-n8F5V33vJvi68HqK .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-n8F5V33vJvi68HqK #extensionStart,#mermaid-svg-n8F5V33vJvi68HqK .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-n8F5V33vJvi68HqK #extensionEnd,#mermaid-svg-n8F5V33vJvi68HqK .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-n8F5V33vJvi68HqK #aggregationStart,#mermaid-svg-n8F5V33vJvi68HqK .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-n8F5V33vJvi68HqK #aggregationEnd,#mermaid-svg-n8F5V33vJvi68HqK .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-n8F5V33vJvi68HqK .edgeTerminals{font-size:11px;}#mermaid-svg-n8F5V33vJvi68HqK :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} «interface» org.apache.hadoop.metrics2.MetricsSource void getMetrics(MetricsCollector collector, boolean all) «interface» Reporter «abstract» ScheduledReporter - final ScheduledExecutorService executor void start(long period, TimeUnit unit) public void report() JmxReporter JsonFileReporter - java.util.Timer timer void start() HadoopMetrics2Reporter - SortedMap dropwizardGauges; - SortedMap dropwizardCounters; - SortedMap dropwizardHistograms; - SortedMap dropwizardMeters; - SortedMap dropwizardTimers; void snapshotAllMetrics(MetricsRecordBuilder builder) ConsoleReporter 在hive2版本有4类导出器 ConsoleReporter通过调度线程按周期将指标输出到日志里面。JmxReporter一个报告器用于监听新指标并将发送其作为名称标注的 MBeans。JsonFileReporter通过Timer定时调度将指标写入目标文件中。HadoopMetrics2Reporter通过调度线程按周期将指标更新到度量对象dropwizardGauges,dropwizardCounters,dropwizardHistograms,dropwizardMeters,dropwizardTimers中再由hadoop2的指标系统去获取转换由 dropwizard 收集的当前指标并将其添加到Hadoop2的指标系统中。 JsonFileReporter输出的文件内容示例 回收 gc.PS-MarkSweep.count标记次数gc.PS-MarkSweep.time标记耗时msgc.PS-Scavenge.count清除次数gc.PS-Scavenge.time清除耗时ms 内存 memory.heap.committedJVM 已经提交的 HeapMemory 的大小 byte memory.heap.initJVM 初始 HeapMem 的大小 memory.heap.usage已使用内存占比 memory.heap.maxJVM 配置的 HeapMemory 的大小 memory.heap.used已使用堆内存大小 byte memory.non-heap.committedJVM 当前已经提交的 NonHeapMemory 的大小 byte memory.non-heap.initJVM 初始 NonHeapMem 的大小 byte memory.non-heap.maxJVM 配置的 NonHeapMemory 的数大小 byte memory.non-heap.usage已使用NonHeapMemory 内存占比 memory.non-heap.usedJVM 当前已经使用的 NonHeapMemory 的大小 byte memory.pools.Code-Cache.usage代码缓存区使用占比 memory.pools.Compressed-Class-Space.usage压缩类空间空间使用占比 memory.pools.Metaspace.usageMetaspace 区内存使用占比 memory.pools.PS-Eden-Space.usageEden区内存使用占比 memory.pools.PS-Old-Gen.usageOld区内存使用占比 memory.pools.PS-Survivor-Space.usageSurvivo区内存使用占比 memory.total.committed保证可用于堆或非堆的总内存量 memory.total.init堆或非堆初始化的内存量 memory.total.max堆或非堆配置的最大中内存量 memory.total.used堆或非堆使用的总内存量 线程 threads.count总线程数threads.daemon.count常驻线程数threads.deadlock.count死锁线程数 counters下active_calls_*系列正在执行的方法的个数方法主要在HiveMetaStore的内部类HMSHandler中。 timers下api_系列执行的方法响应个数平均、最大、最小、中位数耗时等等方法主要在HiveMetaStore的内部类HMSHandler中。 {version : 3.0.0,gauges : {buffers.direct.capacity : {value : 0},buffers.direct.count : {value : 0},buffers.direct.used : {value : 0},buffers.mapped.capacity : {value : 0},buffers.mapped.count : {value : 0},buffers.mapped.used : {value : 0},classLoading.loaded : {value : 6932},classLoading.unloaded : {value : 0},gc.PS-MarkSweep.count : {value : 2},gc.PS-MarkSweep.time : {value : 250},gc.PS-Scavenge.count : {value : 5},gc.PS-Scavenge.time : {value : 92},init_total_count_dbs : {value : 489},init_total_count_partitions : {value : 51089},init_total_count_tables : {value : 13733},memory.heap.committed : {value : 991428608},memory.heap.init : {value : 1073741824},memory.heap.max : {value : 991428608},memory.heap.usage : {value : 0.22776332070498415},memory.heap.used : {value : 225811072},memory.non-heap.committed : {value : 62717952},memory.non-heap.init : {value : 2555904},memory.non-heap.max : {value : -1},memory.non-heap.usage : {value : -6.1740872E7},memory.non-heap.used : {value : 61740872},memory.pools.Code-Cache.usage : {value : 0.04560165405273438},memory.pools.Compressed-Class-Space.usage : {value : 0.004726290702819824},memory.pools.Metaspace.usage : {value : 0.9850643484933036},memory.pools.PS-Eden-Space.usage : {value : 0.5518231919863521},memory.pools.PS-Old-Gen.usage : {value : 0.07657499299391471},memory.pools.PS-Survivor-Space.usage : {value : 0.9316617525540866},memory.total.committed : {value : 1054146560},memory.total.init : {value : 1076297728},memory.total.max : {value : 991428607},memory.total.used : {value : 287551944},threads.blocked.count : {value : 0},threads.count : {value : 27},threads.daemon.count : {value : 16},threads.deadlock.count : {value : 0},threads.deadlocks : {value : [ ]},threads.new.count : {value : 0},threads.runnable.count : {value : 4},threads.terminated.count : {value : 0},threads.timed_waiting.count : {value : 7},threads.waiting.count : {value : 16}},counters : {active_calls_api_get_database : {count : 0},active_calls_api_get_tables : {count : 0},active_calls_api_init : {count : 0},active_calls_api_set_ugi : {count : 0},jvm.pause.extraSleepTime : {count : 6},open_connections : {count : 1}},histograms : { },meters : { },timers : {api_get_database : {count : 54,max : 99.228759,mean : 11.107232182804301,min : 10.091598,p50 : 11.098374,p75 : 11.503314,p95 : 12.130782,p98 : 12.130782,p99 : 12.130782,p999 : 12.913863,stddev : 0.6771821794059291,m15_rate : 0.0,m1_rate : 0.0,m5_rate : 0.0,mean_rate : 0.0,duration_units : milliseconds,rate_units : calls/millisecond},api_get_tables : {count : 18,max : 31.114395,mean : 9.939109200622983,min : 9.404240999999999,p50 : 9.841852,p75 : 10.122354,p95 : 10.122354,p98 : 10.122354,p99 : 10.122354,p999 : 10.203377999999999,stddev : 0.18434488642295546,m15_rate : 0.0,m1_rate : 0.0,m5_rate : 0.0,mean_rate : 0.0,duration_units : milliseconds,rate_units : calls/millisecond},api_init : {count : 1,max : 3225.4620339999997,mean : 3225.4620339999997,min : 3225.4620339999997,p50 : 3225.4620339999997,p75 : 3225.4620339999997,p95 : 3225.4620339999997,p98 : 3225.4620339999997,p99 : 3225.4620339999997,p999 : 3225.4620339999997,stddev : 0.0,m15_rate : 0.0,m1_rate : 0.0,m5_rate : 0.0,mean_rate : 0.0,duration_units : milliseconds,rate_units : calls/millisecond},api_set_ugi : {count : 1,max : 0.284408,mean : 0.284408,min : 0.284408,p50 : 0.284408,p75 : 0.284408,p95 : 0.284408,p98 : 0.284408,p99 : 0.284408,p999 : 0.284408,stddev : 0.0,m15_rate : 0.0,m1_rate : 0.0,m5_rate : 0.0,mean_rate : 0.0,duration_units : milliseconds,rate_units : calls/millisecond}} }其他 #这个类定义了Hive进程生成的一些指标。 org.apache.hadoop.hive.common.metrics.common.MetricsConstant#可以用来度量和记录一段代码所花费的时间。 org.apache.hadoop.hive.ql.log.PerfLogger腾讯云的hive-metastore指标 标题指标名称指标单位指标含义GC 次数YGC次Young GC 次数FGC次Full GC 次数GC 时间FGCTsFull GC 消耗时间GCTs垃圾回收时间消耗YGCTsYoung GC 消耗时间内存区域占比S0%Survivor 0区内存使用占比E%Eden 区内存使用占比CCS%Compressed class space 区内存使用占比S1%Survivor 1区内存使用占比O%Old 区内存使用占比M%Metaspace 区内存使用占比JVM 内存MemHeapUsedMMBJVM 当前已经使用的 HeapMemory 的数量MemHeapCommittedMMBJVM 已经提交的 HeapMemory 的数量MemHeapMaxMMBJVM 配置的 HeapMemory 的数量MemHeapInitMMBJVM 初始 HeapMem 的数量MemNonHeapUsedMMBJVM 当前已经使用的 NonHeapMemory 的数量MemNonHeapCommittedMMBJVM 当前已经提交的 NonHeapMemory 的数量MemNonHeapInitMMBJVM 初始 NonHeapMem 的数量文件描述符数OpenFileDescriptorCount个已打开文件描述符数量MaxFileDescriptorCount个最大文件描述符数CPU 利用率ProcessCpuLoad%进程 CPU 利用率SystemCpuLoad%系统 CPU 利用率CPU 使用时间占比CPURateseconds/secondCPU 使用时间占比工作线程数DaemonThreadCount个守护线程数ThreadCount个线程总数CPU 累计使用时间ProcessCpuTimemsCPU 累计使用时间进程运行时长Uptimes进程运行时长GC 额外睡眠时间ExtraSleepTimems/sGC 额外睡眠时间alter table 请求时间HIVE.HMS.API_ALTER_TABLEmsalter table 请求平均时间alter table with env context 请求时间HIVE.HMS.API_ALTER_TABLE_WITH_ENV_CONTEXTmsalter table with env context 请求平均时间create table 请求时间HIVE.HMS.API_CREATE_TABLEmscreate table 请求平均时间create table with env context 请求时间HIVE.HMS.API_CREATE_TABLE_WITH_ENV_CONTEXTmscreate table with env context 请求平均时间drop table 请求时间HIVE.HMS.API_DROP_TABLEmsdrop table 平均请求时间drop table with env context 请求时间HIVE.HMS.API_DROP_TABLE_WITH_ENV_CONTEXTmsdrop table with env context 平均请求时间get table 请求时间HIVE.HMS.API_GET_TABLEmsget table 平均请求时间get tables 请求时间HIVE.HMS.API_GET_TABLESmsget tables 平均请求时间get multi table 请求时间HIVE.HMS.API_GET_MULTI_TABLEmsget multi table 平均请求时间get table req 请求时间HIVE.HMS.API_GET_TABLE_REQmsget table req 平均请求时间get database 请求时间HIVE.HMS.API_GET_DATABASEmsget database 平均请求时间get databases 请求时间HIVE.HMS.API_GET_DATABASESmsget databases 平均请求时间get all database 请求时间HIVE.HMS.API_GET_ALL_DATABASESmsget all databases 平均请求时间get all functions 请求时间HIVE.HMS.API_GET_ALL_FUNCTIONSmsget all functions 平均请求时间当前活跃 create table 请求数HIVE.HMS.ACTIVE_CALLS_API_CREATE_TABLE个当前活跃 create table 请求数当前活跃 drop table 请求数HIVE.HMS.ACTIVE_CALLS_API_DROP_TABLE个当前活跃 drop table 请求数当前活跃 alter table 请求数HIVE.HMS.ACTIVE_CALLS_API_ALTER_TABLE个当前活跃 alter table 请求数 参考资料 相关CWiki HiveMetrics指标的总览页。提供部分指标的issues链接。 WebUIforHiveServer2介绍WebUI可以查询展示指标。 ConfigurationProperties-Metrics 介绍指标的部分配置。
http://www.w-s-a.com/news/35670/

相关文章:

  • 服装 网站模板 wordpress石家庄做网站的公司有哪些
  • 惠州技术支持网站建设百度怎样注册免费的网站
  • 无锡哪里有做网站的公司泸州网站建设公司
  • 怎么进行网站推广jsp可以做那些小网站
  • 懒人手机网站wordpress修改秒速
  • WordPress资讯网站用花生壳做网站
  • 关于营销方面的网站建设网站怎么克隆
  • 站长网seo综合查询工具电商公司简介
  • 全能网站建设教程广告制作公司需要什么设备
  • 汽车行业做网站网站改版seo建议
  • 建设职业注册中心网站photoshop属于什么软件
  • 公司网站展示有哪些wordpress工单
  • iis新建网站seo是做什么工作的
  • 临沂网站建设厂家做外贸的女生现状
  • 电子商务网站建设实践临沂做网站的
  • 网站职能建设论文做外贸都有哪些网站
  • 网站建设项目需求分析房地产网站源码
  • 网站充值提现公司账务怎么做中国能建设计公司网站
  • 网站信息资源建设包括哪些网站网站做维护
  • 网站性能优化的方法有哪些建设施工合同网站
  • 郑州建设企业网站山西省住房和城乡建设厅网站
  • 做网站的去哪找客户正规制作网站公司
  • 网站代理访问是什么意思外国优秀设计网站
  • 合肥个人建站模板网络技术服务有限公司
  • 做网站什么公司好dw企业网站开发教程
  • 怎么做自己的个人网站宝安网站设计哪家最好
  • 浩博建设集团网站站长网站统计
  • 电商网站开发视频seo排名优化方式方法
  • 宿迁市住房城乡建设局网站wordpress纯图片主题
  • 广州建设网站 公司湖北省建设信息网官网