![]() Gnuplot stats code#Thanks to Maxim Massenkoff for submitting the additional code and figure. Amazon CloudWatch retains metric data as follows: Data. (histogram write if female=0, start(30) width(5) color(green%30)), /// Percentile statistics are not available for metrics when any of the metric values are negative numbers. Twoway (histogram write if female=1, start(30) width(5) color(red%30)) /// So 100% opacity is the same as the original histogram. The higher the opacity, the less transparent the histogram will become. The option color(red%30) makes the female histogram red with 30 percent opacity and color(green%30) makes the male histogram green with 30 percent opacity. Transparency is specified as a color modifier. Now the we can see that females have more density to the right of the graph while the males have more density towards the left side.Īn even better method is to add transparency, which became available as of Stata 15. (histogram write if female=0, start(30) width(5) ///įcolor(none) lcolor(black)), legend(order(1 "Female" 2 "Male" )) The lcolor(black) option sets the line color to black. ![]() The option fcolor(none) sets the fill color to none while So, let’s render the male histogram as transparent rectangles withīlack outlines. That’s a bit better, but parts of the male histogram still block out our view of theįemale histogram. (histogram write if female=0, start(30) width(5)), /// Twoway (histogram write if female=1, start(30) width(5) color(green)) /// Option, which sets both the fill color and line color to green. Let’sĬhange the female histogram color to green. Both histograms were rendered in the same color. (histogram write if female=0, start(30) width(5)) Twoway (histogram write if female=1, start(30) width(5)) /// Let’s load the hsbdemoĭataset and overlay histograms for males and female for the variable write. The script is pretty much self explanatory, the time and interval for stat collection can be changed in the script as per the user requirement, after running this script you will have a folder by name "Stats" which will have *.png images which would be the graphs of the system usage in the past sixty seconds.This sounds like it should be pretty easy. ![]() That is all,memory,network and CPU respectively. The above is attached as a file with this post, the inputs to this script can be a,m,n,c. *) echo "invalid option: $1 " show_help exit 1 #wait #clean # Loop for different options while ] do case " $1 " in #Check for the first input if it's zero show help & show_help & exit 1 Plot=( '"stat.dat"' using 1:11 title '"sent"' with lines, '"stat.dat"' using 1:12 title '"recvd"' with lines ) Plot=( '"stat.dat"' using 1:8 title '"used"' with lines, '"stat.dat"' using 1:9 title '"buff"' with lines, '"stat.dat"' using 1:10 title '"cach"' with lines, '"stat.dat"' using 1:11 title '"free"' with lines ) Plot=( '"stat.dat"' using 1:3 title '"system"' with lines, '"stat.dat"' using 1:2 title '"user"' with lines, '"stat.dat"' using 1:4 title '"idle"' with lines ) Ylabel= '"percent"' # Using an arry presrving the '"quotes"' is very much nessary ![]() Gnuplot << EOF set terminal $fileType set output $output set title $title set xlabel $xlabel set xdata time set ylabel $ylabel set timefmt "%d-%m %H:%M:%S" set format x "%H:%M" plot $ EOF & echo "Please check if you have installed dstat" & exit 1Įxec 2> /dev/null kill $! > /dev/null 2>&1 #!/bin/bash #Author : Hemanth H.M #Licence : GNU GPLv3 # UsageĮcho "Usage is $0 a|m|n|c|h" echo "-a or -all to plot cpu(c),mem(m) and net(n)"Įcho "Collecting stats for 60sec with an interval of 10sec" I have written a small script to plot the performance of the machine considering CPU,Memory and Network into picture. Gnuplot stats how to#This post, is not elaborating on dstat or GNUplot but rather focusing directly on how to plotting performance graph of a GNU/Linux box. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |