From owner-freebsd-fs@freebsd.org Tue Feb 20 20:24:57 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 706C8F280B5 for ; Tue, 20 Feb 2018 20:24:57 +0000 (UTC) (envelope-from eborisch@gmail.com) Received: from mail-wr0-x22f.google.com (mail-wr0-x22f.google.com [IPv6:2a00:1450:400c:c0c::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAB286BDC2 for ; Tue, 20 Feb 2018 20:24:56 +0000 (UTC) (envelope-from eborisch@gmail.com) Received: by mail-wr0-x22f.google.com with SMTP id f14so13565998wre.8 for ; Tue, 20 Feb 2018 12:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hxc9D/f4gTgyJHIB+DbmYcN9fL2AR4By4de3Zmbgjr8=; b=nelTdaob4FYtdjrbBLTAi1Ee1NAoVehbnVSqP68CQXc+6Ow8FpD0Pb23IaX3KEWmKs 1c2NlW2Dxwyqiz9sWAeOSRBXQf1MN7JxKZzkMKT6m1oBOJF0vtqcXbxUE7sNPQvmCvij czAC6COz5ZMWhIBxGWSFx3oXNdmBH1Xl+beR5ERmXBT4wUr1iVyJTIPu1kIH10xSnVIa bW+EGk+8RZZXIGKDM4VOSLhBg+NcNkcDrqKZTPip1D3EtnXijgLzA7sRU6z928/Ibx1O FQ46oZ7QMMnSEkD4IHxWjEUQ55Bp3c9qP/59k6/gwHSKd9275Zg/XTFDsySjAcXnX6vl S3kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hxc9D/f4gTgyJHIB+DbmYcN9fL2AR4By4de3Zmbgjr8=; b=psyV0iWqjqlg3ZTabbbXucnYtrYcAVGUloSpP0qj18XooWtEexGtSsO0Yo1gcxyp+p fY297rFvDd7nOp7mD3oo04iqzjl2Zm8YAel00tAO7xyAobE7tn/4g0CGo29nC++QQ7EU kJX8J1lcVHibRTcwMFBHDNa73oqxflwqCMAkjEP69qoVq79StmVdqfJrucoRqe8XRkfs CEPt3v41EmYtItTs3+2CK6bDY1DLG5ZF1vyRMSMuAUBbFPZshF1rElfJBSMBQBB3rl7+ wcgjvCRLEI5PA9F5Y6D5R70RE8sgX6TggdST8sDqBEZH4o9JYFPAdYQiOMzkFVEDl3uw CxzQ== X-Gm-Message-State: APf1xPCrAcWUzw3v8ZJsXKtwLcFTVNfRQdXm1FIpKvzPzezfK9o0vFXm KkUTbjNbMGAwlrTXnd5d7TVkWyT1yO50l2ngoP78JI2D X-Google-Smtp-Source: AH8x226GDY8ePre2YUXngw/mA8EnxzMka3Q/zLSKu+Sg4eUhxOtlnzNZWtBMOOGKK0iDnWGiRtLkhASf1vqwWU0P/Ng= X-Received: by 10.223.166.135 with SMTP id t7mr775196wrc.260.1519158295254; Tue, 20 Feb 2018 12:24:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.124.20 with HTTP; Tue, 20 Feb 2018 12:24:54 -0800 (PST) In-Reply-To: References: From: "Eric A. Borisch" Date: Tue, 20 Feb 2018 14:24:54 -0600 Message-ID: Subject: Re: raw filesystem counters To: "E.S. Rosenberg" Cc: freebsd-fs@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Feb 2018 20:24:57 -0000 On Tue, Feb 13, 2018 at 1:56 PM, E.S. Rosenberg wrote: > Wow Eric that is exactly what I was looking for! > Thanks! > Nothing similar exists for ZFS correct? > Thanks again, > Eli Here's a quick patch to zpool that adds a "raw" mode when ZPOOL_RAW_STATS is set (to anything) in the environment. Outputs are not averaged by time, so the first output has absolute counters from boot, and subsequent (if provided an interval, eg zpool iostat 5) *are not* averaged over the period. You could certainly average for interval but not initial; I just chose to remove all averaging. https://gist.github.com/eborisch/c610c55cd974b9d4070c2811cc04cd8f Could also be implemented as a -p (parsable) flag to zpool iostat, but this was less intrusive to code up. On my system (with the above patch): $ zpool iostat capacity operations bandwidth pool alloc free read write read write ---------- ----- ----- ----- ----- ----- ----- system 67.2G 13.8G 9 51 159K 879K tome 2.94T 697G 19 34 949K 645K ---------- ----- ----- ----- ----- ----- ----- $ ZPOOL_RAW_STATS=1 zpool iostat pool/dev,alloc,free,rops,wops,rbytes,wbytes system,72199012352,14774075392,42138123,228011166,717996265472,3978917265408 tome,3237433278464,748296372224,87257557,150639839,4293053411328,2918490030080 $ ZPOOL_RAW_STATS=1 zpool iostat -v pool/dev,alloc,free,rops,wops,rbytes,wbytes system,72200007680,14773080064,42138142,228019481,717997350912,3979089575936 ::gpt/system,72200007680,14773080064,42138142,228019481,717997350912,3979089575936 tome,3237679747072,748049903616,87257714,150656638,4293054717952,2918798745600 ::mirror,3237679747072,748049903616,87257682,146824479,4293052755968,2461179686912 ::::diskid/DISK-NNNNNNNp1,-,-,49889874,46124191,3718731919360,2468656459776 ::::diskid/DISK-NNNNNNNp1,-,-,50357481,45933366,3683843850240,2468656459776 ::gpt/log,1875968,2128830464,32,3832159,1961984,457619058688 With an uptime of ~51 days. Enjoy! - Eric