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/02/25 10:42:04 UTC

[GitHub] [jmeter] dgetzlaf opened a new pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

dgetzlaf opened a new pull request #645:
URL: https://github.com/apache/jmeter/pull/645


   
   ## Description
   Add escaping for new lines in AbstractInfluxdbMetricsSender.tagToStringValue()
   
   ## Motivation and Context
   For load- and performance testing (distributed testing) we send metrics to the InfluxDB.
   From time to time, no metrics occur in the dashboard while testing:
   ![Missing metrics](https://user-images.githubusercontent.com/54536760/109140654-1ac95c80-775d-11eb-891f-79daa8a620d2.png)
   
   In the log file of the JMeter controller, I find this line pretty often:
   ```
   ERROR o.a.j.v.b.i.HttpMetricsSender: Error writing metrics to influxDB Url: https://<URL>, responseCode: 400, responseBody: {"code":"invalid","message":"unable to parse 'jmeter,application=<application name>,transaction=<transaction name>,responseCode=500,responseMessage=javax.script.ScriptException:\\ org.openqa.selenium.ElementClickInterceptedException:\\ element\\ click\\ intercepted:\\ Element\\ \u003cbutton\\ type\\=\"submit\"\\ class\\=\"btn\\ btn-primary\\ btn-next\"\u003e...\u003c/button\u003e\\ is\\ not\\ clickable\\ at\\ point\\ (313\\,\\ 620).\\ Other\\ element\\ would\\ receive\\ the\\ click:\\ \u003cdiv\\ class\\=\"dhl\\ redesign\\ frankieren-loading-overlay\"\u003e...\u003c/div\u003e': missing fields\nunable to parse '\\ \\ (Session\\ info:\\ headless\\ chrome\\=88.0.4324.150)': missing fields\nunable to parse 'Build\\ info:\\ version:\\ '3.14.0'\\,\\ revision:\\ 'aacccce0'\\,\\ time:\\ '2018-08-02T20:19:58.91Z'': missing fields\nunable to parse 'System\\ info:\\ hos
 t:\\ 'ip-172-31-45-153.internal'\\,\\ ip:\\ '172.31.45.153'\\,\\ os.name:\\ 'Linux'\\,\\ os.arch:\\ 'amd64'\\,\\ os.version:\\ '4.14.214-160.339.amzn2.x86_64'\\,\\ java.version:\\ '11.0.7'': missing fields\nunable to parse 'Driver\\ info:\\ org.openqa.selenium.chrome.ChromeDriver': missing fields\nunable to parse 'Capabilities\\ {acceptInsecureCerts:\\ false\\,\\ browserName:\\ chrome\\,\\ browserVersion:\\ 88.0.4324.150\\,\\ chrome:\\ {chromedriverVersion:\\ 88.0.4324.96\\ (68dba2d8a0b14...\\,\\ userDataDir:\\ /tmp/.com.google.Chrome.L3v1yY}\\,\\ goog:chromeOptions:\\ {debuggerAddress:\\ localhost:46619}\\,\\ javascriptEnabled:\\ true\\,\\ networkConnectionEnabled:\\ false\\,\\ pageLoadStrategy:\\ normal\\,\\ platform:\\ LINUX\\,\\ platformName:\\ LINUX\\,\\ proxy:\\ Proxy(manual\\,\\ http\\=localhos...\\,\\ setWindowRect:\\ true\\,\\ strictFileInteractability:\\ false\\,\\ timeouts:\\ {implicit:\\ 0\\,\\ pageLoad:\\ 300000\\,\\ script:\\ 30000}\\,\\ unhandledPromptBehavior:\\ dism
 iss\\ and\\ notify\\,\\ webauthn:extension:largeBlob:\\ true\\,\\ webauthn:virtualAuthenticators:\\ true}': missing fields"}
   ```
   
   It seems that the escaping of the line breaks is not working properly. By that, invalid requests are sent to the InfluxDB, resulting in 'missing fields'.
   
   
   ## How Has This Been Tested?
   1. Configure InfluxDB connection
   2. Add a new JSR223 with the body
   ```java
   throw new Exception('''Line 0
   Line 1
   Line 2
   End
   ''')
   ```
   
   Current JMeter 5.4.1 Release:
   3. Looking at the console output / jmeter log file --> The error occurs
   4. influxDB : No metrics received
   
   JMeter 5.4.1 Release + this fix:
   3. Looking at the console output / jmeter log file --> No error occurs
   4. influxDB : metrics are received
   
   
   ## Types of changes
   - Bug fix (non-breaking change which fixes an issue)
   
   ## Checklist:
   - [x] My code follows the [code style][style-guide] of this project.
   - [x] I have updated the documentation accordingly.
   
   [style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines
   


----------------------------------------------------------------
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.

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



[GitHub] [jmeter] dgetzlaf commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   @vlsi do you know someone, who could initiate a JMeter 5.5 release?
   
   Your Open Model Thread Group looks good to me; sadly I had no chance in testing it yet.
   


-- 
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 #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   Thanks for the PR. Could you test next nightly or build from trunk and report back, if it solves your problem?


----------------------------------------------------------------
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.

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



[GitHub] [jmeter] coeyc commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   has this fix made its way into a downloadable build of JMeter?


-- 
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] vlsi commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   Oh, there were no releases since the fix has been merged. That is quite some time now.


-- 
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] dgetzlaf commented on a change in pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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



