From commits-return-6074-apmail-jmeter-commits-archive=jmeter.apache.org@jmeter.apache.org Sat Oct 22 12:11:38 2016 Return-Path: X-Original-To: apmail-jmeter-commits-archive@minotaur.apache.org Delivered-To: apmail-jmeter-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5BA38192F2 for ; Sat, 22 Oct 2016 12:11:38 +0000 (UTC) Received: (qmail 44904 invoked by uid 500); 22 Oct 2016 12:11:38 -0000 Delivered-To: apmail-jmeter-commits-archive@jmeter.apache.org Received: (qmail 44868 invoked by uid 500); 22 Oct 2016 12:11:38 -0000 Mailing-List: contact commits-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list commits@jmeter.apache.org Received: (qmail 44854 invoked by uid 99); 22 Oct 2016 12:11:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Oct 2016 12:11:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 93E87C0104 for ; Sat, 22 Oct 2016 12:11:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id bubAzgaTH407 for ; Sat, 22 Oct 2016 12:11:35 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id BB5F95FAF9 for ; Sat, 22 Oct 2016 12:11:34 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9900FE01DC for ; Sat, 22 Oct 2016 12:11:30 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 988E43A1A91 for ; Sat, 22 Oct 2016 12:11:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1766185 - in /jmeter/trunk: bin/jmeter.properties bin/utility.groovy xdocs/usermanual/functions.xml Date: Sat, 22 Oct 2016 12:11:30 -0000 To: commits@jmeter.apache.org From: fschumacher@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161022121130.988E43A1A91@svn01-us-west.apache.org> Author: fschumacher Date: Sat Oct 22 12:11:30 2016 New Revision: 1766185 URL: http://svn.apache.org/viewvc?rev=1766185&view=rev Log: The groovy function is named __groovy. Add a note to add the utility-file to the groovy property. Add a bit of markup. Modified: jmeter/trunk/bin/jmeter.properties jmeter/trunk/bin/utility.groovy jmeter/trunk/xdocs/usermanual/functions.xml Modified: jmeter/trunk/bin/jmeter.properties URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1766185&r1=1766184&r2=1766185&view=diff ============================================================================== --- jmeter/trunk/bin/jmeter.properties (original) +++ jmeter/trunk/bin/jmeter.properties Sat Oct 22 12:11:30 2016 @@ -952,7 +952,7 @@ beanshell.server.file=../extras/startup. # Groovy function #--------------------------------------------------------------------------- -#Path to Groovy file containing utility functions to make available to __g function +#Path to Groovy file containing utility functions to make available to __groovy function #groovy.utilities= # Example @@ -1285,4 +1285,4 @@ system.properties=system.properties jmeter.reportgenerator.apdex_satisfied_threshold=500 # Change this parameter if you want to override the APDEX tolerance threshold. -jmeter.reportgenerator.apdex_tolerated_threshold=1500 \ No newline at end of file +jmeter.reportgenerator.apdex_tolerated_threshold=1500 Modified: jmeter/trunk/bin/utility.groovy URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/utility.groovy?rev=1766185&r1=1766184&r2=1766185&view=diff ============================================================================== --- jmeter/trunk/bin/utility.groovy (original) +++ jmeter/trunk/bin/utility.groovy Sat Oct 22 12:11:30 2016 @@ -15,6 +15,9 @@ * limitations under the License. * */ - -// Uncomment this function and use it with ${__g(factorial(10))} -// def factorial(n) { n == 1 ? 1 : n * factorial(n - 1) } \ No newline at end of file +// Remember to add this file to the property "groovy.utilities" in +// "bin/jmeter.properties", if you want to access it through +// the __groovy function +// +// Uncomment this function and use it with ${__groovy(factorial(10))} +// def factorial(n) { n == 1 ? 1 : n * factorial(n - 1) } Modified: jmeter/trunk/xdocs/usermanual/functions.xml URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/functions.xml?rev=1766185&r1=1766184&r2=1766185&view=diff ============================================================================== --- jmeter/trunk/xdocs/usermanual/functions.xml (original) +++ jmeter/trunk/xdocs/usermanual/functions.xml Sat Oct 22 12:11:30 2016 @@ -913,15 +913,16 @@ Remember to include any necessary quotes

- The g function evaluates Apache Groovy scripts passed to it, and returns the result. + The __groovy function evaluates Apache Groovy scripts passed to it, and returns the result.

If the property "groovy.utilities" is defined, it will be loaded by the ScriptEngine. This can be used to define common methods and variables. There is a -sample init file in the bin directory: utility.groovy. +sample init file in the bin directory: utility.groovy.

The following variables are set before the script is executed: +

  • log - the Logger for the groovy function (*)
  • ctx - JMeterContext object
  • @@ -932,6 +933,7 @@ The following variables are set before t
  • prev - the previous SampleResult, if any
  • OUT - System.out
+

(*) means that this is set before the init file, if any, is processed. Other variables vary from invocation to invocation.