Home » Eclipse Projects » Rich Client Platform (RCP) » MessageConsole: Good watermarks values
MessageConsole: Good watermarks values [message #464058] |
Fri, 23 February 2007 05:21  |
Eclipse User |
|
|
|
Hello,
I've made a view that displays a MessageConsole. It is now working pretty well.
There is however one point where I'd be very interested in having your opinions.
What do you think are good values to set to the high and low watermarks? Since my
console may have quite a lot of lines to display, at a rather fast pace, how to set
the watermarks so that it does not slow the console too much, and does not create a
huge need of memory?
Thanks for your answers,
Sébastien
|
|
| |
Re: MessageConsole: Good watermarks values [message #464066 is a reply to message #464064] |
Fri, 23 February 2007 08:27   |
Eclipse User |
|
|
|
Hello Peter,
Thanks for your answer :)
When using the MessageConsole class, there's a setWaterMarks() method that takes
two ints. Actually, this method is in the IOConsole class.
The javadoc says:
Sets the text buffer size for this console. The high water mark indicates
the maximum number of characters stored in the buffer. The low water mark
indicates the number of characters remaining in the buffer when the high
water mark is exceeded.
By reading this, I thought that I could tell my console to fill until a certain bound
is reached, and then to flush the older lines and only keep a certain amount of
lines/chars. Did I misunderstand these lines?
If you have any better idea to allow me to keep only a certain amount of info in my
console, I'd be very interested :)
About the output stream, I use the MessageConsoleStream, that can be retrieved by
calling the newMessageStream() method on a MessageConsole object. Should I use
something else? I thought that the stream provided by the console was buffered.
One last question: I'd like my console to scroll automatically, and always show the
last lines added. At the moment, it does not scroll at all, staying all the way up
when information is added at the bottom. Could you give me a few hints to do that?
Thanks again for your help :)
Sébastien
Peter Osipov wrote:
> Hello!
> To be honest with you, I do not fully understand what watermarks have to
> do with the MessageConsole. :-(
> Maybe you should filter somehow the output and make it configurable, so
> that the use could decide what to output and what to miss? Or make the
> output stream buffered at least.
> Sebastien Pennec wrote:
>> Hello,
>>
>> I've made a view that displays a MessageConsole. It is now working
>> pretty well.
>>
>> There is however one point where I'd be very interested in having your
>> opinions.
>>
>> What do you think are good values to set to the high and low
>> watermarks? Since my console may have quite a lot of lines to display,
>> at a rather fast pace, how to set the watermarks so that it does not
>> slow the console too much, and does not create a huge need of memory?
>>
>> Thanks for your answers,
>>
>> Sébastien
|
|
|
Re: MessageConsole: Good watermarks values [message #464071 is a reply to message #464066] |
Fri, 23 February 2007 09:28   |
Eclipse User |
|
|
|
Originally posted by: peter_ossipov.mail.ru
Hello Sebastien.
Well, concerning the two ints you have to put there, I do not think
anybody is able to tell you what are the magic values. It is an
optimization problem generally speaking. So, without knowing how
intensive your flow is, it is impossible to come up with any numbers.
Probably, the best way to determine those ints is to experiment and see
what is going on with different values of ints.
For example, if you know that your flow is 8000 characters/ sec, then,
probably you should put something like 8000 like the limit. I guess
there is no other way to find out that limit.
Regarding the scrolling, I can think about it, but right now I cannot
think of anything from the top of my head.
Sebastien Pennec wrote:
> Hello Peter,
>
> Thanks for your answer :)
>
> When using the MessageConsole class, there's a setWaterMarks() method
> that takes
> two ints. Actually, this method is in the IOConsole class.
>
> The javadoc says:
> Sets the text buffer size for this console. The high water mark indicates
> the maximum number of characters stored in the buffer. The low water mark
> indicates the number of characters remaining in the buffer when the high
> water mark is exceeded.
>
> By reading this, I thought that I could tell my console to fill until
> a certain bound is reached, and then to flush the older lines and only
> keep a certain amount of lines/chars. Did I misunderstand these lines?
>
> If you have any better idea to allow me to keep only a certain amount
> of info in my console, I'd be very interested :)
>
> About the output stream, I use the MessageConsoleStream, that can be
> retrieved by calling the newMessageStream() method on a MessageConsole
> object. Should I use something else? I thought that the stream
> provided by the console was buffered.
>
> One last question: I'd like my console to scroll automatically, and
> always show the last lines added. At the moment, it does not scroll at
> all, staying all the way up when information is added at the bottom.
> Could you give me a few hints to do that?
>
> Thanks again for your help :)
>
> Sébastien
>
>
> Peter Osipov wrote:
>> Hello!
>> To be honest with you, I do not fully understand what watermarks have
>> to do with the MessageConsole. :-(
>> Maybe you should filter somehow the output and make it configurable,
>> so that the use could decide what to output and what to miss? Or make
>> the output stream buffered at least.
>> Sebastien Pennec wrote:
>>> Hello,
>>>
>>> I've made a view that displays a MessageConsole. It is now working
>>> pretty well.
>>>
>>> There is however one point where I'd be very interested in having
>>> your opinions.
>>>
>>> What do you think are good values to set to the high and low
>>> watermarks? Since my console may have quite a lot of lines to
>>> display, at a rather fast pace, how to set the watermarks so that it
>>> does not slow the console too much, and does not create a huge need
>>> of memory?
>>>
>>> Thanks for your answers,
>>>
>>> Sébastien
|
|
|
Re: MessageConsole: Good watermarks values [message #464072 is a reply to message #464071] |
Fri, 23 February 2007 09:43  |
Eclipse User |
|
|
|
Hello Peter,
I've solved the autoscroll problem by adding a WorkbenchJob that modifies the text
widget's top index. It works like a charm :)
Thanks for the advice on the watermarks. I'll run several tests to find what are the
best values to put there. I guess that these may also be defined by the user, since
the original eclipse console provides such a possibility in its preferences panel.
Sébastien
Peter Osipov wrote:
> Hello Sebastien.
> Well, concerning the two ints you have to put there, I do not think
> anybody is able to tell you what are the magic values. It is an
> optimization problem generally speaking. So, without knowing how
> intensive your flow is, it is impossible to come up with any numbers.
> Probably, the best way to determine those ints is to experiment and see
> what is going on with different values of ints.
> For example, if you know that your flow is 8000 characters/ sec, then,
> probably you should put something like 8000 like the limit. I guess
> there is no other way to find out that limit.
> Regarding the scrolling, I can think about it, but right now I cannot
> think of anything from the top of my head.
> Sebastien Pennec wrote:
>> Hello Peter,
>>
>> Thanks for your answer :)
>>
>> When using the MessageConsole class, there's a setWaterMarks() method
>> that takes
>> two ints. Actually, this method is in the IOConsole class.
>>
>> The javadoc says:
>> Sets the text buffer size for this console. The high water mark indicates
>> the maximum number of characters stored in the buffer. The low water mark
>> indicates the number of characters remaining in the buffer when the high
>> water mark is exceeded.
>>
>> By reading this, I thought that I could tell my console to fill until
>> a certain bound is reached, and then to flush the older lines and only
>> keep a certain amount of lines/chars. Did I misunderstand these lines?
>>
>> If you have any better idea to allow me to keep only a certain amount
>> of info in my console, I'd be very interested :)
>>
>> About the output stream, I use the MessageConsoleStream, that can be
>> retrieved by calling the newMessageStream() method on a MessageConsole
>> object. Should I use something else? I thought that the stream
>> provided by the console was buffered.
>>
>> One last question: I'd like my console to scroll automatically, and
>> always show the last lines added. At the moment, it does not scroll at
>> all, staying all the way up when information is added at the bottom.
>> Could you give me a few hints to do that?
>>
>> Thanks again for your help :)
>>
>> Sébastien
>>
>>
>> Peter Osipov wrote:
>>> Hello!
>>> To be honest with you, I do not fully understand what watermarks have
>>> to do with the MessageConsole. :-(
>>> Maybe you should filter somehow the output and make it configurable,
>>> so that the use could decide what to output and what to miss? Or make
>>> the output stream buffered at least.
>>> Sebastien Pennec wrote:
>>>> Hello,
>>>>
>>>> I've made a view that displays a MessageConsole. It is now working
>>>> pretty well.
>>>>
>>>> There is however one point where I'd be very interested in having
>>>> your opinions.
>>>>
>>>> What do you think are good values to set to the high and low
>>>> watermarks? Since my console may have quite a lot of lines to
>>>> display, at a rather fast pace, how to set the watermarks so that it
>>>> does not slow the console too much, and does not create a huge need
>>>> of memory?
>>>>
>>>> Thanks for your answers,
>>>>
>>>> Sébastien
|
|
|
Goto Forum:
Current Time: Tue Mar 25 17:41:45 EDT 2025
Powered by FUDForum. Page generated in 0.03985 seconds
|