samperson1997 commented on a change in pull request #339: [IOTDB-158] add 
metrics service
URL: https://github.com/apache/incubator-iotdb/pull/339#discussion_r325969101
 
 

 ##########
 File path: server/src/main/java/org/apache/iotdb/db/metrics/ui/MetricsPage.java
 ##########
 @@ -0,0 +1,125 @@
+/**
+ * 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.iotdb.db.metrics.ui;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.metrics.server.SqlArgument;
+import org.apache.iotdb.service.rpc.thrift.TSExecuteStatementResp;
+
+import com.codahale.metrics.MetricRegistry;
+
+public class MetricsPage {
+
+       private MetricRegistry mr;
+       private List<SqlArgument> list;
+
+       public List<SqlArgument> getList() {
+               return list;
+       }
+
+       public void setList(List<SqlArgument> list) {
+               this.list = list;
+       }
+
+       public MetricsPage(MetricRegistry metricRegistry) {
+               this.mr = metricRegistry;
+       }
+
+       public String render() {
+               String html = "";
+               String tmpStr = "";
+               try {
+                       String fileName = 
this.getClass().getClassLoader().getResource("iotdb/ui/static/index.html").getPath();
 
 Review comment:
   When I tried to open the page, I got error as below:
   ```
   2019-09-18 19:45:27,211 [Metrics-ServerServiceImpl] INFO  
org.eclipse.jetty.server.Server:408 - Started @3335ms 
   java.io.FileNotFoundException: 
file:/media/psf/Home/git/incubator-iotdb/server/target/iotdb-server-0.9.0-SNAPSHOT/lib/iotdb-server-0.9.0-SNAPSHOT.jar!/iotdb/ui/static/index.html
 (No such file or directory)
   at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at 
org.apache.iotdb.db.metrics.ui.MetricsPage.render(MetricsPage.java:57)
          ....
   ```
   Is the `/iotdb/ui/static` packaged in `iotdb-server-0.9.0-SNAPSHOT.jar`?  Or 
what should I do to get this page?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to