phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <>
Subject [GitHub] phoenix pull request #315: PHOENIX-3655 Global Phoenix Client Metrics for PQ...
Date Wed, 01 Aug 2018 17:55:49 GMT
Github user joshelser commented on a diff in the pull request:
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/monitoring/
    @@ -0,0 +1,167 @@
    + * 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
    + *
    + *
    + *
    + * 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.phoenix.monitoring;
    +import java.util.Iterator;
    +import java.util.Map;
    +import java.util.Map.Entry;
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.commons.logging.Log;
    +import org.apache.commons.logging.LogFactory;
    +import org.apache.hadoop.hbase.metrics.Counter;
    +import org.apache.hadoop.hbase.metrics.Gauge;
    +import org.apache.hadoop.hbase.metrics.Histogram;
    +import org.apache.hadoop.hbase.metrics.Meter;
    +import org.apache.hadoop.hbase.metrics.Metric;
    +import org.apache.hadoop.hbase.metrics.MetricRegistry;
    +import org.apache.hadoop.hbase.metrics.MetricRegistryInfo;
    +import org.apache.hadoop.hbase.metrics.Timer;
    +import org.apache.hadoop.metrics2.MetricsCollector;
    +import org.apache.hadoop.metrics2.MetricsInfo;
    +import org.apache.hadoop.metrics2.MetricsRecordBuilder;
    +import org.apache.hadoop.metrics2.MetricsSource;
    +import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
    +import org.apache.hadoop.metrics2.lib.Interns;
    +import org.apache.hadoop.metrics2.lib.MutableHistogram;
    +import org.apache.hadoop.metrics2.source.JvmMetrics;
    + * Contents mostly copied from GlobalMetricRegistriesAdapter class from hbase-hadoop2-compat
    + * The adapter attaches HBase's MetricRegistry to Hadoop's DefaultMetricsSystem
    + * Doesn't handle dynamic attach/detach of registries
    + */
    +public class GlobalMetricRegistriesAdapter {
    +    private static final Log LOG = LogFactory.getLog(GlobalMetricRegistriesAdapter.class);
    +    private static GlobalMetricRegistriesAdapter INSTANCE;
    +    private GlobalMetricRegistriesAdapter() {
    +        DefaultMetricsSystem.initialize("HBase");
    +        JvmMetrics.initSingleton("HBase", "");
    --- End diff --
    > why do we need to differentiate
    As an operator, I'm going to expect much different characteristics coming from client
applications than I am from PQS. Since PQS is a SPOF for (potentially) many users, I would
expect a higher level of regularity from PQS than I would a client's app.
    > We should get that info from the application JVM itself right
    I'm sure there's something you can apply to find a PQS metric compared to other clients,
but I am just thinking that it would be good to make this as easy as possible. I think watching
PQS metrics would be a common use-case, not the exception.


View raw message