The output of my graph from rrdtool is blank. Why? - rrdtool

I'm wanting to graph the memory of certain processes in windows using rrdtool which I can then show in a simple webpage.
So I got this far. Not quite sure I understand how it works after following some tutorials I get blank output.
rrdtool create psrvr-mem.rrd --start 1023654125 --step 300 DS:mem:GAUGE:600:0:U RRA:AVERAGE:0.5:12:24 RRA:AVERAGE:0.5:288:31
Update script.
#ECHO OFF
:LOOP
FOR /F "tokens=*" %%g IN ('powershell "get-process psrvr | select -ExpandProperty PrivateMemorySize"') do (SET mem_usage=%%g)
rrdtool update psrvr-mem.rrd N:%mem_usage%
TIMEOUT /t 300
GOTO LOOP
And finally the graph
rrdtool graph memory.png --start -1800 -a PNG -t "Memory" --vertical-label "" -w 1260 -h 400 -r DEF:mem=psrvr-mem.rrd:mem:AVERAGE AREA:mem#FF0000
Unfortunately, the result is an empty graph. Not sure why. And not quite understanding if the start time is particularly critical or not.
-- edit --
Still not creating lines on the graph.
However, well I found one problem is there were no labels on any axis. Because the font file was missing. Turns out the pre-compiled binaries downloaded from rrdtool website are 15 years out of date for windows. I found a newer binary but if I get this going then I'll probably try and compile it with the latest revision. For now, I'll settle with something that seems to be working better from 2013.
After more messing about this is my attempt at creating a 5 minute average.
rrdtool create psrvr-mem.rrd --start 1592774026 --step 60 DS:mem:GAUGE:120:0:U RRA:AVERAGE:0.5:1:5
Then fill with some values using the update script above.
And then try to graph it again.
rrdtool graph memory.png --start=now-300 -a PNG -t "Memory" --vertical-label "Bytes" -w 800 -h 300 -r DEF:mem=psrvr.rrd:mem:AVERAGE LINE:mem#FF0000
The output is a graph where the line isn't moving. It might be zero all the way.

Related

Multiple iterations in the htmlextra report with newman

I am fairly new to using newman and I am trying to figure out how exactly to create multiple iterations within one report.
I cannot find the htmlextra.js file anywhere locally on my laptop (Win 10) to just change that field stated on: https://hub.docker.com/r/dannydainton/htmlextra
image
Can anyone please help me out on how to add more than 1 iteration to a collection for the reporter?
Thank you very much and sorry to bother you all with this basic question, but I just cannot figure it out.
Iteration is set through newman and not htmlextra report , you can add iteration count through -n flag.
newman run collection.json -n 5 -r htmlextra
This will run collection 5 times
https://www.npmjs.com/package/newman will show all newman specific flag and
https://www.npmjs.com/package/newman-reporter-htmlextra shows all htmlextra specific flags
-n , --iteration-count Specifies the number of times the collection has to be run when used in conjunction with iteration
data file.

rrdtool displays other values as entered

Can anybody explain to me why I get different values when I fetch from my rrd-db than what I filled it with.
Here are the commands:
a. Create database
rrdtool create temperature.rrd --step 300 -b 1374150100 \
DS:temp:GAUGE:300:N:N \
RRA:AVERAGE:0:1:5
b. Fill with data
rrdtool update temperature.rrd \
1374150400:6 \
1374150700:8 \
1374151000:4 \
1374151300:4
c. Fetch data
rrdtool fetch temperature.rrd AVERAGE --start 1374150099 --end 1374151301
Output:
temp
1374150300: 6.0000000000e+00
1374150600: 7.3333333333e+00
1374150900: 5.3333333333e+00
1374151200: 4.0000000000e+00
1374151500: -nan
I fill the database in the exact period with data. I have no idea why it displays 7.3 and 5.3?!
Did I missed something?
OK, I got it. The problem is, that the start time does not fit to the step interval. As you can see in the output, the steps begin with ...300, then ...600 and so on. I filled the data with ...400, ...700 etc.
So the solution is to set the values in the correct step interval and then it works

