I am sponsoring this case for Chad Mynhier and closing it as approved automatic as it's simply a follow-on to PSARC/2009/105 to cover more commands.
Thanks, Sherry -- Sherry Moore, Solaris Core Kernel http://blogs.sun.com/sherrym Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI This information is Copyright 2009 Sun Microsystems 1. Introduction 1.1. Project/Component Working Name: Time Stamp Option for xxstat Commands Phase II 1.2. Name of Document Author/Supplier: Author: Chad Mynhier 1.3 Date of This Document: 15 May, 2009 4. Technical Description SUMMARY This case enhances the following commands to emit a timestamp: - auditstat(1M) - netstat(1M) - cpustat(1M) - ctstat(1) - fmstat(1M) - nfsstat(1M) - intrstat(1M) - poolstat(1M) - rcapstat(1) - zpool(1M) (the iostat sub-command) This case follows the precedent set by PSARC 2009/105[1] that all "*stat" commands that print statistics at a regular interval should implement a timestamp feature similar to the one described here. DETAILS The recent putback of the fix to bug 4775687 ("would like a timestamp option like iostat has added to mpstat, vmstat and prstat")[2] added a timestamp option to these three commands to match the existing functionality in iostat(1M) and fsstat(1M). PSARC case 2009/105 set the precedent that all "*stat" commands should include a similar option. This case corrects the list of commands in the summary to meet that precedent. Note that the timestamp will be printed with strftime(3C) using the correct locale-specific format string. Most of these commands will use the -T option for this purpose. The fmstat(1M) command has a pre-existing -T option, so the -d ("date") option is used here instead. This follows the precedent of prstat(1M), which also had a pre-existing -T option. In either case, the option has a single one-character argument,'u' or 'd', to specify whether the timestamp should be printed in Unix format (i.e., seconds since epoch) or in date(1) format. For those cases in which a header is printed periodically, the timestamp is printed before the header. For example: # ./ctstat -i 101 -T d 1 3 Wed May 6 09:05:45 EDT 2009 CTID ZONEID TYPE STATE HOLDER EVENTS QTIME NTIME 101 0 process owned 100004 0 - - Wed May 6 09:05:46 EDT 2009 CTID ZONEID TYPE STATE HOLDER EVENTS QTIME NTIME 101 0 process owned 100004 0 - - Wed May 6 09:05:47 EDT 2009 CTID ZONEID TYPE STATE HOLDER EVENTS QTIME NTIME 101 0 process owned 100004 0 - - # The decision to print the timestamp in this way is based on the precedent set by iostat(1M) and was followed during the implementation of the fix for 4775687. EXAMPLES This example shows the output of fmstat(1M) with a timestamp: # ./fmstat -m disk-transport -d u 1 3 1241620519 NAME VALUE DESCRIPTION dropped 0 number of dropped ereports 1241620520 NAME VALUE DESCRIPTION dropped 0 number of dropped ereports 1241620521 NAME VALUE DESCRIPTION dropped 0 number of dropped ereports # This example shows the output of nfsstat(1M) with a timestamp: # ./nfsstat -sr -T d 1 3 Wed May 6 10:38:40 EDT 2009 Server rpc: Connection oriented: calls badcalls nullrecv badlen xdrcall dupchecks dupreqs 0 0 0 0 0 0 0 Connectionless: calls badcalls nullrecv badlen xdrcall dupchecks dupreqs 0 0 0 0 0 0 0 ******************************************************************************** Wed May 6 10:38:41 EDT 2009 Server rpc: Connection oriented: calls badcalls nullrecv badlen xdrcall dupchecks dupreqs 0 0 0 0 0 0 0 Connectionless: calls badcalls nullrecv badlen xdrcall dupchecks dupreqs 0 0 0 0 0 0 0 ******************************************************************************** Wed May 6 10:38:42 EDT 2009 Server rpc: Connection oriented: calls badcalls nullrecv badlen xdrcall dupchecks dupreqs 0 0 0 0 0 0 0 Connectionless: calls badcalls nullrecv badlen xdrcall dupchecks dupreqs 0 0 0 0 0 0 0 ******************************************************************************** # DOCUMENTATION This case proposes adding the following text to the man pages for these commands, with the exception that the option shall be listed as "-d" for fmstat(1M): -T u | d Emit a time stamp. Specify u for a printed representation of the internal representation of time. See time(2). Specify d for standard date format. See date(1). Additionally, the option should be added to the SYNOPSIS section of the man pages for each of these. EXPORTED INTERFACES IMPORTED INTERFACES REFERENCES [1] http://arc.opensolaris.org/caselog/PSARC/2009/105/mail [2] would like a timestamp option like iostat has added to mpstat, vmstat and prstat (http://bugs.opensolaris.org/view_bug.do?bug_id=4775687) 6. Resources and Schedule 6.4. Steering Committee requested information 6.4.1. Consolidation C-team Name: ON 6.5. ARC review type: Automatic 6.6. ARC Exposure: open