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

Mahesh Jethanandani <mjethanandani@gmail.com> Thu, 05 March 2015 16:57 UTC

Return-Path: <mjethanandani@gmail.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 9ED931A1A25 for <rtg-yang-coord@ietfa.amsl.com>; Thu, 5 Mar 2015 08:57:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 9Plxtiikt6Ns for <rtg-yang-coord@ietfa.amsl.com>; Thu, 5 Mar 2015 08:57:33 -0800 (PST)
Received: from mail-qa0-x22d.google.com (mail-qa0-x22d.google.com [IPv6:2607:f8b0:400d:c00::22d]) (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 8A8E21A010F for <rtg-yang-coord@ietf.org>; Thu, 5 Mar 2015 08:57:33 -0800 (PST)
Received: by mail-qa0-f45.google.com with SMTP id x12so8465237qac.4 for <rtg-yang-coord@ietf.org>; Thu, 05 Mar 2015 08:57:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=vqsT+rVq1EKsuzoboZAbGmEn4RapAYFfgm/1dkB8WyA=; b=LCWP+L4PfYeGTkxQ7LRsHcBa4bk0XPsDEcudvFlwIQQbSk6fRc4K2GTgYGouExYEJ6 nwcL7ZbVfw2kwves43YRi2LBJavPpOuhlCS0xi79mTrwKa3Gj4kKKhsQZObSwS72ba7I C3lwtMA19TodszCjKtCzNqd4XbmcagNVtD+LJEllGfPftRD2mhVJ2p3JE6NtqbaOOett yzRXbaeKnoEskN3voAbjWGLIK4N2Cuhrc7Yuf9XdnsqA173bXNZ/fb+ufEA3kb572zM1 gNqpKzoib4mxcjJZPzFHkJ5JyrvK7Ma1VOZCzmhIxZY7hb9f2GtyUtADtznowlJXhF6P rUJA==
X-Received: by 10.140.165.198 with SMTP id l189mr13908164qhl.93.1425574652786; Thu, 05 Mar 2015 08:57:32 -0800 (PST)
Received: from [192.168.1.133] (108-247-127-76.lightspeed.sntcca.sbcglobal.net. [108.247.127.76]) by mx.google.com with ESMTPSA id u32sm4096753qgd.46.2015.03.05.08.57.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Mar 2015 08:57:31 -0800 (PST)
Content-Type: multipart/alternative; boundary="Apple-Mail=_CE19673A-3623-4D06-BB4C-59207A3E6ECA"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\))
From: Mahesh Jethanandani <mjethanandani@gmail.com>
In-Reply-To: <D298E714-0D5E-44C4-893B-C9513F984A74@gmail.com>
Date: Thu, 05 Mar 2015 08:57:29 -0800
Message-Id: <5CE9485F-F7F1-4B93-8E00-D1114560B40B@gmail.com>
References: <730D50D3-0220-42BA-8DD0-40A10D9C2DA3@gmail.com> <0ba001d05732$8f380960$ada81c20$@ndzh.com> <D298E714-0D5E-44C4-893B-C9513F984A74@gmail.com>
To: Susan Hares <shares@ndzh.com>
X-Mailer: Apple Mail (2.2070.6)
Archived-At: <http://mailarchive.ietf.org/arch/msg/rtg-yang-coord/FbTE4nqhVBSZcwZS-dy8BtGCYUw>
Cc: rtg-yang-coord@ietf.org
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 16:57:36 -0000

Susan,

BTW, another great example on use of containers can be found in the BGP YANG module here <https://tools.ietf.org/html/draft-zhdankin-idr-bgp-cfg-00>.

With some clever use of containers, like bgp-neighbors and within it, bgp-neighbor-state or bhp-neighbor-statistics, you can drill down into the specific config, state or counters you would be interested in configuring/finding/purging.

Cheers.


> On Mar 5, 2015, at 8:06 AM, Mahesh Jethanandani <mjethanandani@gmail.com> 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
> 
> 
> 
> 
> 

Mahesh Jethanandani
mjethanandani@gmail.com