RRDTool database definition and plotting the data -I need a second opinion

Here is what I am trying to achieve:
I read my data once a day (the exact time of the day is not very important).
I want to archive the values for this DS for two years back.
I need to be able to look back for 2 years and I need the value for every day
and I also need to see the weekly average
If I miss a reading for two consecutive days the data should be declared unknown
Here is what I am using for this:
rrdtool create Carsforsale.rrd --start 20130217 --step 86400 ^
DS:MidsizeCars:GAUGE:172800:U:U ^
DS:FullSizeCars:GAUGE:172800:U:U ^
RRA:AVERAGE:0:7:104^
RRA:LAST:0:7:1:720
I updated the above database with
rrdtool update Carsforsale.rrd 1361203200:554:791
rrdtool update Carsforsale.rrd 1361289600:556:795
The updated correspond to yesterday and the day before yesterday (18, 19 Feb)
I tried to plot the graphs for the above using this
rrdtool graph "Inventory.png" \
--start "20130217" \
--imgformat PNG --width 850 --height 400 \
DEF:MidsizeCars=Carsforsale.rrd:MidsizeCars:AVERAGE \
DEF:FullSizeCars=Carsforsale.rrd:FullSizeCars:AVERAGE \
AREA:MidsizeCars#0000FF:"MidsizeCars" \
AREA:FullSizeCars#FF004D:"FullSizeCars:STACK"'
And now here are the my questions:
are the step and the heart beat defined correctly for what I wantto do ?
Why are my graphs empty ?
Looking into the database with the freeware utility called RRD Editor I could see that the last values are stored in the MidSizeCars and FullSizecars but the only DS that contains a history of what has been loaded into the database is the archiving function LAST Am I supposed to plot LAST or Average to see the current values ?
Thanks
C
since you want to keep the data for two years at 1 day resolution, you have to setup an appropriate RRA for this purpose ... since this will only be about 730 values, I would not bother with setting up an extra consolidated RRA for the week. this will get calculated on the fly ...

how to ignore list of attributes using the command line while clustering in weka?

I am running a series of clustering analyses in weka and I have realized that automatizing it is the way to go if I want to get somewhere. I'll explain a bit how I am working.
I do all the pre-processing manually in R and save it as a csv file, importing it in weka and saving it again as an arff file.
I use weka's GUI, and in general I just open my data with in the arff file and go directly to the clustering tab and play around. (My experience using the CLI is limited).
I am trying to reproduce some results I've got by using the GUI, but now with commands in the CLI. The problem is that I usually ignore a list of attributes when clustering using the GUI. I cannot find a way of selecting a list of attributes to be ignored in the command line.
For example:
java weka.clusterers.XMeans \
-I 10 -M 1000 -J 1000 \
-L 2 -H 9 -B 1.0 -C 0.25 \
-D "weka.core.MinkowskiDistance -R first-last" -S 10 \
-t "/home/pedrosaurio/bigtable.arff"
My experience with weka is limited so I don't know if I am missing some basic understanding of how it works.
Data Preprocessing functions are called filters.
You need to use filters together with cluster algorithm.
See below example.
java weka.clusterers.FilteredClusterer \
-F weka.filters.unsupervised.attribute.Remove -V -R 1,5 \
-W weka.clusterers.XMeans -I 10 -M 1000 -J 1000 -L 2 -H 9 -B 1.0 -C 0.25 \
-D "weka.core.MinkowskiDistance -R first-last" -S 10 \
-t "/home/pedrosaurio/bigtable.arff"
Here we remove attributes 1-5 then use xmeans.
To ignore an attribute you have to do it from the distance function
Ignore attributes from command line (Matlab):
COLUMNS = '3-last'; % The indices start from 1, 'first' and 'last' are valid as well. E.g .: first-3,5,6-last
Df = weka.core.EuclideanDistance (); % Setup distance function.
Df.setAttributeIndices (COLUMNS); % Setup distance function.
Ignore attributes from GUI
Ignore attributes from GUI
I do not understand why when someone asks how to ignore attributes all the answers say how to modify the dataset, using a filter in the preprocess section.

