3

I am new to Jmeter. I have a locally hosted Bitbucket server. Sometimes when Bamboo plan triggers concurrent git clone operations it's found that Bitbucket servers gets slow/unresponsive and I have to restart the service. I want to simulate this behavior by running jmeter tests against another locally created Bitbucket server.

I would like to load test below scenario with Jmeter and bitbucket server.

  • Load test git clone and git update operations against bitbucket server through Jmeter.
  • Initially 20 users will make clone requests and 20 will make git update requests to bitbucket server.
  • Multiple git repos and multiple users configured in jmeter for test.

As these are non browser operations (git clone operation), I am not sure how to extract exact url which is hitting to bitbucket server.

Thanks

MrG
  • 1,525
  • 13
  • 24
Pushpraj
  • 69
  • 1
  • 6
  • Why you want to test BitBucket? Are you an authorized testers to load test BitBucket? There are lot of demo sites available to learn JMeter. Please use those. – NaveenKumar Namachivayam Apr 28 '17 at 16:25
  • what did you try? what do you try to achieve? please update your question with [minimal, complete, and verifiable example](https://stackoverflow.com/help/mcve) – Yuri G. Apr 29 '17 at 21:30
  • @NaveenKumarNamachivayam I have added more information to the question. I checked many demo sites but not sure how can non browser requests can be configured via Jmeter. – Pushpraj Apr 30 '17 at 06:40
  • You need to create HTTP request and leverage BitBucket APIs. Please see this link https://developer.atlassian.com/bitbucket/server/docs/latest/how-tos/command-line-rest.html First you need to authenticate, then send GET/POST calls for your operations to be performed. Make sure that you are adding `Content-Type` as `application/json` to your HTTP requests. – NaveenKumar Namachivayam Apr 30 '17 at 16:12

1 Answers1

2

I would recommend using Git Java Client library, i.e. JGit in order to mimic the required operations using JMeter. Just add JGit and dependencies to JMeter Classpath, restart JMeter and you should be able to use JGit API methods from the JSR223 Test Elements:

JMeter JSR223 Git

References:

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thank you so much. Initially it's working for single git clone operation. I want to extend it so that I can pass list of 20 different repositories and 20 localWorkingCopy dir's to groovy script.I am reading documents to achieve this. If you know simple way to handle this please let me know. – Pushpraj May 02 '17 at 08:02
  • Thanks Dmitri. I was able to parameterize it and was successful with 20 git clone operations. Next thing I want to check is 20 concurrent commits and push. Can you please suggest how this can be done with Jgit and groovy.?Or different approach needs to be followed for this operation.? – Pushpraj May 02 '17 at 12:05
  • Why can't we leverage BitBucket APIs directly to do git operations? Has there been any more advantages of using JGit over BB APIs? – NaveenKumar Namachivayam May 03 '17 at 01:13
  • @NaveenKumarNamachivayam Because, my dear, well-behaved load test needs to mimic **real** usage of the application under test, to wit bitbucket server. I believe 99% of requests will be SSH-based, not HTTP. Btw, it is not the first time I'm seeing a bad response or recommendation from you so could you kindly consider stopping this form of activity? – Dmitri T May 03 '17 at 05:07
  • Apologies. I meant in a polite way, not in a bad manner. I know you are an expert. I am here to learn like everyone, please guide me if I did anything wrong. Thanks for the clarification. – NaveenKumar Namachivayam May 03 '17 at 05:13
  • @DmitriT please comment or guide, if my response, recommendation or answer can be improved. It will help me and others. Thanks again. – NaveenKumar Namachivayam May 03 '17 at 05:42
  • Hi @DmitriT can you please suggest/advice on how can concurrent git commit and git push operation to multiple repos achieved.? Clone code which you referred in above answer gave me great direction. Thanks – Pushpraj May 03 '17 at 06:48