jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1832345 - in /jmeter/trunk: bin/report-template/content/js/dashboard-commons.js bin/report-template/content/js/graph.js.fmkr xdocs/changes.xml
Date Sun, 27 May 2018 19:53:20 GMT
Author: pmouawad
Date: Sun May 27 19:53:20 2018
New Revision: 1832345

URL: http://svn.apache.org/viewvc?rev=1832345&view=rev
Log:
Bug 62283 - Report Dashboard - Date is not correctly displayed on chart when granularity is
>= 1 day
Bugzilla Id: 62283

Modified:
    jmeter/trunk/bin/report-template/content/js/dashboard-commons.js
    jmeter/trunk/bin/report-template/content/js/graph.js.fmkr
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/bin/report-template/content/js/dashboard-commons.js
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/report-template/content/js/dashboard-commons.js?rev=1832345&r1=1832344&r2=1832345&view=diff
==============================================================================
--- jmeter/trunk/bin/report-template/content/js/dashboard-commons.js (original)
+++ jmeter/trunk/bin/report-template/content/js/dashboard-commons.js Sun May 27 19:53:20 2018
@@ -14,6 +14,9 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
+var DAY_MS   = 86400000;
+var HOUR_MS  =  3600000;
+var MINUTE_MS  =    60000;
 
 /**
  * From https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math/round
@@ -128,6 +131,22 @@ function getElapsedTimeLabel(granularity
 }
 
 /*
+ * Gets time format based on granularity
+ */
+function getTimeFormat(granularity) {
+    if (granularity >= DAY_MS) {
+        return "%y/%m/%d"; 
+    } else if (granularity >= HOUR_MS) {
+        return "%m/%d %H"; 
+    } else if (granularity >= MINUTE_MS) {
+        return "%d %H:%M";
+    } else {
+        return "%H:%M:%S";
+    }
+}
+
+
+/*
  * Gets axis label for the specified granularity
  */
 function getConnectTimeLabel(granularity) {

Modified: jmeter/trunk/bin/report-template/content/js/graph.js.fmkr
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/report-template/content/js/graph.js.fmkr?rev=1832345&r1=1832344&r2=1832345&view=diff
==============================================================================
--- jmeter/trunk/bin/report-template/content/js/graph.js.fmkr (original)
+++ jmeter/trunk/bin/report-template/content/js/graph.js.fmkr Sun May 27 19:53:20 2018
@@ -441,7 +441,7 @@ var activeThreadsOverTimeInfos = {
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getElapsedTimeLabel(this.data.result.granularity),
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,
@@ -585,7 +585,7 @@ var bytesThroughputOverTimeInfos = {
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getElapsedTimeLabel(this.data.result.granularity) ,
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,
@@ -662,7 +662,7 @@ var responseTimesOverTimeInfos = {
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getElapsedTimeLabel(this.data.result.granularity),
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,
@@ -739,7 +739,7 @@ var latenciesOverTimeInfos = {
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getElapsedTimeLabel(this.data.result.granularity),
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,
@@ -816,7 +816,7 @@ var connectTimeOverTimeInfos = {
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getConnectTimeLabel(this.data.result.granularity),
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,
@@ -894,7 +894,7 @@ var responseTimePercentilesOverTimeInfos
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getElapsedTimeLabel(this.data.result.granularity),
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,
@@ -1114,7 +1114,7 @@ var hitsPerSecondInfos = {
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getElapsedTimeLabel(this.data.result.granularity),
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,
@@ -1191,7 +1191,7 @@ var codesPerSecondInfos = {
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getElapsedTimeLabel(this.data.result.granularity),
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,
@@ -1268,7 +1268,7 @@ var transactionsPerSecondInfos = {
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getElapsedTimeLabel(this.data.result.granularity),
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,
@@ -1345,7 +1345,7 @@ var totalTPSInfos = {
                 },
                 xaxis: {
                     mode: "time",
-                    timeformat: "%H:%M:%S",
+                    timeformat: getTimeFormat(this.data.result.granularity),
                     axisLabel: getElapsedTimeLabel(this.data.result.granularity),
                     axisLabelUseCanvas: true,
                     axisLabelFontSizePixels: 12,

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1832345&r1=1832344&r2=1832345&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sun May 27 19:53:20 2018
@@ -210,6 +210,7 @@ this behaviour, set <code>httpclient.res
 <h3>Report / Dashboard</h3>
 <ul>
     <li><bug>62333</bug>Report Dashboard - When one series contains no
value, the graph colors logic is wrong. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
+    <li><bug>62283</bug>Report Dashboard - Date is not correctly displayed
on chart when granularity is &lt;= 1 day</li>
 </ul>
 
 <h3>Documentation</h3>



Mime
View raw message