/usr/sbin/dtrace -q -Z -32 -n ' /* # Program: Requests by httpd process # # Author: Matty # # Current Version: 0.1a # # Revision History: # Version 0.1a # # Last Updated: 11-25-2005 # # Purpose: Prints the number of requests processed by each httpd process # # Installation: # Copy the shell script to a suitable location # # CDDL HEADER START # The contents of this file are subject to the terms of the # Common Development and Distribution License, Version 1.0 only # (the "License"). You may not use this file except in compliance # with the License. # # You can obtain a copy of the license at Docs/cddl1.txt # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # CDDL HEADER END # # Example: # $ viewreqsbyproc.d # Execname Process Requests Processed # httpd 19103 16 # httpd 19152 17 # httpd 19101 17 # httpd 19102 19 # httpd 19104 20 # httpd 19105 20 # # */ dtrace:::BEGIN { printf("Sampling request data (Ctrl-C to stop and print):\n"); } ::apache_log_request:log-request { @requests[execname,pid] = count(); } dtrace:::END { printf("Execname Process Requests Processed\n"); printa("%-8s %-7d %-@7d\n",@requests); trunc(@requests); }'