From owner-soc-status@FreeBSD.ORG Mon Jun 2 11:43:27 2014 Return-Path: Delivered-To: soc-status@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A4115FC for ; Mon, 2 Jun 2014 11:43:27 +0000 (UTC) Received: from mx1.mail.bg (mx1.mail.bg [IPv6:2001:67c:16b8:1::2:17]) by mx1.freebsd.org (Postfix) with ESMTP id 34981291A for ; Mon, 2 Jun 2014 11:43:27 +0000 (UTC) Received: from [10.1.1.159] (unknown [95.87.254.225]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.mail.bg (Postfix) with ESMTPSA id F02EA6000CB3 for ; Mon, 2 Jun 2014 14:43:24 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mail.bg; s=default; t=1401709405; bh=hX0MAWK8GXFZJ2OS1GgYIGv3VSMGprBHlYUi3j1u47U=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date: Content-Transfer-Encoding:Message-Id:References:To; b=VPdtFUNHYlButBfGgJxMdFgtvzg7olh+SrqsKcLhCq/DvnPdNNbk2PsstabzNYqQE PY96qYrY6Gp/daaQwb+hkXc5Y8wV5aOZimIPbjuDlFe6qjI2rg9N9HQJ+ZQAM0xwhH keEV5+cp5zc2EokA34pKPy1/bn+gu5CF72Ok3yyM= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1283) Subject: Re: [Machine readable output from userland utilities] report From: Zaro Korchev In-Reply-To: <8D1B686D-1AAA-4E07-9270-E42699110561@mail.bg> Date: Mon, 2 Jun 2014 14:43:23 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <1AE4C0BE-546E-4B02-9664-F460F948794F@mail.bg> References: <8D1B686D-1AAA-4E07-9270-E42699110561@mail.bg> To: soc-status@freebsd.org X-Mailer: Apple Mail (2.1283) X-BeenThere: soc-status@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Summer of Code Status Reports and Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 11:43:27 -0000 This week I made some improvements to the output library libsol to allow = more flexibility. I have modified the base system's versions of ls and vmstat to support = the new output library. There are some things to fix but both tools can = now produce JSON output. The changes are available at my GSoC svn repository: https://socsvn.freebsd.org/socsvn/soc2014/zkorchev/ At the moment both ls and vmstat are told to output JSON by specifying = the -O option. However as I discussed with my mentor, this will be = changed. The idea is to use an environment variable instead of the -O = flag. Here are some examples of the output of vmstat (I formatted the JSON in = this email to be more readable for humans): # vmstat -O { "procs_r": 0, "procs_b": 0, "procs_w": 0, "mem_avg": 541240, "mem_free": 887156, "page_flt": 15, "page_re": 0, "page_pi": 0, "page_po": 0, "page_fr": 18, "page_sr": 5, "ad0": 0, "cd0": 0, "fault_in": 2, "fault_sy": 41, "fault_cs": 61, "cpu_user": 0.09950441105699527, "cpu_sys": 1.5893235226189397, "cpu_idle": 98.31117206632406 } # vmstat -Of { "fork": { "count": 605, "pages": 23192, "average": 38.33388429752066 }, "vfork": { "count": 319, "pages": 11546, "average": 36.19435736677116 }, "rfork": { "count": 0, "pages": 0, "average": 0 } } I'm thinking about rounding the floating point numbers. Any suggestions for improvement are welcome :) Zaro=