16212Saw148015#
26212Saw148015# CDDL HEADER START
36212Saw148015#
46212Saw148015# The contents of this file are subject to the terms of the
56212Saw148015# Common Development and Distribution License (the "License").
66212Saw148015# You may not use this file except in compliance with the License.
76212Saw148015#
86212Saw148015# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96212Saw148015# or http://www.opensolaris.org/os/licensing.
106212Saw148015# See the License for the specific language governing permissions
116212Saw148015# and limitations under the License.
126212Saw148015#
136212Saw148015# When distributing Covered Code, include this CDDL HEADER in each
146212Saw148015# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156212Saw148015# If applicable, add the following below this CDDL HEADER, with the
166212Saw148015# fields enclosed by brackets "[]" replaced with your own identifying
176212Saw148015# information: Portions Copyright [yyyy] [name of copyright owner]
186212Saw148015#
196212Saw148015# CDDL HEADER END
206212Saw148015#
216212Saw148015#
22*9326SAndrew.W.Wilson@sun.com# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
236212Saw148015# Use is subject to license terms.
246212Saw148015
256212Saw148015# Sequential write() of a 1G file, size picked from a gamma distribution
266212Saw148015# min of 1k and a mean of 5.5K, followed by close(), cached.
276212Saw148015
286212Saw148015
296212Saw148015
306212Saw148015set $dir=/tmp
316212Saw148015set $nthreads=1
326212Saw148015set $cached=false
336212Saw148015set $sync=false
346212Saw148015set $count=128k
356212Saw148015
366212Saw148015define randvar name=$iosize, type=gamma, min=1k, mean=5632, gamma=1500
376212Saw148015
386212Saw148015define fileset name=bigfileset,path=$dir,size=0,entries=$nthreads,dirwidth=1024,prealloc=100,cached=$cached
396212Saw148015
406212Saw148015define process name=filewriter,instances=1
416212Saw148015{
426212Saw148015  thread name=filewriterthread,memsize=10m,instances=$nthreads
436212Saw148015  {
44*9326SAndrew.W.Wilson@sun.com    flowop openfile name=open-file,filesetname=bigfileset,fd=1
45*9326SAndrew.W.Wilson@sun.com    flowop appendfile name=write-file,dsync=$sync,iosize=$iosize,fd=1,iters=$count
466212Saw148015    flowop closefile name=close,fd=1
476212Saw148015    flowop finishoncount name=finish,value=1
486212Saw148015  }
496212Saw148015}
506212Saw148015
51*9326SAndrew.W.Wilson@sun.comecho  "FileMicro-SeqWriteRandVarGam Version 1.1 personality successfully loaded"
526212Saw148015usage "Usage: set \$dir=<dir>"
536212Saw148015usage "       set \$cached=<bool>        defaults to $cached"
546212Saw148015usage "       set \$count=<value>        defaults to $count"
556212Saw148015usage "       set \$iosize.type=<type>   defaults to $iosize.type"
566212Saw148015usage "       set \$iosize.randsrc=<src> defaults to $iosize.randsrc"
576212Saw148015usage "       set \$iosize.mean=<mean>   defaults to $iosize.mean"
586212Saw148015usage "       set \$iosize.gamma=<gamma> defaults to $iosize.gamma"
596212Saw148015usage "       set \$nthreads=<value>     defaults to $nthreads"
606212Saw148015usage "       set \$sync=<bool>          defaults to $sync"
616212Saw148015usage " "
626212Saw148015usage "       run runtime (e.g. run 60)"
63