You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/12/29 23:25:54 UTC

[GitHub] [flink-benchmarks] rkhachatryan commented on a diff in pull request #63: [FLINK-27571][benchmark] Recognize 'less is better' benchmarks in regression detection script

rkhachatryan commented on code in PR #63:
URL: https://github.com/apache/flink-benchmarks/pull/63#discussion_r1059186216


##########
update_benchmark_fileds.py:
##########
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+################################################################################
+#  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.
+################################################################################
+
+###################################################################
+# Sample script that updates fields for codespeed_benchmark table  #
+###################################################################
+import sqlite3
+
+lessisbetter_name = [
+"rescaleHeap.RESCALE_IN",
+"rescaleHeap.RESCALE_OUT",
+"rescaleRocksDB.RESCALE_IN",
+"rescaleRocksDB.RESCALE_OUT",
+"rescaleRocksDB.RESTORE",
+"networkLatency1to1",
+"deployDownstreamTasks.BATCH",
+"deployAllTasks.STREAMING",
+"createScheduler.BATCH",
+"createScheduler.STREAMING",
+"startScheduling.BATCH",
+"startScheduling.STREAMING",
+"calculateRegionToRestart.BATCH",
+"calculateRegionToRestart.STREAMING",
+"partitionRelease.BATCH",
+"initSchedulingStrategy.BATCH",
+"initSchedulingStrategy.STREAMING",
+"schedulingDownstreamTasks.BATCH",
+"buildTopology.BATCH",
+"buildTopology.STREAMING"
+]
+
+if __name__ == "__main__":
+    conn = sqlite3.connect('data.db')
+    c = conn.cursor()
+    for name in lessisbetter_name:
+        sql = "update codespeed_benchmark set lessisbetter=?,units=? where name=?;"
+        cursor = c.execute(sql, (1, 'ms/op', name))
+        conn.commit()

Review Comment:
   Not sure if this script (`update_benchmark_fileds.py`) should be added to git because it was a one-off task IIUC.
   But if it should, then its purpose and some instructions on how to use it would be great.



##########
regression_report.py:
##########
@@ -131,8 +133,12 @@ def checkBenchmark(args, exe, benchmark):
     median_trend = 0
     if median != 0:
         median_trend = recent_median * 100 / median - 100
-    if median_trend < args.medianTrendThreshold:
-        # regression detected, print warning
+
+    # regression detected, print warning
+    if median_trend < args.medianTrendThreshold and lessIsbBetter is False:
+        print "<%s|%s> median=%s recent_median=%s" % (urlToBenchmark, benchmark, median, recent_median)
+
+    if median_trend > (-1 * args.medianTrendThreshold) and lessIsbBetter:

Review Comment:
   These two lines don't seem very readable to me.
   How about extracting it into a function e.g. `isThresholdReached` returning a boolean?
   That would also eliminate code duplication.



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

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