imbajin commented on code in PR #2860:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2860#discussion_r2313248366


##########
hugegraph-server/hugegraph-example/src/main/java/org/apache/hugegraph/example/PerfExample1.java:
##########
@@ -34,6 +36,8 @@
  */
 public class PerfExample1 extends PerfExampleBase {
 
+    private static final Logger LOG = Log.logger(PerfExample1.class);

Review Comment:
   The logger declaration in PerfExample1 and PerfExample2 is added but never 
used. Consider removing these unused imports and logger declarations to avoid 
dead code.



##########
hugegraph-server/hugegraph-example/src/main/java/org/apache/hugegraph/example/PerfExample2.java:
##########
@@ -34,6 +36,8 @@
  */
 public class PerfExample2 extends PerfExampleBase {
 
+    private static final Logger LOG = Log.logger(PerfExample2.class);

Review Comment:
   Same issue as PerfExample1 - logger is declared but never used. Remove the 
unused import and logger declaration.



##########
hugegraph-server/hugegraph-example/src/main/java/org/apache/hugegraph/example/PerfExample5.java:
##########
@@ -0,0 +1,101 @@
+/*
+ * 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.hugegraph.example;
+
+import java.util.Iterator;
+
+import org.apache.hugegraph.HugeFactory;
+import org.apache.hugegraph.type.define.Directions;
+import org.apache.hugegraph.util.Log;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.slf4j.Logger;
+
+/**

Review Comment:
   The comment says 'query vertices/adj-edges by ids' but this class only 
provides vertex and edge querying functionality. The comment should be more 
specific about what this example demonstrates compared to PerfExample3.



##########
hugegraph-server/hugegraph-example/src/main/java/org/apache/hugegraph/example/PerfExample6.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.hugegraph.example;
+
+import org.apache.hugegraph.HugeFactory;
+import org.apache.hugegraph.util.Log;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.slf4j.Logger;
+
+/**
+ * Perf test for: query vertices/adj-edges by ids
+ */

Review Comment:
   The comment is identical to PerfExample5 but this class has different 
functionality (batch insertion with edges). Update the comment to accurately 
describe what PerfExample6 demonstrates.



##########
hugegraph-server/hugegraph-example/src/main/java/org/apache/hugegraph/example/PerfExample6.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.hugegraph.example;
+
+import org.apache.hugegraph.HugeFactory;
+import org.apache.hugegraph.util.Log;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.slf4j.Logger;
+
+/**
+ * Perf test for: query vertices/adj-edges by ids
+ */
+public class PerfExample6 extends PerfExample5 {
+
+    private static final Logger LOG = Log.logger(PerfExample6.class);
+
+    /**
+     * Main method
+     * @param args 3 arguments, 1st should be 1, meaning single thread,
+     *             product of 2nd and 3rd is total number of "person" vertices
+     * @throws InterruptedException
+     */
+    public static void main(String[] args) throws Exception {
+        PerfExample6 tester = new PerfExample6();
+        tester.test(args);
+
+        // Stop daemon thread
+        HugeFactory.shutdown(30L);
+    }
+
+    @Override
+    protected void testInsert(GraphManager graph, int times, int multiple) {
+        final int TIMES = times * multiple;

Review Comment:
   Consider extracting the BATCH constant to a class-level constant or making 
it configurable, as hardcoded values like 100 reduce flexibility for 
performance testing.



-- 
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-unsubscr...@hugegraph.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org
For additional commands, e-mail: issues-h...@hugegraph.apache.org

Reply via email to