phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <...@git.apache.org>
Subject [GitHub] phoenix pull request #315: PHOENIX-3655 Global Phoenix Client Metrics for PQ...
Date Fri, 27 Jul 2018 20:03:45 GMT
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/315#discussion_r205884792
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/monitoring/GlobalClientMetrics.java
---
    @@ -108,40 +114,88 @@
         GLOBAL_HBASE_COUNT_ROWS_SCANNED(COUNT_ROWS_SCANNED),
         GLOBAL_HBASE_COUNT_ROWS_FILTERED(COUNT_ROWS_FILTERED);
     
    -    
    +    private static final Logger LOG = LoggerFactory.getLogger(GlobalClientMetrics.class);
         private static final boolean isGlobalMetricsEnabled = QueryServicesOptions.withDefaults().isGlobalMetricsEnabled();
    +    private MetricType metricType;
         private GlobalMetric metric;
     
    -    public void update(long value) {
    +    static {
    +        initPhoenixGlobalClientMetrics();
             if (isGlobalMetricsEnabled) {
    -            metric.change(value);
    +            MetricRegistry metricRegistry = createMetricRegistry();
    +            registerPhoenixMetricsToRegistry(metricRegistry);
    +            GlobalMetricRegistriesAdapter.getInstance().registerMetricRegistry(metricRegistry);
    +        }
    +    }
    +
    +    private static void initPhoenixGlobalClientMetrics() {
    +        for (GlobalClientMetrics globalMetric : GlobalClientMetrics.values()) {
    +            globalMetric.metric = isGlobalMetricsEnabled ?
    +                    new GlobalMetricImpl(globalMetric.metricType) : new NoOpGlobalMetricImpl();
    +        }
    +    }
    +
    +    private static void registerPhoenixMetricsToRegistry(MetricRegistry metricRegistry)
{
    +        for (GlobalClientMetrics globalMetric : GlobalClientMetrics.values()) {
    +            metricRegistry.register(globalMetric.metricType.columnName(),
    +                    new PhoenixGlobalMetricGauge(globalMetric.metric));
    +        }
    +    }
    +
    +    private static MetricRegistry createMetricRegistry() {
    +        LOG.info("Creating Metric Registry for Phoenix Global Metrics");
    +        MetricRegistryInfo registryInfo = new MetricRegistryInfo("PHOENIX", "Phoenix
Global Metrics",
    --- End diff --
    
    What does "Global" mean in this context? Is "Phoenix Client Metrics" more reasonable?
Maybe "Phoenix,sub=CLIENT" down below?


---

Mime
View raw message