rrdtool graph slightly different graph

First I will say that even after setting up a system where I register the each minute total of http responses (200, 301, 302, etc) and I'm able to know how is going on the performance speaking about users, it happens to me that my boss is getting me mad with something that i thing it is related with rrd internals, but supossedly i must solve that.
What I do with the rrdtool?:
After a minute (60 seconds) summarizing different http responses i insert the value with the time stamp into the rrd database.
This is the rrd file definition:
/usr/bin/rrdtool create file.rrd --start $_[7]-60 --step 60 DS:200:GAUGE:120:U:U DS:300:GAUGE:120:U:U DS:400:GAUGE:120:U:U DS:404:GAUGE:120:U:U DS:500:GAUGE:120:U:U DS:502:GAUGE:120:U:U DS:504:GAUGE:120:U:U RRA:AVERAGE:0.5:1:43200
As you can see in the RRA i save 43200 which means two week saving 60 seconds values.
The problem it comes when i draw, this is the command I use to draw the graph of the last 6 hours (Where $start is the start time, $time the end time and $rrd the rrd file)
{/usr/bin/rrdtool graph last6hours.png --units=si --alt-y-grid --start $start --end $time -o -S 60 --width 600 --height 200 --imgformat PNG DEF:200=$rrd:200:AVERAGE LINE1:200#006666:"200" DEF:300=$rrd:300:AVERAGE LINE1:300#FF00CC:\"301+302\" DEF:400=$rrd:400:AVERAGE LINE1:400#000000:\"400\" DEF:404=$rrd:404:AVERAGE LINE1:404#6666CC:\"404\" DEF:500=$rrd:500:AVERAGE LINE1:500#00FF66:\"500\" DEF:502=$rrd:502:AVERAGE LINE1:502#FF0000:\"502\" DEF:504=$rrd:504:AVERAGE LINE1:504#FF9900:\"504\";}
And this is the one I use to draw the las 12 hours:
{/usr/bin/rrdtool graph last12hours.png --units=si --alt-y-grid --start $start --end $time -o -S 60 --width 600 --height 200 --imgformat PNG DEF:200=$rrd:200:AVERAGE LINE1:200#006666:"200" DEF:300=$rrd:300:AVERAGE LINE1:300#FF00CC:\"301+302\" DEF:400=$rrd:400:AVERAGE LINE1:400#000000:\"400\" DEF:404=$rrd:404:AVERAGE LINE1:404#6666CC:\"404\" DEF:500=$rrd:500:AVERAGE LINE1:500#00FF66:\"500\" DEF:502=$rrd:502:AVERAGE LINE1:502#FF0000:\"502\" DEF:504=$rrd:504:AVERAGE LINE1:504#FF9900:\"504\";}
And now please look at the draws and see that into the first graph inside the red circle there's a descend of the responses 200 until 0, but into the graph of the last 12 hours the same descend it does not go until 0, so my boss is pressing me saying that the data is not real when it is, but the worst if that i know is real and is about rrdtool internals, but I doon't know how to solve it.
Any subjestion please?
this change is due to the fact that rrdtool is consolidating data, adapting it to the resolution of the chart you are drawing. Your initial chart shows high resolution data while the second chart covers a wider time range and thus shows several data points wrapped into one. consider the following:
original: 10,10,10,0,10,10
consolidated 2 to 1: 10,5,10
If you want to preserve extremes, you should setup a MIN and MAX RRA and use that for charting the extremes.
hth
tobi