##########
File path: src/components/src/main/java/org/apache/jmeter/visualizers/backend/influxdb/AbstractInfluxdbMetricsSender.java
##########
@@ -28,7 +29,11 @@
      * \ to escape List of special characters : commas , equal sign = spaces
      */
     static final String tagToStringValue(String s) {
-        return s.trim().replaceAll(" ", "\\\\ ").replaceAll(",", "\\\\,").replaceAll("=", "\\\\=");
+        return s.trim()
+                .replaceAll(" ", "\\\\ ")
+                .replaceAll(",", "\\\\,")
+                .replaceAll("=", "\\\\=")
+                .replaceAll("\n", "\\\\n");

Review comment:
       @ham1 thanks for your feedback. I've updated this code block according to your recommendation.




----------------------------------------------------------------
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.

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



[GitHub] [jmeter] vlsi commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   AFAIK it should be included in v5.4.1+. Am I mistaken?


-- 
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] vlsi commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   Just in case, the nightly would include Open Model Thread Group, and I would be glad to hear your feedback :)


-- 
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 #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   


----------------------------------------------------------------
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.

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



[GitHub] [jmeter] dgetzlaf commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   @coeyc this fix was approved and merged. Sadly JMeter wasn't released yet 😿 
   Maybe you can use a Nightly build instead https://ci-builds.apache.org/job/JMeter/job/JMeter-trunk/
   


-- 
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] coeyc commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   so, i guess the next build, we will look at the nightly build 
   


-- 
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] dgetzlaf commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   Hi @FSchumacher,
   I'm sorry for the late answer. I've just verified this fix with the SNAPSHOT from https://ci-builds.apache.org/job/JMeter/job/JMeter-trunk/266/
   


-- 
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.

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



[GitHub] [jmeter] ham1 commented on a change in pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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



##########
File path: src/components/src/main/java/org/apache/jmeter/visualizers/backend/influxdb/AbstractInfluxdbMetricsSender.java
##########
@@ -28,7 +29,11 @@
      * \ to escape List of special characters : commas , equal sign = spaces
      */
     static final String tagToStringValue(String s) {
-        return s.trim().replaceAll(" ", "\\\\ ").replaceAll(",", "\\\\,").replaceAll("=", "\\\\=");
+        return s.trim()
+                .replaceAll(" ", "\\\\ ")
+                .replaceAll(",", "\\\\,")
+                .replaceAll("=", "\\\\=")
+                .replaceAll("\n", "\\\\n");

Review comment:
       This looks ok to me, but while we are here, I believe we should use `replace` as `replaceAll` is only needed when using a regex as the pattern to find (it should also perform better).




----------------------------------------------------------------
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.

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



[GitHub] [jmeter] codecov-io commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #645:
URL: https://github.com/apache/jmeter/pull/645#issuecomment-785814393


   # [Codecov](https://codecov.io/gh/apache/jmeter/pull/645?src=pr&el=h1) Report
   > Merging [#645](https://codecov.io/gh/apache/jmeter/pull/645?src=pr&el=desc) (429d67f) into [master](https://codecov.io/gh/apache/jmeter/commit/b89c454dcbafd312c28a278bb781396ea4462750?el=desc) (b89c454) will **increase** coverage by `0.02%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/jmeter/pull/645/graphs/tree.svg?width=650&height=150&src=pr&token=6Q7CI1wFSh)](https://codecov.io/gh/apache/jmeter/pull/645?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #645      +/-   ##
   ============================================
   + Coverage     55.43%   55.46%   +0.02%     
   - Complexity    10157    10180      +23     
   ============================================
     Files          1044     1046       +2     
     Lines         64082    64151      +69     
     Branches       7250     7265      +15     
   ============================================
   + Hits          35527    35579      +52     
   - Misses        26048    26069      +21     
   + Partials       2507     2503       -4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/jmeter/pull/645?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...ackend/influxdb/AbstractInfluxdbMetricsSender.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL2NvbXBvbmVudHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci92aXN1YWxpemVycy9iYWNrZW5kL2luZmx1eGRiL0Fic3RyYWN0SW5mbHV4ZGJNZXRyaWNzU2VuZGVyLmphdmE=) | `100.00% <100.00%> (ø)` | `3.00 <1.00> (ø)` | |
   | [...ter/protocol/http/proxy/SamplerCreatorFactory.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL3Byb3RvY29sL2h0dHAvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9wcm90b2NvbC9odHRwL3Byb3h5L1NhbXBsZXJDcmVhdG9yRmFjdG9yeS5qYXZh) | `27.90% <0.00%> (-13.96%)` | `4.00% <0.00%> (-1.00%)` | |
   | [.../apache/jmeter/protocol/http/util/HTTPFileArg.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL3Byb3RvY29sL2h0dHAvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9wcm90b2NvbC9odHRwL3V0aWwvSFRUUEZpbGVBcmcuamF2YQ==) | `87.93% <0.00%> (-2.55%)` | `25.00% <0.00%> (+6.00%)` | :arrow_down: |
   | [...n/java/org/apache/jmeter/sampler/DebugSampler.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL2NvbXBvbmVudHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9zYW1wbGVyL0RlYnVnU2FtcGxlci5qYXZh) | `77.27% <0.00%> (-1.46%)` | `13.00% <0.00%> (-1.00%)` | |
   | [...rg/apache/jmeter/extractor/DebugPostProcessor.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL2NvbXBvbmVudHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9leHRyYWN0b3IvRGVidWdQb3N0UHJvY2Vzc29yLmphdmE=) | `80.00% <0.00%> (-0.96%)` | `14.00% <0.00%> (-1.00%)` | |
   | [...n/java/org/apache/jmeter/reporters/Summariser.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL2NvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9yZXBvcnRlcnMvU3VtbWFyaXNlci5qYXZh) | `85.49% <0.00%> (-0.77%)` | `18.00% <0.00%> (-1.00%)` | |
   | [...ter/protocol/http/proxy/DefaultSamplerCreator.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL3Byb3RvY29sL2h0dHAvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9wcm90b2NvbC9odHRwL3Byb3h5L0RlZmF1bHRTYW1wbGVyQ3JlYXRvci5qYXZh) | `54.12% <0.00%> (-0.52%)` | `28.00% <0.00%> (-1.00%)` | |
   | [...in/java/org/apache/jmeter/save/CSVSaveService.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL2NvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9zYXZlL0NTVlNhdmVTZXJ2aWNlLmphdmE=) | `44.53% <0.00%> (-0.05%)` | `61.00% <0.00%> (+1.00%)` | :arrow_down: |
   | [...pache/jmeter/protocol/http/sampler/PostWriter.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL3Byb3RvY29sL2h0dHAvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9wcm90b2NvbC9odHRwL3NhbXBsZXIvUG9zdFdyaXRlci5qYXZh) | `86.70% <0.00%> (ø)` | `31.00% <0.00%> (-1.00%)` | |
   | [...ache/jmeter/protocol/http/sampler/HTTPHC4Impl.java](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree#diff-c3JjL3Byb3RvY29sL2h0dHAvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9wcm90b2NvbC9odHRwL3NhbXBsZXIvSFRUUEhDNEltcGwuamF2YQ==) | `60.46% <0.00%> (ø)` | `89.00% <0.00%> (-1.00%)` | |
   | ... and [5 more](https://codecov.io/gh/apache/jmeter/pull/645/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/jmeter/pull/645?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/jmeter/pull/645?src=pr&el=footer). Last update [b89c454...429d67f](https://codecov.io/gh/apache/jmeter/pull/645?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



[GitHub] [jmeter] vlsi commented on pull request #645: Add escaping for new lines in AbstractInfluxdbMetricsSender

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


   A mail to dev@jmeter.apache.org would do


-- 
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