Re: [Rtg-yang-coord] Clearing all stats in a container

Andy Bierman <andy@yumaworks.com> Thu, 05 March 2015 17:23 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: rtg-yang-coord@ietfa.amsl.com
Delivered-To: rtg-yang-coord@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B44561A1B8B for <rtg-yang-coord@ietfa.amsl.com>; Thu, 5 Mar 2015 09:23:03 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.979
X-Spam-Level:
X-Spam-Status: No, score=-1.979 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ym1rF5s4LskV for <rtg-yang-coord@ietfa.amsl.com>; Thu, 5 Mar 2015 09:23:02 -0800 (PST)
Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3104F1A1A22 for <rtg-yang-coord@ietf.org>; Thu, 5 Mar 2015 09:16:54 -0800 (PST)
Received: by labgd6 with SMTP id gd6so5868305lab.3 for <rtg-yang-coord@ietf.org>; Thu, 05 Mar 2015 09:16:52 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=8SUHc7D5FCbG8h4tcELIsxWhEIMWVkToukmBCXXb5IQ=; b=lLFaQvwX5S+Rqt1mdpzXW7sMY1J4VGp9+grr334uLjejTaWs9EV0Rh1tuSkcpOt8Jq 5W5hOO0Qot+/JmajUR/psdyu3XX5M0D6b7lkutgVK3VI5alGU7777IOcpdyq6Md6B/cb RNZ/QTnkd0M5WdxUHEl6/aIn580/tK63aoPU5SB5WPxEioH2UKB0aK3FVRLPepcXz5oP PowuxYeuRJHVwFQsCouPRgt5yOLMWaCWBUgXkghcn4TLcl8frdc58lOV2dDqndxbZDhD akNrwNk65YCoOyiqQhhZL9velLzLdHtym/d2AD1h7DILyQlBFoppuddPuPJmliqvU118 cl3Q==
X-Gm-Message-State: ALoCoQmy8eWg2XNjWCOgCadS6WI0mskNzy3w/Yx8WdKfMIT3j0yzHkIA1yswIkvg5BYTTVGVpp2Z
MIME-Version: 1.0
X-Received: by 10.112.42.164 with SMTP id p4mr2853015lbl.119.1425575812626; Thu, 05 Mar 2015 09:16:52 -0800 (PST)
Received: by 10.112.144.36 with HTTP; Thu, 5 Mar 2015 09:16:52 -0800 (PST)
In-Reply-To: <20150305161550.GA71013@elstar.local>
References: <730D50D3-0220-42BA-8DD0-40A10D9C2DA3@gmail.com> <0ba001d05732$8f380960$ada81c20$@ndzh.com> <28490742-3E0B-45D5-8B36-518701F98FB7@gmail.com> <20150305161550.GA71013@elstar.local>
Date: Thu, 5 Mar 2015 09:16:52 -0800
Message-ID: <CABCOCHRuyxshrh5G7sLPV3YqDHAir1XFFG0tV4cnH2f5S21F=w@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, Mahesh Jethanandani <mjethanandani@gmail.com>, Susan Hares <shares@ndzh.com>, "rtg-yang-coord@ietf.org" <rtg-yang-coord@ietf.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Archived-At: <http://mailarchive.ietf.org/arch/msg/rtg-yang-coord/Ii96jOfwjiE46HkH7newjOjeHWc>
Subject: Re: [Rtg-yang-coord] Clearing all stats in a container
X-BeenThere: rtg-yang-coord@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "\"List to discuss coordination between the Routing related YANG models\"" <rtg-yang-coord.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtg-yang-coord>, <mailto:rtg-yang-coord-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rtg-yang-coord/>
List-Post: <mailto:rtg-yang-coord@ietf.org>
List-Help: <mailto:rtg-yang-coord-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtg-yang-coord>, <mailto:rtg-yang-coord-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Mar 2015 17:23:03 -0000

On Thu, Mar 5, 2015 at 8:15 AM, Juergen Schoenwaelder
<j.schoenwaelder@jacobs-university.de> wrote:
> Hi,
>
> it was generally found useful when we did the interfaces and ip YANG
> models to properly separate config data from state data. And this is
> not just counters, it could include other things where operational
> state can be different from the configured state.
>

IMO this practice should only be used when there is a possibility
that the state can exist independently of the config.
There are costs (complexity of syncing 2 lists, memory costs
replicating data structures and keys) to be considered.


> /js

Andy

>
> On Thu, Mar 05, 2015 at 08:07:02AM -0800, Mahesh Jethanandani wrote:
>> Susan,
>>
>> Here is an relevant example (I have deleted description fields for brevity) from ietf-interface YANG module of how one could maintain statistics in a module. One reason to keep them in a container of their own is to be able to perform bulk operations on them. Of course, as Juergen pointed out, clearing stats may not be one of them. But if you wanted to say <get> all the stats on a particular module, you would do a <get> on the container i.e. statistics in this example, and you would have all the stats.
>>
>> container interfaces-state {
>>     config false;
>>
>> <snip>
>>
>>     container statistics {
>>         description
>>           "A collection of interface-related statistics objects.";
>>
>>         leaf discontinuity-time {
>>           type yang:date-and-time;
>>           mandatory true;
>>         }
>>
>>         leaf in-octets {
>>           type yang:counter64;
>>         }
>>
>>         leaf in-unicast-pkts {
>>           type yang:counter64;
>>        }
>>
>>         leaf in-broadcast-pkts {
>>           type yang:counter64;
>>        }
>>
>>        <snip>
>>
>>         }
>>       }
>> }
>>
>> HTH.
>>
>> > On Mar 5, 2015, at 2:53 AM, Susan Hares <shares@ndzh.com> wrote:
>> >
>> > Mahesh:
>> >
>> > Would you post an example of how to put statistic counters into a container.  We have multiple drafts in I2RS that provide such counters.  I will forward your advice to all authors so they can modify their yang modules to match the appropriate form.
>> >
>> > Sue
>> >
>> > From: Rtg-yang-coord [mailto:rtg-yang-coord-bounces@ietf.org] On Behalf Of Mahesh Jethanandani
>> > Sent: Thursday, March 05, 2015 1:31 AM
>> > To: rtg-yang-coord@ietf.org
>> > Subject: [Rtg-yang-coord] Clearing all stats in a container
>> >
>> > Assuming one has defined stat counters in one container, like ietf-interfaces has done with its statistics, does anyone have suggestions on how one can essentially clear (reset to 0) all the counters in that container.
>> >
>> > Mahesh Jethanandani
>> > mjethanandani@gmail.com <mailto:mjethanandani@gmail.com>
>> Mahesh Jethanandani
>> mjethanandani@gmail.com
>>
>>
>>
>>
>>
>
>> _______________________________________________
>> Rtg-yang-coord mailing list
>> Rtg-yang-coord@ietf.org
>> https://www.ietf.org/mailman/listinfo/rtg-yang-coord
>
>
> --
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>
>
> _______________________________________________
> Rtg-yang-coord mailing list
> Rtg-yang-coord@ietf.org
> https://www.ietf.org/mailman/listinfo/rtg-yang-coord