15184Sek110237#
25184Sek110237# CDDL HEADER START
35184Sek110237#
45184Sek110237# The contents of this file are subject to the terms of the
55184Sek110237# Common Development and Distribution License (the "License").
65184Sek110237# You may not use this file except in compliance with the License.
75184Sek110237#
85184Sek110237# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
95184Sek110237# or http://www.opensolaris.org/os/licensing.
105184Sek110237# See the License for the specific language governing permissions
115184Sek110237# and limitations under the License.
125184Sek110237#
135184Sek110237# When distributing Covered Code, include this CDDL HEADER in each
145184Sek110237# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
155184Sek110237# If applicable, add the following below this CDDL HEADER, with the
165184Sek110237# fields enclosed by brackets "[]" replaced with your own identifying
175184Sek110237# information: Portions Copyright [yyyy] [name of copyright owner]
185184Sek110237#
195184Sek110237# CDDL HEADER END
205184Sek110237#
215184Sek110237#
22*6333Sek110237# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
235184Sek110237# Use is subject to license terms.
245184Sek110237#
255184Sek110237# ident	"%Z%%M%	%I%	%E% SMI"
265184Sek110237
27*6333Sek110237# Single threaded asynchronous ($sync) random appends (random I/Os
28*6333Sek110237# in the range of [1B - 1MB]) to a 1GB file.
29*6333Sek110237# Does a fsync after 10 ($iters) appends.
30*6333Sek110237# Stops after 1GB ($bytes) has been appended/written.
315184Sek110237
325184Sek110237set $dir=/tmp
33*6333Sek110237set $bytes=1g
345184Sek110237set $iosize=1m
35*6333Sek110237set $iters=10
36*6333Sek110237set $nthreads=1
37*6333Sek110237set $sync=false
385184Sek110237
39*6333Sek110237define file name=largefile,path=$dir,size=0,prealloc
405184Sek110237
415184Sek110237define process name=filecreater,instances=1
425184Sek110237{
435184Sek110237  thread name=filecreaterthread,memsize=10m,instances=$nthreads
445184Sek110237  {
45*6333Sek110237    flowop appendfilerand name=append-file,filename=largefile,dsync=$sync,iosize=$iosize,iters=$iters
46*6333Sek110237    flowop fsync name=sync
475184Sek110237    flowop finishonbytes name=finish,value=$bytes
485184Sek110237  }
495184Sek110237}
505184Sek110237
51*6333Sek110237echo  "FileMicro-CreateRand Version 2.1 personality successfully loaded"
525184Sek110237usage "Usage: set \$dir=<dir>"
53*6333Sek110237usage "       set \$bytes=<value>    defaults to $bytes"
545184Sek110237usage "       set \$iosize=<size>    defaults to $iosize"
55*6333Sek110237usage "       set \$iters=<value>    defaults to $iters"
565184Sek110237usage "       set \$nthreads=<value> defaults to $nthreads"
575184Sek110237usage "       set \$sync=<bool>      defaults to $sync"
585184Sek110237usage " "
595184Sek110237usage "       run runtime (e.g. run 60)"
60