{"id":11256,"date":"2025-01-09T09:29:23","date_gmt":"2025-01-09T14:29:23","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=11256"},"modified":"2025-01-09T09:29:24","modified_gmt":"2025-01-09T14:29:24","slug":"jmeter-counter-element","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/","title":{"rendered":"Using the JMeter Counter Element"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-11257\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2025\/01\/word-image-11256-1.png\" alt=\"Using the JMeter Counter Element\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2025\/01\/word-image-11256-1.png 400w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2025\/01\/word-image-11256-1-300x225.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The <a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html#Counter\" target=\"_blank\" rel=\"noopener\"><em>Counter<\/em><\/a> element is a built-in feature of <a href=\"https:\/\/jmeter.apache.org\/usermanual\/index.html\" target=\"_blank\" rel=\"noopener\">JMeter<\/a> which generates sequential reference numbers within the scope of a <a href=\"https:\/\/jmeter.apache.org\/usermanual\/test_plan.html#thread_group\" target=\"_blank\" rel=\"noopener\">thread group<\/a>. These sequential numbers can be useful in identifying or grouping requests originating from a discrete iteration within a recurring process. In this brief article, we will review the features of the <em>Counter<\/em> element and describe how it may be utilized in a JMeter load test.<\/p>\n<h3><a id=\"post-11256-_nll4onqmrok4\"><\/a>Configuring the Counter Element<\/h3>\n<p>There are several parameters that may be set for the <em>Counter<\/em> element to control its behavior:<\/p>\n<ul>\n<li><strong><em>Starting value<\/em><\/strong> \u2013 the initial value the counter will start with.<\/li>\n<li><strong><em>Increment<\/em><\/strong> \u2013 the number by which the counter value will increase with each iteration.<\/li>\n<li><strong><em>Maximum value<\/em><\/strong> \u2013 the maximum value the counter will assume.<\/li>\n<li><strong><em>Number format<\/em><\/strong> \u2013 formatting applied to counter value.<\/li>\n<li><strong><em>Exported variable name<\/em><\/strong> \u2013 name of the variable containing counter value.<\/li>\n<\/ul>\n<figure id=\"attachment_11258\" class=\"wp-caption aligncenter\" style=\"max-width: 489px\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-11258\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2025\/01\/word-image-11256-2.png\" alt=\"Configuration options for the JMeter Counter element\" width=\"489\" height=\"376\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2025\/01\/word-image-11256-2.png 489w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2025\/01\/word-image-11256-2-300x231.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2025\/01\/word-image-11256-2-425x327.png 425w\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" \/><figcaption class=\"wp-caption-text\">Configuration options for the JMeter Counter element.<\/figcaption><\/figure>\n<p>There are also check boxes that control how counter values are used and regenerated. If the \u201c<em>track counter independently for each user<\/em>\u201d option is set, the counter tracks separate values for each virtual user.<\/p>\n<h3><a id=\"post-11256-_xafj5fqlb37x\"><\/a>Using the Counter in JMeter Tests<\/h3>\n<p>Based on the name ascribed in the configuration above, the <em>Counter<\/em> element will populate a user variable with the current counter value. This can be accessed in your tests using <code><strong>${...}<\/strong><\/code> convention or <a href=\"https:\/\/jmeter.apache.org\/usermanual\/functions.html#__P\" target=\"_blank\" rel=\"noopener\">property notation<\/a>. Query strings, request arguments, and custom scripting variables can be set to this value and thereby associated with a discrete sequenced value.<\/p>\n<hr \/>\n<p>Did you know that RedLine13 offers a full-featured, time-limited free trial?\u00a0 <a href=\"https:\/\/www.redline13.com\/Service\" target=\"_blank\" rel=\"noopener\">Sign up now<\/a>, and start testing today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Counter element is a built-in feature of JMeter which generates sequential reference numbers within the scope of a thread group. These sequential numbers can be useful in identifying or grouping requests originating from a discrete iteration within a recurring process. In this brief article, we will review the features of the Counter element and describe how it may be utilized in a JMeter load test. Configuring the Counter Element There are several parameters that may<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":11,"featured_media":11257,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,1],"tags":[128,736,737,283,299,318,424],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-dkoziel","4":"post-11256","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"category-uncategorized","10":"post_tag-cloud-load-testing","11":"post_tag-counter","12":"post_tag-counter-element","13":"post_tag-jmeter","14":"post_tag-jmeter-plugins","15":"post_tag-load-testing","16":"post_tag-redline13"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using the JMeter Counter Element - RedLine13<\/title>\n<meta name=\"description\" content=\"The Counter element is a built-in feature of JMeter which generates sequential reference numbers within the scope of a thread group.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using the JMeter Counter Element - RedLine13\" \/>\n<meta property=\"og:description\" content=\"The Counter element is a built-in feature of JMeter which generates sequential reference numbers within the scope of a thread group.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-09T14:29:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-09T14:29:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2025\/01\/word-image-11256-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"David Koziel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Koziel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/\"},\"author\":{\"name\":\"David Koziel\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\"},\"headline\":\"Using the JMeter Counter Element\",\"datePublished\":\"2025-01-09T14:29:23+00:00\",\"dateModified\":\"2025-01-09T14:29:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/\"},\"wordCount\":268,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"keywords\":[\"Cloud Load Testing\",\"Counter\",\"Counter element\",\"JMeter\",\"jmeter-plugins\",\"Load Testing\",\"RedLine13\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/\",\"name\":\"Using the JMeter Counter Element - RedLine13\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2025-01-09T14:29:23+00:00\",\"dateModified\":\"2025-01-09T14:29:24+00:00\",\"description\":\"The Counter element is a built-in feature of JMeter which generates sequential reference numbers within the scope of a thread group.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using the JMeter Counter Element\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"name\":\"RedLine13\",\"description\":\"(Almost) Free Load Testing in the Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.redline13.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\",\"name\":\"RedLine13\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"contentUrl\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"width\":300,\"height\":68,\"caption\":\"RedLine13\"},\"image\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\",\"name\":\"David Koziel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"caption\":\"David Koziel\"},\"url\":\"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using the JMeter Counter Element - RedLine13","description":"The Counter element is a built-in feature of JMeter which generates sequential reference numbers within the scope of a thread group.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/","og_locale":"en_US","og_type":"article","og_title":"Using the JMeter Counter Element - RedLine13","og_description":"The Counter element is a built-in feature of JMeter which generates sequential reference numbers within the scope of a thread group.","og_url":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/","og_site_name":"RedLine13","article_published_time":"2025-01-09T14:29:23+00:00","article_modified_time":"2025-01-09T14:29:24+00:00","og_image":[{"width":400,"height":300,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2025\/01\/word-image-11256-1.png","type":"image\/png"}],"author":"David Koziel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Koziel","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/"},"author":{"name":"David Koziel","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20"},"headline":"Using the JMeter Counter Element","datePublished":"2025-01-09T14:29:23+00:00","dateModified":"2025-01-09T14:29:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/"},"wordCount":268,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"keywords":["Cloud Load Testing","Counter","Counter element","JMeter","jmeter-plugins","Load Testing","RedLine13"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/","url":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/","name":"Using the JMeter Counter Element - RedLine13","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2025-01-09T14:29:23+00:00","dateModified":"2025-01-09T14:29:24+00:00","description":"The Counter element is a built-in feature of JMeter which generates sequential reference numbers within the scope of a thread group.","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2025\/01\/jmeter-counter-element\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using the JMeter Counter Element"}]},{"@type":"WebSite","@id":"https:\/\/www.redline13.com\/blog\/#website","url":"https:\/\/www.redline13.com\/blog\/","name":"RedLine13","description":"(Almost) Free Load Testing in the Cloud","publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redline13.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redline13.com\/blog\/#organization","name":"RedLine13","url":"https:\/\/www.redline13.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","contentUrl":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","width":300,"height":68,"caption":"RedLine13"},"image":{"@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20","name":"David Koziel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","caption":"David Koziel"},"url":"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=11256"}],"version-history":[{"count":1,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11256\/revisions"}],"predecessor-version":[{"id":11259,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11256\/revisions\/11259"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/11257"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=11256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=11256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=11256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}