From owner-freebsd-fs@freebsd.org Wed Jun 27 02:22: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 B6BD51028752 for ; Wed, 27 Jun 2018 02:22:57 +0000 (UTC) (envelope-from esr@mail.hebrew.edu) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (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 5460A8E9F1 for ; Wed, 27 Jun 2018 02:22:56 +0000 (UTC) (envelope-from esr@mail.hebrew.edu) Received: by mail-it0-x233.google.com with SMTP id 128-v6so5279511itf.1 for ; Tue, 26 Jun 2018 19:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail-hebrew-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hQNySRk0OkLV8rI33BOPVjcjc3fiKs/Ggl1nx7mQ2ZQ=; b=FP+B9LvTDelZvVlVywMk84AwWi9xxJO+YGLM+ON7aP9CpAdaJH+McvNejN//TUV26Z tzKfboWT8cJXpvPTDv06OYvVV9I8g3V02KGFtiIwmxqrQysc4/Xf61H5/LlJT/hD5nFN y54DnnLf1Ey+zAQV9OPSSoOqHzME8Q21CnjdqHc+fe0Uq1vwhapqfQoz58CkHIIadWXK 1npzLETMFIAeapfumoxMj6A/4BPK183zpyYIMIOUMAEf5xYxlpt8MKTJmCK/jfA3wpCv +BywvBVUqpfcQumLhEvQ6b6PiWApMySY5uL+qPW8JXa0vRW7WGMgEf/hEmjK2W7c6Qgj 97JQ== 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=hQNySRk0OkLV8rI33BOPVjcjc3fiKs/Ggl1nx7mQ2ZQ=; b=mqxN8D5gFfLo6f4AvhxxY8dirv90zeGO+AoTzk6/LC7kqOk0mzpb7GCGuoqFaMv5qx 9Nq/pcF1Bxf/PrS6JSKr9SlEgqaHBs439tRNSUWs2WV8CaEplpA13FijylIVNjU/SE+Y Uf12UDz1XXyTCug9W+moh2anrv6rXAncBnH6Jjkzy4STwvf5h1aH1f/v6AuHty2br50N DJIcxbLj9RR+jj7szaCazpxH6tEmE35RsYFUzL65OCGZG34uju2S7Y0UAGOpM6dKaUBW 5sr+Bjtnha2jj/c+3bcQ3ka5SuxdYFu7/tdbuZYVkmf5oCmbS/QAwJ/D7Q+9QvxNO/Pb 2FPg== X-Gm-Message-State: APt69E1WviFfu4LGxeCYpy2vX5SNmxI1di57MQIGcNfAt5FCmhFVTnXN 9GNQT+danKzDVqLtiCrLue7BHuMQW7/aaQgpjoI+0Q== X-Google-Smtp-Source: AAOMgpeSnvrzsN3UL4CU1LyUPslohMhuyVgAHW4XFBWtpfSkK4jcb+BFQbWvlEEAhie0dvyj2MjdyjxYI+o8FHXtryo= X-Received: by 2002:a24:c106:: with SMTP id e6-v6mr1145213itg.126.1530066176200; Tue, 26 Jun 2018 19:22:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:d111:0:0:0:0:0 with HTTP; Tue, 26 Jun 2018 19:22:55 -0700 (PDT) In-Reply-To: References: From: "E.S. Rosenberg" Date: Wed, 27 Jun 2018 05:22:55 +0300 Message-ID: Subject: Re: raw filesystem counters To: "Eric A. Borisch" Cc: freebsd-fs@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 02:22:58 -0000 //I hope it's not considered a problem that I'm reviving this old thread. That is a really cool patch thanks! Will see if I can get the ZFS admins to allow me to use it... A small follow up question: Is there any easily parsable way to find what disks are part of a pool? zpool status poolname is a nightmare to parse. Your patched output would be slightly better to parse but still not ideal because depending on whether or not disks are in raidz or not they may be more or less indented... On Tue, Feb 20, 2018 at 10:24 PM, Eric A. Borisch wrote: > 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 >