[Kst] Real time monitoring

Barth Netterfield netterfield at astro.utoronto.ca
Tue Sep 14 16:35:22 CEST 2004


Ok... here is a way which
	i) seems a bit of a hack
	ii) I haven't actually tried this in this way recently, but is supposed to 
work[**] - if it doesn't work, it is a bug, and we will fix it:

kst supports 'indirect files' which just lists the name of the file you 
currently want to look at.  If you change the content of the indirect file, 
then kst will look to the new file which is being pointed at.  The suffix of 
an indirect file must be '.cur'

So if you have a file called 'data.cur' whose content is 
'/data/rawdir/dataA.dat' then
'kst -x 1 -y 2 -n 100 data.cur' will plot the last 100 lines of 
'/data/rawdir/dataA.dat'
Changing the content of 'data.cur' is supposed to[**] change the data file kst 
is looking at.

**I haven't carefully checked this for race conditions recently... If you have 
problems, report them.

So:
always be writing to two files, dataA.dat and dataB.dat
(Be sure to include a collumn to use as your X axis, like 'time' because 
'INDEX' will be pretty useless.)
At samples 0, 2*N, 4*N...  
	make your indirect file point to 'dataB.dat'
	empty dataA.dat and re-start writing to it
At samples N, 3*N, 5*N... 
	make your indirect file point to 'dataA.dat'
	empty dataB.dat and re-start writing to it.
	
This way you will always have access to at least the last N data samples, will 
be updating real time, and will not accumulate data.

cbn

On September 14, 2004 04:57 am, you wrote:
> My data rate is not too high (400 Byte/sec over all),
> but the data may accumulate over very prolonged time.
> In my setup, everything may work as expected for
> months, but when some alert fires I want to see only
> few thousands of last samples.
> I may push data to kst through named pipe, but I also
> need a way to limit a number of samples stored by kst.
> I also need logging, but I want to log only
> interesting data (immediately preceding and following
> defined events).
>
> --- Barth Netterfield <netterfield at astro.utoronto.ca>
>
> wrote:
> > We've never had to address this problem, since we
> > have always wanted to keep
> > our old data - the logging is the main activity; the
> > viewing is a necessary
> > extra.
> >
> > What is your data rate?
> >
> > We could come up with a data-source which could
> > handle this, but we have never
> > done so.
> >
> > cbn
> >
> > On September 13, 2004 04:21 pm, you wrote:
> > > Greetings.
> > > Indeed, I hoped that kst works like this, but one
> > > question remain - how can I make an application
> >
> > that
> >
> > > forgets sufficiently old data? If, for example, I
> >
> > want
> >
> > > to have only last 10MB of measurements and app may
> >
> > be
> >
> > > running for weeks unattended (temp sensors are
> >
> > quite
> >
> > > slow to produce a data, but it accumulates over
> >
> > time)?
> >
> > > --- Barth Netterfield
> >
> > <netterfield at astro.utoronto.ca>
> >
> > > wrote:
> > > > Hi,
> > > >
> > > > Real time monitoring is one of our primary
> > > > applications :-)
> > > >
> > > > The data needs to be being logged to file which
> >
> > kst
> >
> > > > knows how to read.  ASCII
> > > > columns is probably the easiest to get started,
> >
> > if
> >
> > > > the data rates aren't too
> > > > huge.  There are other binary formats as well if
> >
> > you
> >
> > > > are interested.
> > > >
> > > > Then, use kst to plot the relevant curves,
> >
> > reading
> >
> > > > to the end of the file.
> > > >
> > > > So, for example, to plot cols 2 and 3 of the
> >
> > last
> >
> > > > 500 lines of the data file
> > > > 'data.dat', updated in real time, do
> > > >
> > > > prompt% kst -y 2 -y 3 -n 500 -m 1 data.dat
> > > >
> > > > You can also do this from the UI using the data
> > > > wizard: check 'read to end'.
> > > >
> > > > You can adjust the update rate in
> > > > settings->configure kst.  I think that the
> > > > default in 0.99 is 50ms, which is too fast.  If
> >
> > you
> >
> > > > see strange artifacts,
> > > > slow it down to 1000ms and things will be
> >
> > happier.
> >
> > > > These issues are
> > > > (largely) fixed in CVS.
> > > >
> > > > If you have troubles, let me know, and I can
> >
> > give
> >
> > > > you more detailed
> > > > instructions....
> > > >
> > > > cbn
> > > >
> > > > On September 13, 2004 11:31 am, Alex Dubov
> >
> > wrote:
> > > > > Hello.
> > > > > I wonder, whether there are facilities for
> > > >
> > > > real-time
> > > >
> > > > > data monitoring in kst? It seems that there
> >
> > are
> >
> > > > some
> > > >
> > > > > provisions for data streaming, but
> >
> > documentation
> >
> > > > is
> > > >
> > > > > very unclear.
> > > > > Currently, I have to set-up a temperature
> > > >
> > > > monitoring
> > > >
> > > > > facility with few termometers and I want kst
> >
> > to
> >
> > > > > display running plots of temperature in real
> >
> > time.
> >
> > > > Is
> > > >
> > > > > it currently possible (and how)? If no, what
> >
> > shall
> >
> > > > be
> > > >
> > > > > done to allow it? I have a decent programming
> > > > > background and I can probably implement all
> >
> > needed
> >
> > > > > functionality, but there are no "TODO" items
> >
> > on
> >
> > > > this
> > > >
> > > > > topic and documentation is incomplete.
> > > > > Thus, I decided to ask for your advice before
> > > >
> > > > starting
> > > >
> > > > > the work. Sure enough, I'll submit all my work
> > > >
> > > > back to
> > > >
> > > > > you (if I'll do something).
> > > > >
> > > > > Thanks ahead.
> > > > >
> > > > >
> > > > >
> > > > > __________________________________
> > > > > Do you Yahoo!?
> > > > > New and Improved Yahoo! Mail - Send 10MB
> >
> > messages!
> >
> > > > > http://promotions.yahoo.com/new_mail
> >
> > _______________________________________________
> >
> > > > > Kst mailing list
> > > > > Kst at kde.org
> > > > > https://mail.kde.org/mailman/listinfo/kst
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Read only the mail you want - Yahoo! Mail
> >
> > SpamGuard.
> >
> > > http://promotions.yahoo.com/new_mail
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail is new and improved - Check it out!
> http://promotions.yahoo.com/new_mail



More information about the Kst mailing list