This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 3236c61  Bump lets-plot to 2.2.1 and 3.1.1
3236c61 is described below

commit 3236c61a94ef0fddb5549d8887b2e714ac772b12
Author: Vladimir Sitnikov <[email protected]>
AuthorDate: Tue Dec 14 19:56:02 2021 +0300

    Bump lets-plot to 2.2.1 and 3.1.1
    
    It resolves
    * https://github.com/JetBrains/lets-plot/issues/472
    * https://github.com/JetBrains/lets-plot/issues/485
---
 gradle.properties                                  |  4 ++--
 .../threads/openmodel/gui/TargetRateChart.kt       | 28 ++++++++++------------
 src/dist/src/dist/expected_release_jars.csv        | 18 +++++++-------
 src/licenses/build.gradle.kts                      | 18 --------------
 src/licenses/licenses/lets-plot/LICENSE            | 21 ----------------
 5 files changed, 23 insertions(+), 66 deletions(-)

diff --git a/gradle.properties b/gradle.properties
index bb5ff14..154d602 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -113,8 +113,8 @@ jsoup.version=1.14.1
 jtidy.version=r938
 junit4.version=4.13.2
 junit5.version=5.8.1
-lets-plot-batik.version=2.2.0
-lets-plot-kotlin-jvm.version=3.1.0
+lets-plot-batik.version=2.2.1
+lets-plot-kotlin-jvm.version=3.1.1
 log4j.version=2.17.0
 mail.version=1.5.0-b01
 miglayout.version=5.3
diff --git 
a/src/core/src/main/kotlin/org/apache/jmeter/threads/openmodel/gui/TargetRateChart.kt
 
b/src/core/src/main/kotlin/org/apache/jmeter/threads/openmodel/gui/TargetRateChart.kt
index 3068036..facfb61 100644
--- 
a/src/core/src/main/kotlin/org/apache/jmeter/threads/openmodel/gui/TargetRateChart.kt
+++ 
b/src/core/src/main/kotlin/org/apache/jmeter/threads/openmodel/gui/TargetRateChart.kt
@@ -24,7 +24,7 @@ import jetbrains.letsPlot.geom.geomLine
 import jetbrains.letsPlot.intern.toSpec
 import jetbrains.letsPlot.label.ggtitle
 import jetbrains.letsPlot.letsPlot
-import jetbrains.letsPlot.scale.scaleXContinuous
+import jetbrains.letsPlot.scale.scaleXTime
 import jetbrains.letsPlot.theme
 import org.apache.jmeter.threads.openmodel.ThreadSchedule
 import org.apache.jmeter.threads.openmodel.ThreadScheduleStep
@@ -51,10 +51,15 @@ public class TargetRateChart : JPanel() {
         layout = BorderLayout()
     }
 
+    private var prevSteps: List<ThreadScheduleStep>? = null
     private var prevTimes: DoubleArray? = null
     private var prevRate: DoubleArray? = null
 
     public fun updateSchedule(threadSchedule: ThreadSchedule) {
+        if (threadSchedule.steps == prevSteps) {
+            return
+        }
+        prevSteps = threadSchedule.steps
         val timeValues = mutableListOf<Double>()
         val rateValues = mutableListOf<Double>()
         var time = 0.0
@@ -92,18 +97,9 @@ public class TargetRateChart : JPanel() {
         }
         prevTimes = time.copyOf()
         prevRate = rate.copyOf()
-        val totalDuration = time.last()
-        val timeUnit = when {
-            totalDuration > MIN_TICKS_FOR_TIME_AXIS * TimeUnit.DAYS.asSeconds 
-> TimeUnit.DAYS
-            totalDuration > MIN_TICKS_FOR_TIME_AXIS * TimeUnit.HOURS.asSeconds 
-> TimeUnit.HOURS
-            totalDuration > MIN_TICKS_FOR_TIME_AXIS * 
TimeUnit.MINUTES.asSeconds -> TimeUnit.MINUTES
-            else -> TimeUnit.SECONDS
-        }
-        if (timeUnit != TimeUnit.SECONDS) {
-            val scale = 1.0 / timeUnit.asSeconds
-            for (i in time.indices) {
-                time[i] *= scale
-            }
+        val timeScale = TimeUnit.SECONDS.toMillis(1).toDouble()
+        for (i in time.indices) {
+            time[i] *= timeScale
         }
         val maxRate = rate.maxOrNull() ?: 0.0
         val rateUnit = rateUnitFor(maxRate)
@@ -120,16 +116,16 @@ public class TargetRateChart : JPanel() {
             }
         }
         removeAll()
-        add(createChart(time = time, rate = rate, timeUnit = timeUnit, 
rateUnit = rateUnit), BorderLayout.CENTER)
+        add(createChart(time = time, rate = rate, rateUnit = rateUnit), 
BorderLayout.CENTER)
     }
 
