Re: [vpp-dev] vpp checkstyle failures

2020-09-15 Thread Sergey Matov
Hello Andrew. Thanks for quick response.

In a nutshell - yes, gauges are something I am also currently using to
track the number of entries in a bihash table(for example), however gauge
update will be done each time when the stats segment performs processing.
Idea was to track value more rapidly w/o increasing stats update interval.
I thought it worth to have it in upstream code.

On Tue, 15 Sep 2020 at 14:50, Andrew  Yourtchenko 
wrote:

> Hi Sergey,
>
> have a look at 22963; the checkstyle job requires a particular version of
> checkstyle, it’s WIP in progress to update it, as well as to give us an
> option to selectively try out clang-format on some files.
>
> However; I think this functionality of this patch has more fundamental
> question: it allows the use of the function that essentially renders the
> simple counter ambiguous in the way i see it as a user operationally:
>
> If the counter value is 42 - does it mean it was incremented to 10042 and
> then decremented by 1 ? Or was it incremented by 142 and then
> decremented by 100 ?
>
> The only sensible operation for something that is the *counter*, is to
> either increment or reset to zero in my view. You should not be allowed to
> “uncount” stuff.
>
> However, if we are talking about a *gauge*, then it is a different story,
> and I suspect this may be the functionality you are after ?
> Like, the current number of connections tracked somewhere, etc ?
>
> --a
>
> On 15 Sep 2020, at 12:25, Sergey Matov 
> wrote:
>
> 
> Greetings VPP community.
>
> Recently I've created a small patch for counter.h core file.
> For some reason several patchsets are failing with checkstyle issues.
> https://gerrit.fd.io/r/c/vpp/+/28843
> Fixing of the change by indent causes the entire file to be reworked since
> the old file does not fit indent requirements. What is the best way to
> process changes that fit the checkstyle but the original file does not?
> Thanks in advance
>
> --
>
> Sergey Matov
>
> --
>
> t: +49 391 819099-0
>
> --- enabling your networks
> -
>
> Travelping GmbH
> Roentgenstraße 13
> 39108 Magdeburg
> Germany
>
> t: +49 391 819099-0
> f: +49 391 819099-299
>
> e: i...@travelping.com
> w: https://www.travelping.com/
> Company registration: Amtsgericht Stendal
> Managing Director: Holger Winkelmann
> Reg. No.: HRB 10578
> VAT ID: DE236673780
> 
>
>

-- 

Sergey Matov

-- 

t: +49 391 819099-0

--- enabling your networks
-

Travelping GmbH
Roentgenstraße 13
39108 Magdeburg
Germany

t: +49 391 819099-0
f: +49 391 819099-299

e: i...@travelping.com
w: https://www.travelping.com/
Company registration: Amtsgericht Stendal
Managing Director: Holger Winkelmann
Reg. No.: HRB 10578
VAT ID: DE236673780
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17398): https://lists.fd.io/g/vpp-dev/message/17398
Mute This Topic: https://lists.fd.io/mt/76861769/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] vpp checkstyle failures

2020-09-15 Thread Sergey Matov
Greetings VPP community.

Recently I've created a small patch for counter.h core file.
For some reason several patchsets are failing with checkstyle issues.
https://gerrit.fd.io/r/c/vpp/+/28843
Fixing of the change by indent causes the entire file to be reworked since
the old file does not fit indent requirements. What is the best way to
process changes that fit the checkstyle but the original file does not?
Thanks in advance

-- 

Sergey Matov

-- 

t: +49 391 819099-0

--- enabling your networks
-

Travelping GmbH
Roentgenstraße 13
39108 Magdeburg
Germany

t: +49 391 819099-0
f: +49 391 819099-299

e: i...@travelping.com
w: https://www.travelping.com/
Company registration: Amtsgericht Stendal
Managing Director: Holger Winkelmann
Reg. No.: HRB 10578
VAT ID: DE236673780
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17396): https://lists.fd.io/g/vpp-dev/message/17396
Mute This Topic: https://lists.fd.io/mt/76861769/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] vpp checkstyle failures

2020-09-16 Thread Sergey Matov
I've just wanted to avoid the trick of fetching the counter's value and
calling "set" with (value - 1). Extra decrementing method would not be
harmful and can be used only when it's desired.

On Tue, 15 Sep 2020 at 16:02,  wrote:

> Hi Sergey,
>
> > In a nutshell - yes, gauges are something I am also currently using to
> track the number of entries in a bihash table(for example), however gauge
> update will be done each time when the stats segment performs processing.
> Idea was to track value more rapidly w/o increasing stats update interval.
> I thought it worth to have it in upstream code.
>
> There are two types of gauges.
> The one where you register with the stats segment, where the stats process
> periodically calls the registered function, inquiring the state of the
> gauge.
> The other where the client code itself manipulates the gauge directly,
> just like it does for other counters.
>
> For the latter case, can you not use vlib_set_simple_counter() directly?
>
> Just wondering what a "decrementing" counter (or gauge) would mean??
>
> Best regards,
> Ole
>
>

-- 

Sergey Matov

-- 

t: +49 391 819099-0

--- enabling your networks
-

Travelping GmbH
Roentgenstraße 13
39108 Magdeburg
Germany

t: +49 391 819099-0
f: +49 391 819099-299

e: i...@travelping.com
w: https://www.travelping.com/
Company registration: Amtsgericht Stendal
Managing Director: Holger Winkelmann
Reg. No.: HRB 10578
VAT ID: DE236673780
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17420): https://lists.fd.io/g/vpp-dev/message/17420
Mute This Topic: https://lists.fd.io/mt/76861769/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-