You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by GitBox <gi...@apache.org> on 2021/09/19 13:31:01 UTC

[GitHub] [jmeter] mawasak opened a new pull request #672: timeShift function docs update.

mawasak opened a new pull request #672:
URL: https://github.com/apache/jmeter/pull/672


   ## Description
   Proposition to add additonal documentation for timeShift function.
   
   ## Motivation and Context
   timeShift is very flexible and has not documented implicite behaviour. This change is loosely connected with https://bz.apache.org/bugzilla/show_bug.cgi?id=65217
   
   ## How Has This Been Tested?
   Change is in functions.xml file so gradle previewSite task was used.
   
   ## Screenshots (if appropriate):
   NA
   
   ## Types of changes
   Only documentation in site, result will be visible on html https://jmeter.apache.org/usermanual/functions.html#__timeShift
   
   ## Checklist:
   NA
   


-- 
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: dev-unsubscribe@jmeter.apache.org

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



[GitHub] [jmeter] mawasak commented on a change in pull request #672: timeShift function docs update.

Posted by GitBox <gi...@apache.org>.
mawasak commented on a change in pull request #672:
URL: https://github.com/apache/jmeter/pull/672#discussion_r712357619



##########
File path: xdocs/usermanual/functions.xml
##########
@@ -1575,13 +1575,14 @@ returns:
     </description>
 <properties>
         <property name="Format" required="No">
-        The format to be passed to DateTimeFormatter.
+        The format to be passed to DateTimeFormatter (for input data parsing and output formating).
         See <a href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html">DateTimeFormatter</a>
-        If omitted, the function uses milliseconds since epoch format.
+        If omitted, the function returns milliseconds.
         </property>
         <property name="Date to shift" required="No">
         Indicate the date in the format set by the parameter <code>Format</code> to shift.
-        If omitted, the date is set to <em>now</em>.
+        If omitted, the date is set to <em>ZonedDateTime.now</em> with system zone <em>ZoneId.systemDefault()</em>.
+        If <code>Format</code> parameter is not set then this property (if required) must be set as number of milliseconds eg.: Format="" and "Date to shift"=10000 then if "value to shift"=PT10S then result=20000 (20sec)

Review comment:
       I will fix it:)




-- 
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: dev-unsubscribe@jmeter.apache.org

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



[GitHub] [jmeter] asfgit closed pull request #672: timeShift function docs update.

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #672:
URL: https://github.com/apache/jmeter/pull/672


   


-- 
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: dev-unsubscribe@jmeter.apache.org

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



[GitHub] [jmeter] FSchumacher commented on a change in pull request #672: timeShift function docs update.

Posted by GitBox <gi...@apache.org>.
FSchumacher commented on a change in pull request #672:
URL: https://github.com/apache/jmeter/pull/672#discussion_r712243041



##########
File path: xdocs/usermanual/functions.xml
##########
@@ -1575,13 +1575,14 @@ returns:
     </description>
 <properties>
         <property name="Format" required="No">
-        The format to be passed to DateTimeFormatter.
+        The format to be passed to DateTimeFormatter (for input data parsing and output formating).
         See <a href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html">DateTimeFormatter</a>
-        If omitted, the function uses milliseconds since epoch format.
+        If omitted, the function returns milliseconds.

Review comment:
       While it returns milliseconds, those are anchored at start of the unix epoch. Hence I think that detail should not be dropped.

##########
File path: xdocs/usermanual/functions.xml
##########
@@ -1575,13 +1575,14 @@ returns:
     </description>
 <properties>
         <property name="Format" required="No">
-        The format to be passed to DateTimeFormatter.
+        The format to be passed to DateTimeFormatter (for input data parsing and output formating).
         See <a href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html">DateTimeFormatter</a>
-        If omitted, the function uses milliseconds since epoch format.
+        If omitted, the function returns milliseconds.
         </property>
         <property name="Date to shift" required="No">
         Indicate the date in the format set by the parameter <code>Format</code> to shift.
-        If omitted, the date is set to <em>now</em>.
+        If omitted, the date is set to <em>ZonedDateTime.now</em> with system zone <em>ZoneId.systemDefault()</em>.
+        If <code>Format</code> parameter is not set then this property (if required) must be set as number of milliseconds eg.: Format="" and "Date to shift"=10000 then if "value to shift"=PT10S then result=20000 (20sec)

Review comment:
       This last line feels like an example/explaining note to me. Should this be in an extra `note` paragraph?
   At other places in this documentation, we use the `code`-tag for the name of parameters, when mentioned in the docs, would not this be helpful here, too?




-- 
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: dev-unsubscribe@jmeter.apache.org

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



[GitHub] [jmeter] FSchumacher commented on pull request #672: timeShift function docs update.

Posted by GitBox <gi...@apache.org>.
FSchumacher commented on pull request #672:
URL: https://github.com/apache/jmeter/pull/672#issuecomment-923853352


   Thanks for the PR


-- 
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: dev-unsubscribe@jmeter.apache.org

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



[GitHub] [jmeter] mawasak commented on a change in pull request #672: timeShift function docs update.

Posted by GitBox <gi...@apache.org>.
mawasak commented on a change in pull request #672:
URL: https://github.com/apache/jmeter/pull/672#discussion_r712357389



##########
File path: xdocs/usermanual/functions.xml
##########
@@ -1575,13 +1575,14 @@ returns:
     </description>
 <properties>
         <property name="Format" required="No">
-        The format to be passed to DateTimeFormatter.
+        The format to be passed to DateTimeFormatter (for input data parsing and output formating).
         See <a href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html">DateTimeFormatter</a>
-        If omitted, the function uses milliseconds since epoch format.
+        If omitted, the function returns milliseconds.

Review comment:
       Yes, You are right. I mean that when format is not given and date to shift is given (and must be Long) the code is reduced to result that don't  seem explicitly connect with epoch:
   
   `Duration duration = Duration.parse("PT10S");`
   `ZoneId systemDefaultZoneID = ZoneId.systemDefault();`
   `ZonedDateTime  zonedDateTimeToShift = ZonedDateTime.ofInstant(Instant.ofEpochMilli(Long.parseLong("10000")), systemDefaultZoneID);`
   `zonedDateTimeToShift = zonedDateTimeToShift.plus(duration);`
   `String result = String.valueOf(zonedDateTimeToShift.toInstant().toEpochMilli());`
   `System.out.println(result); //just 20000ms`
   
   
   But, yes, when date to shift is not given  (is default: now) then connection with epoch is seen better:
   
   `Duration duration = Duration.parse("PT10S");`
   `ZoneId systemDefaultZoneID = ZoneId.systemDefault();`
   `ZonedDateTime zonedDateTimeToShift = ZonedDateTime.now(systemDefaultZoneID);`
   `zonedDateTimeToShift = zonedDateTimeToShift.plus(duration);`
   `String result = String.valueOf(zonedDateTimeToShift.toInstant().toEpochMilli());`
   `System.out.println(result); //1632157138893ms`




-- 
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: dev-unsubscribe@jmeter.apache.org

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