-    private fun createChart(time: DoubleArray, rate: DoubleArray, timeUnit: 
TimeUnit, rateUnit: TimeUnit): JComponent {
+    private fun createChart(time: DoubleArray, rate: DoubleArray, rateUnit: 
TimeUnit): JComponent {
         val data = mapOf(
             "time" to time,
             "rate" to rate
         )
         val plot = letsPlot(data) + geomLine { x = "time"; y = "rate" } +
-            scaleXContinuous("Time, " + timeUnit.name.lowercase(), expand = 
listOf(0, 0)) +
+            scaleXTime("Time since test start", expand = listOf(0, 0)) +
             ggtitle("Target load rate per " + 
rateUnit.name.lowercase().removeSuffix("s")) +
             theme(axisTitleY = "blank")
 
diff --git a/src/dist/src/dist/expected_release_jars.csv 
b/src/dist/src/dist/expected_release_jars.csv
index 8ef431f..27a5d84 100644
--- a/src/dist/src/dist/expected_release_jars.csv
+++ b/src/dist/src/dist/expected_release_jars.csv
@@ -2,7 +2,7 @@
 29371,annotations-23.0.0.jar
 2387,apiguardian-api-1.1.0.jar
 122004,asm-9.2.jar
-517353,base-portable-jvm-2.2.0.jar
+518460,base-portable-jvm-2.2.1.jar
 485809,batik-anim-1.14.jar
 424624,batik-awt-util-1.14.jar
 703757,batik-bridge-1.14.jar
@@ -92,8 +92,8 @@
 22357,kotlin-stdlib-jdk7-1.6.0.jar
 16201,kotlin-stdlib-jdk8-1.6.0.jar
 792176,kotlinx-html-jvm-0.7.3.jar
-191102,lets-plot-batik-2.2.0.jar
-3995999,lets-plot-common-2.2.0.jar
+181223,lets-plot-batik-2.2.1.jar
+4025480,lets-plot-common-2.2.1.jar
 208235,log4j-1.2-api-2.17.0.jar
 301776,log4j-api-2.17.0.jar
 1789339,log4j-core-2.17.0.jar
@@ -107,11 +107,11 @@
 65261,oro-2.0.8.jar
 1307434,ph-commons-10.1.2.jar
 506616,ph-css-6.3.4.jar
-640740,plot-api-jvm-3.1.0.jar
-882161,plot-base-portable-jvm-2.2.0.jar
-847234,plot-builder-portable-jvm-2.2.0.jar
-115295,plot-common-portable-jvm-2.2.0.jar
-744679,plot-config-portable-jvm-2.2.0.jar
+642167,plot-api-jvm-3.1.1.jar
+891618,plot-base-portable-jvm-2.2.1.jar
+845777,plot-builder-portable-jvm-2.2.1.jar
+116030,plot-common-portable-jvm-2.2.1.jar
+749095,plot-config-portable-jvm-2.2.1.jar
 11369,reactive-streams-1.0.3.jar
 1315838,rhino-1.7.13.jar
 1242230,rsyntaxtextarea-3.1.3.jar
@@ -123,7 +123,7 @@
 2539,swing-extensions-visual-padding-0.1.3.jar
 734528,tika-core-1.27.jar
 1397879,tika-parsers-1.27.jar
-173926,vis-svg-portable-jvm-2.2.0.jar
+174661,vis-svg-portable-jvm-2.2.1.jar
 3154938,xalan-2.7.2.jar
 1386502,xercesImpl-2.12.1.jar
 220536,xml-apis-1.4.01.jar
diff --git a/src/licenses/build.gradle.kts b/src/licenses/build.gradle.kts
index 67115fa..05d5a27 100644
--- a/src/licenses/build.gradle.kts
+++ b/src/licenses/build.gradle.kts
@@ -135,24 +135,6 @@ val gatherBinaryLicenses by 
tasks.registering(GatherLicenseTask::class) {
         expectedLicense = SpdxLicense.MIT
     }
 
-    for (
-        a in listOf(
-            "lets-plot-kotlin-jvm",
-            "lets-plot-common",
-            "plot-config-portable-jvm",
-            "plot-builder-portable-jvm",
-            "plot-base-portable-jvm",
-            "plot-common-portable-jvm",
-            "vis-svg-portable-jvm",
-            "base-portable-jvm"
-        )
-    ) {
-        overrideLicense("org.jetbrains.lets-plot:$a") {
-            expectedLicense = SpdxLicense.MIT
-            licenseFiles = "lets-plot"
-        }
-    }
-
     overrideLicense("com.sun.mail:all:1.5.0-b01") {
         // Multiple licenses, specify explicitly
         expectedLicense = SimpleLicense("CDDL", 
uri("http://www.sun.com/cddl";)) and SimpleLicense("GPLv2+CE", 
uri("https://glassfish.java.net/public/CDDL+GPL_1_1.html";))
diff --git a/src/licenses/licenses/lets-plot/LICENSE 
b/src/licenses/licenses/lets-plot/LICENSE
deleted file mode 100644
index 1bcc8b5..0000000
--- a/src/licenses/licenses/lets-plot/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2019 JetBrains
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

Reply via email to