<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="2" MadCap:lastHeight="120" MadCap:lastWidth="624" MadCap:disableMasterStylesheet="true" MadCap:tocPath="" MadCap:InPreviewMode="false" MadCap:RuntimeFileType="Topic" MadCap:TargetType="WebHelp" MadCap:PathToHelpSystem="../../../" MadCap:HelpSystemFileName="index.xml" MadCap:SearchType="Stem"> <head><title>Using Your Application To Generate The IO Pattern </title> <script type="text/javascript">/* <![CDATA[ */ window.onload = function(){ var pathToFlash = $('html').attr('MadCap:PathToHelpSystem') + 'Content/Resources/Code/ZeroClipboard.swf'; ZeroClipboard.setMoviePath(pathToFlash); function bindToClipBord(element,content){ var clip = new ZeroClipboard.Client(); clip.setText(content); clip.glue(element); }; if(location.protocol==='file:'){ $('.copylink-marker').remove(); } else{ $('.copylink-marker').each(function(){ var text = $(this).parent().parent().children('.prettyprint').html(); $(this).hover(function(){ bindToClipBord(this,text); }, function(){}); }); } prettyPrint(); }; /* ]]> */</script> <link href="../../SkinSupport/MadCap.css" rel="stylesheet" /> <link href="../../Resources/Stylesheets/OnlineStyle.css" rel="stylesheet" /> <script src="../../Resources/Code/prettify.js"> </script> <script src="../../Resources/Code/lang-vb.js"> </script> <script src="../../Resources/Code/jquery.min.js"> </script> <script src="../../Resources/Code/ZeroClipboard.js"> </script> <script src="../../SkinSupport/MadCapAll.js" type="text/javascript"> </script> </head> <body> <p class="MCWebHelpFramesetLink" style="display: none;"><a href="../../../index_CSH.html#tuning/io_benchmark_tools/using_your_application_to_generate_the_io_pattern.htm" style="">Open topic with navigation</a> </p> <p> <script type="text/javascript">/*<![CDATA[*/document.write('<a href="' + location.href +'">'); document.write("Direct Link"); document.write('</a>');/*]]>*/</script> </p> <p> </p> <h1>Using Your Application To Generate The IO Pattern</h1>When you execute IoBenchmark, it uses a simple CRUD (create, read, update, delete) application as the target application. This application is located in the com.db4o.bench.crud package. If you want to use your own application for generating the I/O access patterns, here's what you have to do: <ul><li value="1">Use a LoggingIoAdapter, delegating to your default IoAdapter: <code><br />RandomAccessFileAdapter rafAdapter = <br />new RandomAccessFileAdapter(); <br />IoAdapter ioAdapter = <br />new LoggingIoAdapter(rafAdapter, "filename.log"); <br />Configuration config = Db4o.cloneConfiguration(); <br />config.io(ioAdapter);</code> <![CDATA[ ]]><br /> You'll also find this code in <code><br />com.db4o.bench.crud.CrudApplication#prepare()</code>.<br /></li><li value="2">Change IoBenchmark to call your application by modifying the <code><br />runTargetApplication()</code> method. You also have to exchange the calls to <br /><code>CrudApplication.logFileName(itemCount)</code> in <code>prepareDbFile()</code> and <code>runBenchmark</code> with the file name of the log containing the I/O access pattern of your application. Using the code from above, this log file will be called "filename.log". </li></ul>If you want to generate your log by interacting with your application, rather than having IoBenchmark calling it, do as follows: <ul><li value="1">Use a LoggingIoAdapter in your application</li><li value="2">Interact with your application to create the log</li><li value="3">Remove the stage 1 from IoBenchmark and make it start in stage 2 with your log.</li></ul>If you are using your own application to generate the I/O log file, check out the <a href="io_log_file_statistics.htm">IO Log File Statistics</a> section further down. <script type="text/javascript" src="../../SkinSupport/MadCapBodyEnd.js"></script></body> </html>