You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2021/10/07 22:33:19 UTC

[GitHub] [phoenix] vmeka2020 commented on a change in pull request #1231: PHOENIX-5838 Add Histograms for Table level Metrics

vmeka2020 commented on a change in pull request #1231:
URL: https://github.com/apache/phoenix/pull/1231#discussion_r724578730



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/monitoring/TableHistograms.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 maynot 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 applicablelaw 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.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import org.apache.hadoop.conf.Configuration;
+
+public class TableHistograms {
+    private String tableName;
+    private LatencyHistogram queryLatencyHisto;
+    private SizeHistogram querySizeHisto;
+    private LatencyHistogram upsertLatencyHisto;
+    private SizeHistogram upsertSizeHisto;
+    private LatencyHistogram deleteLatencyHisto;
+    private SizeHistogram deleteSizeHisto;
+    private LatencyHistogram pointLookupLatencyHisto;
+    private SizeHistogram pointLookupSizeHisto;
+    private LatencyHistogram rangeScanLatencyHisto;
+    private SizeHistogram rangeScanSizeHisto;
+
+    public TableHistograms(String tableName, Configuration conf) {
+        this.tableName = tableName;
+        queryLatencyHisto = new LatencyHistogram("QueryTime", "Query time latency", conf);
+        querySizeHisto = new SizeHistogram("QuerySize", "Query size", conf);
+
+        upsertLatencyHisto = new LatencyHistogram("UpsertTime", "Upsert time latency", conf);
+        upsertSizeHisto = new SizeHistogram("UpsertSize", "Upsert size", conf);
+
+        deleteLatencyHisto = new LatencyHistogram("DeleteTime", "Delete time latency", conf);
+        deleteSizeHisto = new SizeHistogram("DeleteSize", "Delete size", conf);
+
+        pointLookupLatencyHisto = new LatencyHistogram("PointLookupTime",
+                "Point Lookup Query time latency", conf);
+        pointLookupSizeHisto = new SizeHistogram("PointLookupSize",
+                "Point Lookup Query Size", conf);
+
+        rangeScanLatencyHisto = new LatencyHistogram("RangeScanTime",
+                "Range Scan Query time latency", conf);
+        rangeScanSizeHisto = new SizeHistogram("RangeScanSize",
+                "Range Scan Query size", conf);
+    }
+
+    public String getTableName() {
+        return tableName;
+    }
+
+    public LatencyHistogram getQueryLatencyHisto() {
+        return queryLatencyHisto;
+    }
+
+    public SizeHistogram getQuerySizeHisto() {
+        return querySizeHisto;
+    }
+
+
+    public LatencyHistogram getPointLookupLatencyHisto() {
+        return pointLookupLatencyHisto;
+    }
+
+    public SizeHistogram getPointLookupSizeHisto() {
+        return pointLookupSizeHisto;
+    }
+
+    public LatencyHistogram getRangeScanLatencyHisto() {
+        return rangeScanLatencyHisto;
+    }
+
+    public SizeHistogram getRangeScanSizeHisto() {
+        return rangeScanSizeHisto;
+    }
+
+    public LatencyHistogram getUpsertLatencyHisto() {
+        return upsertLatencyHisto;
+    }
+
+    public SizeHistogram getUpsertSizeHisto() {
+        return upsertSizeHisto;
+    }
+
+    public LatencyHistogram getDeleteLatencyHisto() {
+        return deleteLatencyHisto;
+    }
+
+    public SizeHistogram getDeleteSizeHisto() {
+        return deleteSizeHisto;
+    }
+
+    public List<HistogramDistribution> getTableLatencyHistogramsDistribution() {
+        List<HistogramDistribution> list = new ArrayList<>(Arrays.asList(queryLatencyHisto.getRangeHistogramDistribution(),

Review comment:
       updated with immutableList




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org