difference between jmeter.bat/jmeter.sh And jmeter.file - batch-file

I would need clarification on jmeter.bat/sh and jmeter.FIle which are in bin folder.
With example:
1.If i setup different HEAP size in jmeter and jmeter.bat/sh file,which one will be considered.?
2.Does the above depend on how i run the test?(for ex: jmeter -n -t or jmeter.bat/sh -n -t)
3.If the test started with jmeter command instead of jmeter.bat ,will intern jmeter.bat be called and hence heap in jmeter.bat be used or vice-versa?
Update1: Adding screenshot where we can see jmeter/jmeter.bat/jmeter.bat files

You should update one file based on your OS Windows/ Unix
To run JMeter, run the jmeter.bat (for Windows) or jmeter (for Unix) file.
Both execute internally ApacheJMeter.jar
In windows execute jmeter -n -t is actually calls jmeter.bat
In Unix you can call either jmeter or jmeter.sh

Looking into your screenshot it seems that you're running Windows so the only file you should be considering is jmeter.bat
If you want to change JVM Heap it's better to go for changing HEAP environment variables on Windows level like:
set HEAP=4G && jmeter.bat
when you type jmeter Windows is looking for a relevant executable or shell script first in the current folder than on PATH so jmeter will call jmeter.bat if you're invoking it from JMeter's "bin" folder, if you do it from another folder the command-line interpreter will look for it in PATH and if nothing will be found - it'll fail with "'jmeter' is not recognized as an internal or external command,
operable program or batch file."
More information: How Do I Run JMeter in Non-GUI Mode?

Related

'ls' is not recognized as an internal or external command, operable program or batch file

'ls' is not recognized as an internal or external command, operable program or batch file.
I get this error when I try to glance at the files of my folder.
cmd opened regularly(not as an admin).
I've recently downloaded anaconda for python.During the installation process, there was a time when I allowed to add a PATH which was not recommended.
'ls' used to work well be
Here are the paths
I'm fairly certain that the ls command is for Linux, not Windows (I'm assuming you're using Windows as you referred to cmd, which is the command line for the Windows OS).
You should use dir instead, which is the Windows equivalent of ls.
Edit (since this post seems to be getting so many views :) ):
You can't use ls on cmd as it's not shipped with Windows, but you can use it on other terminal programs (such as GitBash). Note, ls might work on some FTP servers if the servers are linux based and the FTP is being used from cmd.
dir on Windows is similar to ls. To find out the various options available, just do dir/?.
If you really want to use ls, you could install 3rd party tools to allow you to run unix commands on Windows. Such a program is Microsoft Windows Subsystem for Linux (link to docs).
We can use ls and many other Linux commands in Windows cmd. Just follow these steps.
Steps:
1) Install Git in your computer - https://git-scm.com/downloads.
2) After installing Git, go to the folder in which Git is installed.
Mostly it will be in C drive and then Program Files Folder.
3) In Program Files folder, you will find the folder named Git, find the bin folder
which is inside usr folder in the Git folder.
In my case, the location for bin folder was - C:\Program Files\Git\usr\bin
4) Add this location (C:\Program Files\Git\usr\bin) in path variable, in system
environment variables.
5) You are done. Restart cmd and try to run ls and other Linux commands.
you can use dir instead of ls in cmd
If you want to use Unix shell commands on Windows, you can use Windows Powershell, which includes both Windows and Unix commands as aliases. You can find more info on it in the documentation.
PowerShell supports aliases to refer to commands by alternate names.
Aliasing allows users with experience in other shells to use common
command names that they already know for similar operations in
PowerShell.
The PowerShell equivalents may not produce identical results. However,
the results are close enough that users can do work without knowing
the PowerShell command name.
when you use windows as operating system you should write dir
and you will find all folders including empty folders and their data bytes storage
and you can use git ls-files to show all folders but not including hidden folders
The reason you cannot run the ls command is because it does not exist on windows. The windows equivalent is the dir command, however it does not work the same way. The solution, Winls. It is
The ls command, written for windows.
According the the Winls github.
Had this error because i was using command prompt to access my files.
how did i solve it...
i opened my folder with vscode, and used bash from the terminal...the "ls" command worked as it should from bash.

Remotely launching a process with LLDB

