There is an answer how to generate JMeter report: How do I generate a Dashboard Report in jmeter?
And there is a question w/out accepted answer Solution to save Jmeter Dashboard reports to Confluence.
Although ultimately I now need to put info in Confluence, I want at least to be able to copy charts/graphs one by one, but although in both Chrome and Firefox I do have context menu of saving a picture ('Save image'), however resulting image looks empty in both of browsers. How can I save chart from HTML report to image?
Below is start of hexdump of one png file (they all come 32Kb size).
0000000 211 P N G \r \n 032 \n \0 \0 \0 \r I H D R
0000010 \0 \0 \b 213 \0 \0 003 \b 006 \0 \0 \0 ? ? p
0000020 \n \0 \0 \0 I D A T x ^ ? ? A 001 \0
0000030 \0 \b 002 1 ? _ ? 7 033 0 | ? s 004 \b
0000040 020 # 200 \0 001 002 004 \b 020 # 200 \0 001 002
0000050 004 \b 020 # 200 \0 001 002 004 \b 020 # 200 \0
0000060 001 002 031 201 e 222 \n J 200 \0 001 002 004 \b 020
0000070 # 200 \0 001 002 004 \b 020 # 200 \0 001 002 004 \b
0000080 020 # 200 \0 001 002 004 \b 020 p ? " 236 200
0000090 \0 001 002 004 \b 020 # 200 \0 001 002 004 \b 020
The charts are not normal <img> they reside in <canvas> tag
if you really want to proceed this way you could locate the canvas element you want to save and invoke toDataUrl() function on it like:
document.getElementById('responseTimesOverTime').getElementsByTagName('canvas')[0].toDataURL()
Once done you will get so called Data URL in form of data:image/png;base64,............... text as the output.
If you put this text into your browser URL area the image will open:
And this will be "real" image which can be saved.
An easier option would be using service like BM.Sense which can generate PDF reports out of the .jtl results files which can be added to the Confluence via the PDF Macro
You can use JMeterPluginsCMD to produce a image from report
There is small command-line utility for generating graphs out of JTL files. It behave just like right-click context menu on all graphs. The tool can generate PNG
Generating PNG:
JMeterPluginsCMD.bat --generate-png test.png --input-jtl results.jtl --plugin-type ResponseTimesOverTime --width 800 --height 600
In order to generate graphs using that plugin you most probably need also to install jpgc - Standard Set plugin and graph-s plugins (in plugins manager in JMeter on available page search for graph and install what suits needed charts description).
Parameter --plugin-type to choose graph type may not always be made of same wording as graphs names in HTLM report, see list of parameters on JMeterPluginsCMD page along with list of parameters to customise looks of graphs.
Related
I have a file which has a long list of data with a specific number of lines, below is an example:
111
222
333
444
555
666
777
888
999
i need to rearrange the files in which it'll put the output in one line (comma separated) and after x lines insert an new line in the output using shell:
111,222,333
444,555,666
777,888,999
Thanks
Ali
I came across an unusual space character the other day:
[user#server] ~ $ echo AB583 923 | od -c
0000000 A B 5 8 3 342 200 211 9 2 3 \n
0000014
[user#server] ~ $ echo AB583 923 | od -c
0000000 A B 5 8 3 9 2 3 \n
0000012
I tried to decipher it with the hexidecimal representation command, but I don't understand enough about base level data to understand what this character really is. Can anyone help me find out?
Well according to this, 342\200\211 is a thin space in Unicode.
What do you mean by "create a space character without using space"?
The value shown by od -c is in octal. The character that is represented by those three numbers has to be searched for. Getting back the numbers from octal to hex:
342 200 211 = 0xE2 0x80 0x89
Searching for utf8 0xE2 0x80 0x89 this site is found which shows that the UTF-8 byte sequence 0xE2 0x80 0x89 belongs to the UNICODE code point 2009, or simply U-02009.
That code point is named thin space, which, yes, is a character similar to U-0020, space.
So yes, there are several characters similar to an space in UNICODE, all of them valid and all of them similar to a simple space.
I just wonder: Why are you asking?.
I have a log file that generates timestamp and command logging on separate lines. I'd like to strip out the timestamp and save just the "user: command" list. I've tried several permutations of sed to replace or delete the data between strings, but it always oversteps the bounds of the command. Current log output similar to:
USER 001
6:32am
USER 001
random bash command or output 001
USER 002
7:41am
USER 002
random bash command or output 002
USER 001
7:43am
USER 001
random bash command or output 003
USER 002
7:43am
USER 002
random bash command or output 004
Desired output:
USER 001
random bash command or output 001
USER 002
random bash command or output 002
USER 001
random bash command or output 003
USER 002
random bash command or output 004
Looks like this will do:
sed -ri 'N; /^.*\n[0-9]/d'
(Assumes GNU sed.)
It processes the file two lines at a time.
On each cycle:
sed automatically reads one line into the pattern space.
The N command appends to the pattern space a newline and the next line.
If the pattern space matches "any text, newline, digit", then delete
it (and therefore don't auto-print it).
Otherwise, auto-print it.
If file is in same format all time, you can just remove the line like this:
awk 'NR%4!=1 && NR%4!=2' file
USER 001
random bash command or output 001
USER 002
random bash command or output 002
USER 001
random bash command or output 003
USER 002
random bash command or output 004
Or you can use it like this:
awk '!(NR%4==1 || NR%4==2)' file
I've written a simple script utilizing wget to collect specific filetypes (.png) from a website. While this works pretty well I'm somewhat concerned about possible security risks.
As it stands wget will just download everything with the .png extension, theoretically it would be possible for the website to contain malicious or trash files that have been renamed.
Is there a way to do some filtering before wget downloads? The files I'm looking to download always share some charcteristics that could be used to identify them (PNG image data, 200 x 300, 8-bit/color RGB, non-interlaced; Size between 80-120kB)
Can --spider be used to atleast sort out the files by size before downloading anything? If so I'd appriciate any help with that!
This could probably be done after downloading using file plus some other commands, but I'd like to avoid grabbing bad data in the first place - any way to do this? Or alternatives that can do something like that?
Thanks for your input!
PNG files have an 8 byte header which contains the following:
137 A byte with its most significant bit set (``8-bit character'')
80 P
78 N
71 G
13 Carriage-return (CR) character, a.k.a. CTRL-M or ^M
10 Line-feed (LF) character, a.k.a. CTRL-J or ^J
26 CTRL-Z or ^Z
10 Line-feed (LF) character, a.k.a. CTRL-J or ^J
So if you feed the first 8 bytes into od you should see something like this:
$ head -c 8 knox.png | od -c
0000000 211 P N G \r \n 032 \n
I think that gives you the basis of a pretty good test.
I don't think there is any way to limit wget to partially download a file, but you can do it in curl e.g.:
curl -s -r 0-8 "http://www.fnordware.com/superpng/pnggrad8rgb.png" | od -c
0000000 211 P N G \r \n 032 \n \0
0000011
I have problem trying to interpret this line:
5761 6920 4D61 6E0D 0A
Is there anyway to interpret this into a human readable text format?
I'm submitting this as a separate answer as I am going to show how I arrived at it without the aid of an online service, and it is generic to any type of data you have a hex representation of.
You can enter the hexadecimal text into a file like so:
0000000: 5761 6920 4d61 6e0d 0a
You can put 8 groups of 4 hex digits on a line that way. Then you can use the xxd program (available on both UNIX-like and Windows systems and can be installed as part of the standard vi editor).
You can then extract the text or data like so:
xxd -r < sample.txt > sample.data
In this case, it yields this on my system:
mbt#redpepper:~$ cat sample.txt
0000000: 5761 6920 4d61 6e0d 0a
mbt#redpepper:~$ cat sample.data
Wai Man
You should be aware of certain types of non-visible characters, too. You can refer to an ASCII table to determine what they are. Furthermore, if you have an ASCII table handy and know that a given source of hex digits is an encoded stream of ASCII bytes, you can do the translation by hand, though it will take a while.
The text is - Wai Man
decoded as
57 61 69 20 4D 61 6E 0D 0A
W a i M a n \r \n
\r - carriage return
\n - new line
Translated using - http://home2.paulschou.net/tools/xlate/