I'm trying to remotely launch and debug a new process with lldb without much success.
Attaching to an already launched process works well by running these commands:
process connect <url>
process attach -P gdb-remote --pid <pid>
But if I want debugserver to launch the executable by itself I'm running into troubles. Especially, I have no clue what arguments should I pass to target create.
According to this page LLDB "will transparently take care of [..] downloading the executable in order to be able to debug", yet target create seem to always require a local file. If I specify the remote file via -r I get either unable to open target file or remote --> local transfer without local path is not implemented yet errors. If I set the target to a local file (such as a local copy of the remote's loader executable) without using -r, then attempt to run process launch -p gdb-remote -s <remote path> LLDB will attempt running the local path on the remote machine and fail.
What are the correct commands I need to use in order to launch a remote process?
After contacting LLDB's mailing list Greg updated the documentation page, which now clearly explains what I have to do (Specifically I was missing the script lines, which appear to be the correct way to set the remote executable path)

Script via Plink in .bat behaves differently

I have a .bat file on my Windows machine. This .bat file uses plink.exe to connect to an Ubuntu machine and execute an .sh script. However, I get different behaviors on the script depending on how Plink is used:
log onto Ubuntu directly (in person) -- script succeeds
ssh via Bitvise client -- script succeeds
ssh via Plink (by calling plink.exe) and calling script from interactive shell (it's a Ubuntu shell within windows cmd.exe) -- script succeeds
ssh via .bat which then calls Plink -- script fails
The script fails w/ message:
error while loading shared libraries: libCint.so: cannot open shared object file: No such file or directory
Other posts seem to refer to installation/permission issues of libCint.so but I know this is not the case since the script works correctly in other instances as shown above.
Below is the plink.exe line from my .bat file:
plink.exe !plink_ssh_details! myscript
The above script fails when called this way via .bat file; again, note that it succeeds when called directly from the Ubuntu or when I -ssh directly into the Ubuntu via cmd.exe (using plink.exe) or Bitvise client. Any help would be appreciated.
In the other cases, you are using interactive sessions.
While the Plink uses non-interactive session by default, when you specify a command on its command-line.
Your script probably relies on some environment variables (like PATH) being set specifically.
It's quite probable that the variables are set only for interactive sessions. Probably because they are modified in a startup script that is executed (sourced) for the the interactive sessions only.
Solutions are:
Correct the startup scripts to modify the variables unconditionally (even for non-interactive sessions).
Modify the script not to rely on environment variables.
Or you can source the profile script, see Unable to run shell script with ktutil command from Windows using PLINK.
Force the Plink to use the interactive session using the -t switch
This is not a recommended solution, as using the interactive session to automate a command execution can bring you nasty side effects. See for example Is there a simple way to get rid of junk values that come when you SSH using Python's Paramiko library and fetch output from CLI of a remote machine?
Some more obscure SSH servers can also behave differently when "exec" channel is used to execute the command. See Executing command on Plink command line fails with "not found".
I had to hack a solution to work around this problem. Adding a "-i" option at the header of the bash script I was invoking from my .bat file did the trick:
#!/bin/bash -i
Note some warn of unwanted side effects (no mention of specifics tho...) when using this option. But calling this now interactive script from a remote ssh session (e.g. when using plink.exe from a Windows .bat file and passing inline commands to the Unix box) solves any issues regarding file/directory visibility & permission issues.
Note to plink users: if you're calling a script on Unix via plink and noticing that the script doesn't behave as expected...adding the "-i" may help debug/solve your problem. Again, note that some have claimed unwanted side-effects of this hack of which they/I'm unaware.

How do I launch VBoxHeadless with a Win7 batch file?

I am trying to run my Virtual machine in headless form from a batch file.
For some reason, I can't make it work. Any suggestions?
This is how I'm trying to run my Virtual Machine:
VBoxManage.exe startvm "DebBox" --type "headless"
There are several reasons that the program isn't running. For starters, you need to use the start command to run a program. Additionally, I can almost guarantee that the path where VBox is installed isn't part of your %path% variable, which means that you're going to need to either navigate to that directory first or provide the full path in order to run the executable.
pushd "C:\path\to\vbox\installation"
start "" VBoxManage.exe startvm "DebBox" --type "headless"
popd

Batch file to run JMeter script

I have a .jmx file of all of my test plans and I want to create a batch file. When I click that, everything starts and ends automatically. So that I can provide it to my client as well to verify that I have performed the load test on his website. How can I achieve this?
jmeter does not support running batch of .jmx files as document part 2.4.3 (Command Line Mode) gives to us.
I would recommend you to try 2 approaches:
1) to follow best practices of running jMeter in non GUI mode.
In accordance to this approach you are expected to use the command
jmeter -n -t D:\TestScripts\script.jmx -l D:\TestScripts\scriptresults.jtl
Where the pareameters:
-n [This specifies JMeter is to run in non-gui mode]
-t [name of JMX file that contains the Test Plan]
-l [name of JTL file to log sample results to]
-j [name of JMeter run log file]
2) to use any cloud service for running your .jmx file.
BlazeMeter (http://blazemeter.com/) worked for me fine.
One can adjust the test plan settings.
Testing results can be seen on “Load Report” tab as soon as test finishes.
For detalization one can follow Getting Started: Scripting with JMeter steps.
Hope this works for you.
Just write the following command in a text file and save this file as SomeName.bat
#ECHO OFF
jmeter -n -t "Your .jmx file path" -l "Your .jtl file path"
For example:
#echo off
jmeter -n -t F:\DEV\WORKSPACE\buyer.jmx -l F:\DEV\WORKSPACE\output.jtl
After saving click on that bat file. The test plan result will be stored into .jtl file.
Note: Make sure you put this bat file into JmeterinstallationDirectory/bin folder.

Resources