- Timestamp:
- 12/11/13 22:14:29 (8 years ago)
- Location:
- Tests/JAVA/logger
- Files:
-
- 3 added
- 2 deleted
- 23 edited
- 2 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
Tests/JAVA/logger/data/fastlogger.gp
r594 r595 3 3 20 42.255 1.162 215.663 46.158 196.558 16.781 196.767 37.289 4 4 40 92.913 6.329 253.847 32.929 226.350 10.907 265.738 65.212 5 60 136.054 7.684 310.251 31.304 283.729 7.236 319.147 12.5026 80 182.154 5.383 3 41.193 14.609 311.826 16.462 353.109 4.9137 120 271.064 1.241 436.285 71.450 407.997 29.112 441.341 7.3255 60 136.054 7.684 277.956 33.280 273.613 24.717 305.827 39.635 6 80 182.154 5.383 313.551 31.005 319.657 41.473 339.366 62.172 7 120 271.064 1.241 396.511 48.478 385.620 35.202 422.444 33.591 8 8 200 441.316 7.130 578.085 9.334 573.498 15.924 593.476 4.326 -
Tests/JAVA/logger/logger.iml
r590 r595 13 13 <orderEntry type="inheritedJdk" /> 14 14 <orderEntry type="sourceFolder" forTests="false" /> 15 <orderEntry type="module-library"> 16 <library> 17 <CLASSES> 18 <root url="jar://$MODULE_DIR$/libs/gflogger-20131211.jar!/" /> 19 </CLASSES> 20 <JAVADOC /> 21 <SOURCES /> 22 </library> 23 </orderEntry> 15 24 <orderEntry type="library" name="Maven: org.openjdk.jmh:jmh-core:0.2" level="project" /> 16 25 <orderEntry type="library" name="Maven: args4j:args4j:2.0.16" level="project" /> … … 25 34 <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.0-beta9" level="project" /> 26 35 <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.0-beta9" level="project" /> 36 <orderEntry type="library" name="Maven: org.gflogger:gflogger:0.9" level="project" /> 27 37 <orderEntry type="library" name="Maven: com.google.guava:guava:15.0" level="project" /> 28 38 <orderEntry type="library" name="Maven: org.springframework:spring-core:3.0.5.RELEASE" level="project" /> -
Tests/JAVA/logger/pom.xml
r590 r595 117 117 <artifactId>log4j-core</artifactId> 118 118 <version>2.0-beta9</version> 119 </dependency> 120 121 <dependency> 122 <groupId>org.gflogger</groupId> 123 <artifactId>gflogger</artifactId> 124 <version>0.9</version> 125 <scope>system</scope> 126 <systemPath>${project.basedir}/libs/gflogger-20131211.jar</systemPath> 119 127 </dependency> 120 128 -
Tests/JAVA/logger/scripts/batch.sh
r594 r595 1 1 #!/bin/bash 2 2 3 for PAYLOAD in 0 20 40 60 80 120 200 3 for PAYLOAD in 400 800 1200 4 #for PAYLOAD in 0 20 40 60 80 120 200 4 5 do 5 java -server -Xmx512M -da -D writer-backoff=$PAYLOAD -Dcells-per-record=8 -jar target/benchmarks.jar ".*$1.*" -f -w 2 -wi 5 -i 5 -r 10 -gc true >> "data/$1.results"6 java -server -Xmx512M -da -Dlength-pow=22 -Dwriter-backoff=$PAYLOAD -Dcells-per-record=8 -jar target/benchmarks.jar ".*$1.*" -f -w 2 -wi 5 -i 5 -r 10 -gc true >> "data/$1.results" 6 7 done 7 8 -
Tests/JAVA/logger/scripts/fastlogger.gnuplot
r594 r595 17 17 set style line 2 lt 1 lc rgb "blue" lw 4 pt 7 ps 1 18 18 set style line 3 lt 1 lc rgb "green" lw 4 pt 7 ps 1 19 set style line 4 lt 1 lc rgb "red" lw 4 pt 7 ps 119 set style line 4 lt 1 lc rgb "red" lw 8 pt 7 ps 1.5 20 20 21 21 set xlabel "payload, ns" font "Verdana,18" … … 25 25 set output "fastlogger-wp.ps" 26 26 plot "data/fastlogger.gp" \ 27 using 2:($4-$2) title "log('%...') x3" with lp ls 2,\28 "" using 2:($4-$2):(sqrt($5**2+$3**2)) notitle with yerrorbars ls 2,\29 "" using 2:($6-$2) title "cache TL x3" with lp ls 3,\30 "" using 2:($6-$2):(sqrt($7**2+$3**2)) notitle with yerrorbars ls 3,\31 "" using 2:($8-$2) title "cache per thread x3" with lp ls 4,\32 "" using 2:($8-$2):(sqrt($9**2+$3**2)) notitle with yerrorbars ls 427 using 2:($4-$2) title "log('%...') x3" with lp ls 4,\ 28 "" using 2:($4-$2):(sqrt($5**2+$3**2)) notitle with yerrorbars ls 4,\ 29 "" using 2:($6-$2) title "cached TL x3" with lp ls 2,\ 30 "" using 2:($6-$2):(sqrt($7**2+$3**2)) notitle with yerrorbars ls 2 31 # "" using 2:($8-$2) title "cache per thread x3" with lp ls 4,\ 32 # "" using 2:($8-$2):(sqrt($9**2+$3**2)) notitle with yerrorbars ls 4 33 33 34 34 35 set key right top font "Verdana, 18" spacing 1.5 nobox 36 set xrange [0:460] 37 set output "fastlogger-all.ps" 38 plot "data/fastlogger.gp" \ 39 using 2:($4-$2) title "log('%...') x3" with lp ls 4,\ 40 "" using 2:($4-$2):(sqrt($5**2+$3**2)) notitle with yerrorbars ls 4,\ 41 "data/writebuffer.gp" \ 42 index 0 using 2:($4-$2) title "write(64b) x3, drain x1" with lp ls 3,\ 43 "" index 0 using 2:($4-$2):(sqrt($5**2+$3**2)) notitle with yerrorbars ls 3,\ 44 "data/mcsdsequencer.gp" \ 45 using 2:($3-$2) title ".claim() x3" with lp ls 2,\ 46 "" using 2:($3-$2):4 notitle with yerrorbars ls 2,\ 47 "data/atomics.gp" \ 48 using 2:($8-$2) title ".incAndGet() x3 .get() x1" with lp ls 1,\ 49 "" using 2:($8-$2):(sqrt($9**2+$3**2)) notitle with yerrorbars ls 1 50 -
Tests/JAVA/logger/scripts/multiwritebuffer.gnuplot
r594 r595 15 15 16 16 set style line 1 lt 3 lc rgb "black" lw 4 pt 1 ps 1 17 set style line 2 lt 1 lc rgb "blue" lw 4 pt 7 ps 1 18 set style line 3 lt 1 lc rgb "green" lw 4 pt 7 ps 1 19 set style line 4 lt 1 lc rgb "red" lw 4 pt 7 ps 1 17 set style line 2 lt 1 lc rgb "red" lw 7 pt 7 ps 1 20 18 21 19 set xlabel "payload, ns" font "Verdana,18" … … 25 23 set output "multiwritebuffer.ps" 26 24 plot "data/multiwritebuffer.gp" \ 27 index 0 using 2:($4-$2) title " Write(64b) x3, Drain x1" with lp ls 2,\25 index 0 using 2:($4-$2) title "*Write(64b) x3, Drain x1" with lp ls 2,\ 28 26 "" index 0 using 2:($4-$2):(sqrt($5**2+$3**2)) notitle with yerrorbars ls 2,\ 27 "data/writebuffer.gp" \ 28 index 0 using 2:($4-$2) title "Write(64b) x3, Drain x1" with lp ls 1,\ 29 "" index 0 using 2:($4-$2):(sqrt($5**2+$3**2)) notitle with yerrorbars ls 1,\ 29 30 30 31 31 #set xlabel "size, bytes" font "Verdana,18"32 #set ylabel "ns/iteration" font "Verdana,18"33 #set xtics 3234 #set xrange [0:]35 #set output "writebuffer-size.ps"36 #plot "data/writebuffer.gp" \37 # index 1 using ($2*8):($3-$1) title "Write(size) x3" with lp ls 2,\38 # "" index 1 using ($2*8):($3-$1):4 notitle with yerrorbars ls 239 32 40 -
Tests/JAVA/logger/src/main/java/com/db/logger/api/FastLogger.java
r590 r595 11 11 public LogMessage messageThreadLocal( final String messageFormat ); 12 12 13 public LogMessage message( final String messageFormat );13 public LogMessage log( final String messageFormat ); 14 14 15 15 } -
Tests/JAVA/logger/src/main/java/com/db/logger/api/FluentLogBuilder.java
r589 r595 11 11 public FluentLogBuilder with( final long value ); 12 12 13 public void log();13 public void submit(); 14 14 } -
Tests/JAVA/logger/src/main/java/com/db/logger/api/LogMessage.java
r589 r595 14 14 public FluentLogBuilder with( final long value ); 15 15 16 public void log();16 public void submit(); 17 17 18 18 } -
Tests/JAVA/logger/src/main/java/com/db/logger/api/impl/PlaygroundMain.java
r594 r595 1 1 package com.db.logger.api.impl; 2 2 3 import java.util.concurrent.ExecutorService; 4 import java.util.concurrent.Executors; 5 import java.util.concurrent.TimeUnit; 3 import java.io.*; 4 import java.nio.ByteBuffer; 5 import java.nio.channels.FileChannel; 6 import java.util.concurrent.*; 6 7 7 import com.db.logger.api.impl.logger. RingBuffer;8 import com.db.logger.api.impl.logger. MCSDSequencer;9 import com.db.logger.api.impl.logger. formatters.SimpleLogMessage;10 import com.db.logger. api.impl.logger.buffer.PlainLongsBuffer;8 import com.db.logger.api.impl.logger.*; 9 import com.db.logger.api.impl.logger.buffer.UnsafeLongsBuffer; 10 import com.db.logger.api.impl.logger.buffer.ILongsBuffer; 11 import com.db.logger.io.storage.RawWriter; 11 12 import com.db.logger.timesource.impl.JDKCombinedTimestampSource; 12 13 import com.db.logger.timesource.impl.SynchronousJDKOffsetCalculator; 13 14 import org.apache.commons.logging.Log; 14 15 import org.apache.commons.logging.LogFactory; 15 16 import static com.db.logger.api.impl.logger.WaitingStrategy.SPINNING; 16 import org.apache.log4j.BasicConfigurator; 17 17 18 18 /** … … 24 24 25 25 static { 26 BasicConfigurator.configure(); 26 27 } 27 28 … … 31 32 32 33 final int length = ( 1 << 14 ); 33 final PlainLongsBuffer buffer = new PlainLongsBuffer( length ); 34 final MCSDSequencer sequencer = new MCSDSequencer( length ); 34 final ILongsBuffer buffer = new UnsafeLongsBuffer( length ); 35 36 final File file = new File( "output.log" ); 37 log.info( "File " + file ); 38 file.delete(); 39 // file.deleteOnExit(); 40 final FastLoggerImpl logger = new FastLoggerImpl( 41 new ThreadFactory() { 42 @Override 43 public Thread newThread( final Runnable r ) { 44 return new Thread( r ); 45 } 46 }, 47 buffer, 48 WaitingStrategy.SPINNING, 49 new RawFileWriter( file ) 50 ); 51 52 logger.startDraining(); 35 53 36 54 final int workers = Runtime.getRuntime().availableProcessors() - 1; 37 55 final ExecutorService workersPool = Executors.newFixedThreadPool( workers ); 38 56 39 new Thread( new Runnable() {40 @Override41 public void run() {42 for(; ; ) {43 sequencer.drainTo( new MCSDSequencer.Drainer() {44 @Override45 public int available( final long startSequence,46 final long sentinelSequence ) {47 return ( int ) ( sentinelSequence - startSequence );48 }49 } );50 }51 }52 } ).start();53 54 57 for( int i = 0; i < workers; i++ ) { 55 final int formatId = i;56 final SimpleLogMessage formatter = new SimpleLogMessage(57 "%d %f",58 formatId,59 2,60 new RingBuffer( sequencer, buffer, SPINNING )61 );62 58 workersPool.submit( 63 59 new Runnable() { … … 65 61 public void run() { 66 62 try { 67 for( int i = 0; i < 10000000 ; i++ ) {68 formatter.with( 25.98 + formatId)69 .with( 100 + formatId)70 . log();63 for( int i = 0; i < 100000000; i++ ) { 64 logger.log( "Message %f -- %d " ) 65 .with( 25.98 + i ) 66 .with( 100 - i ).submit(); 71 67 } 72 68 } catch( Exception e ) { … … 78 74 } 79 75 76 80 77 workersPool.shutdown(); 81 78 workersPool.awaitTermination( 1000, TimeUnit.SECONDS ); … … 84 81 } 85 82 83 private static class RawFileWriter implements RawWriter { 84 private final ByteBuffer buffer; 85 private final FileChannel channel; 86 87 public RawFileWriter( final File file ) throws IOException { 88 this( new FileOutputStream( file ).getChannel() ); 89 } 90 91 public RawFileWriter( final FileChannel channel ) { 92 this.channel = channel; 93 buffer = ByteBuffer.allocateDirect( 1 << 16 ); 94 } 95 96 @Override 97 public ByteBuffer buffer() { 98 return buffer; 99 } 100 101 @Override 102 public void flush() throws IOException { 103 buffer.flip(); 104 channel.write( buffer ); 105 buffer.clear(); 106 } 107 108 @Override 109 public void close() throws IOException { 110 flush(); 111 channel.close(); 112 } 113 } 86 114 } -
Tests/JAVA/logger/src/main/java/com/db/logger/api/impl/logger/FastLoggerImpl.java
r594 r595 13 13 import com.db.logger.io.storage.RawWriter; 14 14 import com.google.common.base.Throwables; 15 import gnu.trove.map.hash.THashMap;16 15 import org.apache.commons.logging.Log; 17 16 import org.apache.commons.logging.LogFactory; … … 96 95 } 97 96 98 public LogMessage message( final String messageFormat ) {97 public LogMessage log( final String messageFormat ) { 99 98 final MessageInfo messageInfo = lookupMessageInfo( messageFormat ); 100 99 final RawLogMessage message = holder.get(); … … 285 284 286 285 @Override 287 public void log() {288 setupLocal(). log();286 public void submit() { 287 setupLocal().submit(); 289 288 } 290 289 -
Tests/JAVA/logger/src/main/java/com/db/logger/api/impl/logger/MessagesCatalog.java
r594 r595 28 28 29 29 final int length = entries.length; 30 final int index = hash & ( length - 1 ); 30 final int mask = length - 1; 31 final int startIndex = hash; 31 32 32 MessageInfo cur = entries[index]; 33 for( int i = 0; i < length; i++ ) { 34 final int index = ( startIndex + i ) & mask; 35 final MessageInfo cur = entries[index]; 36 if( cur == FREE ) { 37 //cache miss 38 return recheckAndStore( messageFormat, hash ); 39 } else if( cur.format.equals( messageFormat ) ) { 40 //cache hit 41 return cur; 42 } 43 } 33 44 34 if( cur == FREE ) { 35 //cache miss 36 return recheckAndStore( messageFormat, hash ); 37 } else if( cur.format.equals( messageFormat ) ) { 38 //cache hit 39 return cur; 40 } else {// already FULL, must probe 41 42 // compute the double hash 43 final int probe = 1 + ( hash % ( length - 2 ) ); 44 int probedIndex = index; 45 for( int i = 0; i < entries.length; i++ ) { 46 probedIndex -= probe; 47 if( probedIndex < 0 ) { 48 probedIndex += length; 49 } 50 cur = entries[probedIndex]; 51 if( cur == FREE ) { 52 //cache miss 53 return recheckAndStore( messageFormat, hash ); 54 } else if( cur.format.equals( messageFormat ) ) { 55 //cache hit 56 return cur; 57 } 58 } 59 //cache miss, and cache is full -- overwrite main slot 60 throw new IllegalStateException( "Cache is full" ); 61 } 45 throw new IllegalStateException( "Table overloaded" ); 62 46 } 63 47 … … 66 50 //we restart search from start since anybody could race with us 67 51 final int length = entries.length; 68 final int index = hash % length; 52 final int mask = length - 1; 53 final int startIndex = hash; 69 54 70 MessageInfo cur = entries[index]; 71 72 if( cur == FREE ) { 73 //cache miss 74 return createAndStore( format, index ); 75 } else if( cur.format.equals( format ) ) { 76 //cache hit 77 return cur; 78 } else {// already FULL, must probe 79 80 // compute the double hash 81 final int probe = 1 + ( hash % ( length - 2 ) ); 82 int probedIndex = index; 83 for( int i = 0; i < entries.length; i++ ) { 84 probedIndex -= probe; 85 if( probedIndex < 0 ) { 86 probedIndex += length; 87 } 88 cur = entries[probedIndex]; 89 if( cur == FREE ) { 90 //cache miss 91 return createAndStore( format, probedIndex ); 92 } else if( cur.format.equals( format ) ) { 93 //cache hit 94 return cur; 95 } 55 for( int i = 0; i < length; i++ ) { 56 final int index = ( startIndex + i ) & mask; 57 final MessageInfo cur = entries[index]; 58 if( cur == FREE ) { 59 //cache miss 60 return createAndStore( format, index ); 61 } else if( cur.format.equals( format ) ) { 62 //cache hit 63 return cur; 96 64 } 97 //cache miss, and cache is full -- overwrite main slot98 throw new IllegalStateException( "Cache is full" );99 65 } 66 throw new IllegalStateException( "Table overloaded" ); 100 67 } 101 68 -
Tests/JAVA/logger/src/main/java/com/db/logger/api/impl/logger/buffer/UnsafeLongsBuffer.java
r594 r595 9 9 10 10 /** 11 * Same as {@linkplain PlainLongsBuffer}, but uses Unsafe for all accesses, 12 * not only synchronization, so bypass bounds checking 13 * 11 14 * @author cherrus 12 15 * created 11/12/13 at 4:43 PM 13 16 */ 14 public class DirectAccessLongBuffer implements ILongsBuffer {17 public class UnsafeLongsBuffer implements ILongsBuffer { 15 18 16 19 private final long[] array; 17 20 private final transient int mask; 18 21 19 public DirectAccessLongBuffer( final int length ) {22 public UnsafeLongsBuffer( final int length ) { 20 23 checkArgument( 21 24 ( length & ( length - 1 ) ) == 0, … … 26 29 } 27 30 28 public DirectAccessLongBuffer( final int length,29 31 public UnsafeLongsBuffer( final int length, 32 final long fillWithValue ) { 30 33 this( length ); 31 34 Arrays.fill( array, fillWithValue ); -
Tests/JAVA/logger/src/main/java/com/db/logger/api/impl/logger/formatters/AbstractLogBuilder.java
r594 r595 53 53 54 54 @Override 55 public void log() {55 public void submit() { 56 56 ensureStarted(); 57 57 try { -
Tests/JAVA/logger/src/main/java/com/db/logger/api/impl/logger/formatters/DummyLogBuilder.java
r589 r595 26 26 27 27 @Override 28 public void log() {28 public void submit() { 29 29 30 30 } -
Tests/JAVA/logger/src/main/java/com/db/logger/api/impl/logger/formatters/RawLogMessage.java
r594 r595 88 88 89 89 @Override 90 public void log() {90 public void submit() { 91 91 checkState( position != INVALID_INDEX, "Not started" ); 92 92 try { -
Tests/JAVA/logger/src/main/java/com/db/logger/api/impl/logger/formatters/SimpleLogMessageExpanded.java
r594 r595 12 12 13 13 /** 14 * TODO Unsafe! 15 * 14 16 * @author ruslan 15 17 * created 20.11.13 at 23:48 … … 87 89 88 90 @Override 89 public void log() {91 public void submit() { 90 92 // ensureStarted(); 91 93 try { -
Tests/JAVA/logger/src/main/java/com/db/logger/benchmarks/BufferWriteAndDrainBenchmark.java
r594 r595 5 5 6 6 import com.db.logger.api.impl.logger.*; 7 import com.db.logger.api.impl.logger.buffer. DirectAccessLongBuffer;7 import com.db.logger.api.impl.logger.buffer.UnsafeLongsBuffer; 8 8 import com.db.logger.api.impl.logger.buffer.ILongsBuffer; 9 9 import org.openjdk.jmh.annotations.*; … … 50 50 public void setup() { 51 51 final int length = 1 << LENGTH_POW; 52 buffer = new DirectAccessLongBuffer( length, NOT_SET );52 buffer = new UnsafeLongsBuffer( length, NOT_SET ); 53 53 sequencer = new MCSDSequencer( length ); 54 54 -
Tests/JAVA/logger/src/main/java/com/db/logger/benchmarks/FastLoggerWithoutWriteBenchmark.java
r594 r595 8 8 import com.db.logger.api.LogMessage; 9 9 import com.db.logger.api.impl.logger.*; 10 import com.db.logger.api.impl.logger.buffer. DirectAccessLongBuffer;10 import com.db.logger.api.impl.logger.buffer.UnsafeLongsBuffer; 11 11 import com.db.logger.api.impl.logger.buffer.ILongsBuffer; 12 import com.db.logger.api.impl.logger.formatters.DummyLogBuilder;13 12 import org.apache.log4j.BasicConfigurator; 14 13 import org.apache.log4j.Logger; … … 29 28 public class FastLoggerWithoutWriteBenchmark { 30 29 private static final Logger log = Logger.getLogger( FastLoggerWithoutWriteBenchmark.class ); 31 public static final int LENGTH = Integer.getInteger( "length", 1 << 14 ); 30 public static final int LENGTH_POW = Integer.getInteger( "length-pow", 14 ); 31 public static final int LENGTH = 1 << LENGTH_POW; 32 32 /** 33 33 * It's CELLS-1 arguments + 1 cell for header -- to be consistent with previous … … 35 35 */ 36 36 public static final int CELLS_PER_RECORD = Integer.getInteger( "cells-per-record", 8 );//8longs = 1 cache line 37 public static final int WRITER_BACKOFF= Integer.getInteger( "writer-backoff", 20 );37 public static final int PAYLOAD = Integer.getInteger( "writer-backoff", 20 ); 38 38 39 39 public static final WaitingStrategy WAITING_STRATEGY = new WaitingStrategy.LimitedSpinning( 1024 * 128 ); … … 43 43 static { 44 44 BasicConfigurator.configure(); 45 System.out.printf( "len=%d, record=%d, backoff=%d\n", LENGTH, CELLS_PER_RECORD, WRITER_BACKOFF);45 System.out.printf( "len=%d, record=%d, payload=%d\n", LENGTH, CELLS_PER_RECORD, PAYLOAD ); 46 46 } 47 47 … … 53 53 @Setup 54 54 public void setup() { 55 buffer = new DirectAccessLongBuffer( LENGTH, RecordHelper.NOT_SET );55 buffer = new UnsafeLongsBuffer( LENGTH, RecordHelper.NOT_SET ); 56 56 sequencer = new MCSDSequencer( LENGTH ); 57 57 logger = new FastLoggerImpl( … … 80 80 81 81 /*=============================================================================*/ 82 @GenerateMicroBenchmark83 @Group( "payload" )84 @GroupThreads( 3 )//to be consistent with others85 public void payloadAlone() {86 FluentLogBuilder logBuilder = DummyLogBuilder.INSTANCE.with( 5d );87 final int count = CELLS_PER_RECORD;88 for( int i = 1; i < count; i++ ) {89 logBuilder = logBuilder.with( ( long ) i );90 }91 logBuilder.log();92 BlackHole.consumeCPU( WRITER_BACKOFF);93 }82 // @GenerateMicroBenchmark 83 // @Group( "payload" ) 84 // @GroupThreads( 3 )//to be consistent with others 85 // public void payloadAlone() { 86 // FluentLogBuilder logBuilder = DummyLogBuilder.INSTANCE.with( 5d ); 87 // final int count = CELLS_PER_RECORD; 88 // for( int i = 1; i < count; i++ ) { 89 // logBuilder = logBuilder.with( ( long ) i ); 90 // } 91 // logBuilder.log(); 92 // BlackHole.consumeCPU( PAYLOAD ); 93 // } 94 94 95 95 @GenerateMicroBenchmark … … 105 105 logBuilder = logBuilder.with( ( long ) i ); 106 106 } 107 logBuilder. log();108 109 BlackHole.consumeCPU( WRITER_BACKOFF);107 logBuilder.submit(); 108 109 BlackHole.consumeCPU( PAYLOAD ); 110 110 } 111 111 … … 123 123 logBuilder = logBuilder.with( ( long ) i ); 124 124 } 125 logBuilder. log();126 127 BlackHole.consumeCPU( WRITER_BACKOFF);125 logBuilder.submit(); 126 127 BlackHole.consumeCPU( PAYLOAD ); 128 128 } 129 129 … … 133 133 @GroupThreads( 3 ) 134 134 public void writeRawMessage( final ThreadState ts ) { 135 FluentLogBuilder logBuilder = logger. message( ts.messageFormat)135 FluentLogBuilder logBuilder = logger.log( ts.message ) 136 136 .with( 5d ); 137 137 final int count = CELLS_PER_RECORD - 1; … … 139 139 logBuilder = logBuilder.with( ( long ) i ); 140 140 } 141 logBuilder. log();142 143 BlackHole.consumeCPU( WRITER_BACKOFF);144 } 145 146 @GenerateMicroBenchmark147 @Group( "lookupMessageInfo" )148 @GroupThreads( 3 )149 public Object lookupMessageInfo( final ThreadState ts ) {150 return logger.lookupMessageInfo( ts.messageFormat);151 }141 logBuilder.submit(); 142 143 BlackHole.consumeCPU( PAYLOAD ); 144 } 145 146 // @GenerateMicroBenchmark 147 // @Group( "lookupMessageInfo" ) 148 // @GroupThreads( 3 ) 149 // public Object lookupMessageInfo( final ThreadState ts ) { 150 // return logger.lookupMessageInfo( ts.message ); 151 // } 152 152 153 153 @State( Scope.Thread ) … … 155 155 public final int id = ID_GENERATOR.incrementAndGet(); 156 156 157 public final String message Format;157 public final String message; 158 158 159 159 public ThreadState() { … … 165 165 sb.append( " %d" ); 166 166 } 167 message Format= sb.toString();167 message = sb.toString(); 168 168 } 169 169 } … … 175 175 176 176 public void setup( final FastLoggerWithoutWriteBenchmark b ) { 177 simpleMessage = b.logger.messageSimple( message Format);177 simpleMessage = b.logger.messageSimple( message ); 178 178 } 179 179 } … … 185 185 186 186 public void setup( final FastLoggerWithoutWriteBenchmark b ) { 187 threadLocalMessage = b.logger.messageThreadLocal( message Format);187 threadLocalMessage = b.logger.messageThreadLocal( message ); 188 188 } 189 189 } -
Tests/JAVA/logger/src/main/java/com/db/logger/benchmarks/GFLoggerBenchmark.java
r594 r595 1 1 package com.db.logger.benchmarks; 2 2 3 import java.util.concurrent.ThreadFactory;4 3 import java.util.concurrent.TimeUnit; 5 4 import java.util.concurrent.atomic.AtomicInteger; … … 8 7 import com.db.logger.api.LogMessage; 9 8 import com.db.logger.api.impl.logger.*; 10 import com.db.logger.api.impl.logger.buffer.DirectAccessLongBuffer;11 import com.db.logger.api.impl.logger.buffer.ILongsBuffer;12 import com.db.logger.api.impl.logger.formatters.DummyLogBuilder;13 9 import org.apache.log4j.BasicConfigurator; 14 10 import org.apache.log4j.Logger; 11 import org.gflogger.*; 12 import org.gflogger.appender.AppenderFactory; 13 import org.gflogger.appender.FileAppenderFactory; 14 import org.gflogger.disruptor.LoggerServiceImpl; 15 15 import org.openjdk.jmh.annotations.*; 16 16 import org.openjdk.jmh.logic.BlackHole; 17 18 import static org.gflogger.helpers.OptionConverter.getIntProperty; 17 19 18 20 /** … … 27 29 @OutputTimeUnit( TimeUnit.NANOSECONDS ) 28 30 @State( Scope.Group ) 29 public class FastLoggerWithoutWriteBenchmark { 30 private static final Logger log = Logger.getLogger( FastLoggerWithoutWriteBenchmark.class ); 31 public static final int LENGTH = Integer.getInteger( "length", 1 << 14 ); 31 public class GFLoggerBenchmark { 32 private static final Logger log = Logger.getLogger( GFLoggerBenchmark.class ); 33 public static final int LENGTH_POW = Integer.getInteger( "length-pow", 14 ); 34 public static final int LENGTH = 1 << LENGTH_POW; 32 35 /** 33 36 * It's CELLS-1 arguments + 1 cell for header -- to be consistent with previous … … 35 38 */ 36 39 public static final int CELLS_PER_RECORD = Integer.getInteger( "cells-per-record", 8 );//8longs = 1 cache line 37 public static final int WRITER_BACKOFF = Integer.getInteger( "writer-backoff", 20 );38 40 39 public static final WaitingStrategy WAITING_STRATEGY = new WaitingStrategy.LimitedSpinning( 1024 * 128 ); 41 public static final int MAX_MESSAGE_SIZE = getIntProperty( "gflogger.service.maxMessageSize", 1 << 8 ); 42 43 public static final int PAYLOAD = Integer.getInteger( "writer-backoff", 20 ); 40 44 41 45 public static final AtomicInteger ID_GENERATOR = new AtomicInteger( 1 ); … … 43 47 static { 44 48 BasicConfigurator.configure(); 45 System.out.printf( "len=%d, record=%d, backoff=%d\n", LENGTH, CELLS_PER_RECORD, WRITER_BACKOFF);49 System.out.printf( "len=%d, record=%d, payload=%d\n", LENGTH, CELLS_PER_RECORD, PAYLOAD ); 46 50 } 47 51 48 public ILongsBuffer buffer;49 public MCSDSequencer sequencer;50 52 51 public FastLoggerImpl logger; 53 public LoggerService gfloggerService; 54 public GFLog gflog; 52 55 53 56 @Setup 54 57 public void setup() { 55 buffer = new DirectAccessLongBuffer( LENGTH, RecordHelper.NOT_SET ); 56 sequencer = new MCSDSequencer( LENGTH ); 57 logger = new FastLoggerImpl( 58 new ThreadFactory() { 59 @Override 60 public Thread newThread( final Runnable r ) { 61 return new Thread( r ); 62 } 63 }, 64 buffer, 65 WAITING_STRATEGY, 66 new FakeRawWriter() 67 ); 68 logger.startDraining(); 58 gfloggerService = createLoggerImpl(); 59 60 GFLogFactory.init( gfloggerService ); 61 62 this.gflog = GFLogFactory.getLog( "com.db.fxpricing.Logger" ); 69 63 } 70 64 71 65 @TearDown 72 66 public void tearDown() throws Exception { 73 logger.stopDraining();67 GFLogFactory.stop(); 74 68 } 75 69 … … 84 78 @GroupThreads( 3 )//to be consistent with others 85 79 public void payloadAlone() { 86 FluentLogBuilder logBuilder = DummyLogBuilder.INSTANCE.with( 5d ); 87 final int count = CELLS_PER_RECORD; 88 for( int i = 1; i < count; i++ ) { 89 logBuilder = logBuilder.with( ( long ) i ); 90 } 91 logBuilder.log(); 92 BlackHole.consumeCPU( WRITER_BACKOFF ); 80 BlackHole.consumeCPU( PAYLOAD ); 93 81 } 94 82 83 84 /*=============================================================================*/ 95 85 @GenerateMicroBenchmark 96 @Group( "log SimpleAndPayload" )86 @Group( "logAppendingAndPayload" ) 97 87 @GroupThreads( 3 ) 98 public void writeSimpleMessage( final ThreadStateSimple ts ) { 99 if( ts.simpleMessage == null ) { 100 ts.setup( this ); 101 } 102 FluentLogBuilder logBuilder = ts.simpleMessage.with( 5d ); 88 public void writeLogAppending( final ThreadState ts ) { 89 final GFLogEntry entry = gflog.info(); 90 91 entry.append( ' ' ).append( 5d ); 103 92 final int count = CELLS_PER_RECORD - 1; 104 93 for( int i = 1; i < count; i++ ) { 105 logBuilder = logBuilder.with( ( long ) i );94 entry.append( ' ' ).append( ( long ) i ); 106 95 } 107 logBuilder.log();96 entry.commit(); 108 97 109 BlackHole.consumeCPU( WRITER_BACKOFF);98 BlackHole.consumeCPU( PAYLOAD ); 110 99 } 111 100 112 101 /*=============================================================================*/ 113 102 @GenerateMicroBenchmark 114 @Group( "log TLAndPayload" )103 @Group( "logFormattingAndPayload" ) 115 104 @GroupThreads( 3 ) 116 public void writeTLMessage( final ThreadStateTL ts ) { 117 if( ts.threadLocalMessage == null ) { 118 ts.setup( this ); 119 } 120 FluentLogBuilder logBuilder = ts.threadLocalMessage.with( 5d ); 105 public void writeRawMessage( final ThreadState ts ) { 106 final FormattedGFLogEntry entry = gflog.info( ts.message ).with( 5d ); 121 107 final int count = CELLS_PER_RECORD - 1; 122 108 for( int i = 1; i < count; i++ ) { 123 logBuilder = logBuilder.with( ( long ) i );109 entry.with( ( long ) i ); 124 110 } 125 logBuilder.log();126 111 127 BlackHole.consumeCPU( WRITER_BACKOFF ); 128 } 129 130 /*=============================================================================*/ 131 @GenerateMicroBenchmark 132 @Group( "logAndPayload" ) 133 @GroupThreads( 3 ) 134 public void writeRawMessage( final ThreadState ts ) { 135 FluentLogBuilder logBuilder = logger.message( ts.messageFormat ) 136 .with( 5d ); 137 final int count = CELLS_PER_RECORD - 1; 138 for( int i = 1; i < count; i++ ) { 139 logBuilder = logBuilder.with( ( long ) i ); 140 } 141 logBuilder.log(); 142 143 BlackHole.consumeCPU( WRITER_BACKOFF ); 144 } 145 146 @GenerateMicroBenchmark 147 @Group( "lookupMessageInfo" ) 148 @GroupThreads( 3 ) 149 public Object lookupMessageInfo( final ThreadState ts ) { 150 return logger.lookupMessageInfo( ts.messageFormat ); 112 BlackHole.consumeCPU( PAYLOAD ); 151 113 } 152 114 … … 155 117 public final int id = ID_GENERATOR.incrementAndGet(); 156 118 157 public final String message Format;119 public final String message; 158 120 159 121 public ThreadState() { … … 165 127 sb.append( " %d" ); 166 128 } 167 message Format= sb.toString();129 message = sb.toString(); 168 130 } 169 131 } 170 132 171 @State( Scope.Thread )172 public static class ThreadStateSimple extends ThreadState {173 133 174 public LogMessage simpleMessage; 134 protected AppenderFactory[] createAppenderFactories() { 135 final FileAppenderFactory fileAppender = new FileAppenderFactory(); 136 fileAppender.setLogLevel( LogLevel.INFO ); 137 fileAppender.setFileName( "log.log" ); 138 fileAppender.setAppend( false ); 139 fileAppender.setImmediateFlush( false ); 140 fileAppender.setLayout( new PatternLayout( "%d{HH:mm:ss,SSS zzz} %p %m [%c{2}] [%t]%n" ) ); 175 141 176 public void setup( final FastLoggerWithoutWriteBenchmark b ) { 177 simpleMessage = b.logger.messageSimple( messageFormat ); 178 } 142 return new AppenderFactory[] { fileAppender }; 179 143 } 180 144 181 @State( Scope.Thread ) 182 public static class ThreadStateTL extends ThreadState { 145 protected LoggerService createLoggerImpl() { 146 final AppenderFactory[] factories = createAppenderFactories(); 147 final GFLoggerBuilder[] loggers = { 148 new GFLoggerBuilder( 149 LogLevel.INFO, 150 "com.db", 151 factories 152 ) 153 }; 183 154 184 public LogMessage threadLocalMessage; 185 186 public void setup( final FastLoggerWithoutWriteBenchmark b ) { 187 threadLocalMessage = b.logger.messageThreadLocal( messageFormat ); 188 } 155 final int count = LENGTH / MAX_MESSAGE_SIZE; 156 final LoggerService impl = new LoggerServiceImpl( 157 count, 158 MAX_MESSAGE_SIZE, 159 loggers, 160 factories 161 ); 162 return impl; 189 163 } 190 164 -
Tests/JAVA/logger/src/main/java/com/db/logger/benchmarks/MultiBuffersWriteAndDrainBenchmark.java
r594 r595 7 7 8 8 import com.db.logger.api.impl.logger.*; 9 import com.db.logger.api.impl.logger.buffer. DirectAccessLongBuffer;9 import com.db.logger.api.impl.logger.buffer.UnsafeLongsBuffer; 10 10 import com.db.logger.api.impl.logger.buffer.ILongsBuffer; 11 11 import org.openjdk.jmh.annotations.*; … … 158 158 public ThreadState() { 159 159 final int length = 1 << LENGTH_POW; 160 final DirectAccessLongBuffer longBuffer = new DirectAccessLongBuffer(160 final UnsafeLongsBuffer longBuffer = new UnsafeLongsBuffer( 161 161 length, 162 162 RecordHelper.NOT_SET -
Tests/JAVA/logger/src/main/java/com/db/logger/benchmarks/PerThreadMappedFileBenchmark.java
r594 r595 1 1 package com.db.logger.benchmarks; 2 2 3 import java.io.File; 4 import java.io.FileOutputStream; 5 import java.nio.ByteBuffer; 6 import java.nio.channels.FileChannel; 3 7 import java.util.*; 4 8 import java.util.concurrent.CopyOnWriteArrayList; … … 7 11 8 12 import com.db.logger.api.impl.logger.*; 9 import com.db.logger.api.impl.logger.buffer.DirectAccessLongBuffer;10 13 import com.db.logger.api.impl.logger.buffer.ILongsBuffer; 14 import com.db.logger.api.impl.logger.buffer.UnsafeLongsBuffer; 11 15 import org.openjdk.jmh.annotations.*; 12 16 import org.openjdk.jmh.logic.BlackHole; … … 26 30 @OutputTimeUnit( TimeUnit.NANOSECONDS ) 27 31 @State( Scope.Group ) 28 public class MultiBuffersWriteAndDrainBenchmark {32 public class PerThreadMappedFileBenchmark { 29 33 public static final int LENGTH_POW = Integer.getInteger( "length-pow", 14 ); 30 34 public static final int CELLS_PER_RECORD = Integer.getInteger( "cells-per-record", 8 );//8longs = 1 cache line … … 88 92 try { 89 93 for( final ThreadState ts : states ) { 90 ts. ringBuffer.drainTo( DRAIN_DUMMY );94 ts.sequencer.drainTo( DRAIN_DUMMY ); 91 95 } 92 96 BlackHole.consumeCPU( 10 ); … … 99 103 100 104 /*=============================================================================*/ 101 @GenerateMicroBenchmark102 @Group( "writeAndPayloadAndDrainAndRead" )103 @GroupThreads( 3 ) //actually it's (CORES-1)104 public void writer2( final ThreadState ts ) {105 writeEntry( ts, ts.id, ts.count );106 BlackHole.consumeCPU( WRITER_BACKOFF );107 }108 109 @GenerateMicroBenchmark110 @Group( "writeAndPayloadAndDrainAndRead" )111 @GroupThreads( 1 )112 public void readingDrainer() {113 //mostly we do not care about drain latency here, measure just to be aware of it114 try {115 for( final ThreadState ts : states ) {116 ts.ringBuffer.drainTo( ts.consumingDrainer );117 }118 // BlackHole.consumeCPU( 100 );119 } catch( Throwable e ) {120 e.printStackTrace();121 }122 }123 124 /*=============================================================================*/125 105 126 106 private void writeEntry( final ThreadState ts, 127 107 final int writerId, 128 108 final int cellsCount ) { 129 final long position = ts. ringBuffer.claim( cellsCount );109 final long position = ts.sequencer.claim( cellsCount ); 130 110 if( position < 0 ) { 131 111 System.err.println( "Timeout" ); … … 133 113 } 134 114 //reserve 0-th cell for header 135 final ILongsBuffer data = ts.ringBuffer.buffer();136 for( int i = 1; i < cellsCount; i++ ) {137 data.put( position + i, i );138 }139 //write header with SA140 data.putOrdered(141 position,142 header(143 LOG_RECORD,144 writerId,145 cellsCount - 1146 )147 );115 final ByteBuffer data = ts.buffer; 116 // for( int i = 1; i < cellsCount; i++ ) { 117 // data.put( position + i, i ); 118 // } 119 // //write header with SA 120 // data.put( 121 // position, 122 // header( 123 // LOG_RECORD, 124 // writerId, 125 // cellsCount - 1 126 // ) 127 // ); 148 128 } 149 129 … … 153 133 public final int count = CELLS_PER_RECORD;//but 1 for header 154 134 155 public RingBuffer ringBuffer;135 public SCSDSequencer sequencer; 156 136 public Sequencer.Drainer consumingDrainer; 137 public ByteBuffer buffer; 157 138 158 public ThreadState() { 159 final int length = 1 << LENGTH_POW; 160 final DirectAccessLongBuffer longBuffer = new DirectAccessLongBuffer( 161 length, 162 RecordHelper.NOT_SET 139 public ThreadState() throws Exception { 140 final int length = ( 1 << LENGTH_POW ); 141 142 this.sequencer = new SCSDSequencer( length ); 143 final File file = new File( "" ); 144 final FileChannel channel = new FileOutputStream( file ).getChannel(); 145 this.buffer = channel.map( 146 FileChannel.MapMode.READ_WRITE, 147 0, 148 length << 3 163 149 ); 164 165 ringBuffer = new RingBuffer(166 new SCSDSequencer( length ),167 longBuffer,168 WAITING_STRATEGY169 );170 171 consumingDrainer = new ConsumingDrainer( longBuffer );172 150 } 173 151 … … 184 162 185 163 public static void main( final String[] args ) throws Exception { 186 final MultiBuffersWriteAndDrainBenchmark benchmark = new MultiBuffersWriteAndDrainBenchmark();187 188 benchmark.setup();189 190 final ThreadState[] states = new ThreadState[3];191 for( int i = 0; i < states.length; i++ ) {192 final ThreadState state = new ThreadState();193 states[i] = state;194 new Thread() {195 @Override196 public void run() {197 for(; ; ) {198 benchmark.writer2( state );199 }200 }201 }.start();202 }203 204 new Thread() {205 @Override206 public void run() {207 for(; ; ) {208 benchmark.readingDrainer();209 }210 }211 }.start();212 213 Thread.sleep( 300000 );164 // final PerThreadMappedFileBenchmark benchmark = new PerThreadMappedFileBenchmark(); 165 // 166 // benchmark.setup(); 167 // 168 // final ThreadState[] states = new ThreadState[3]; 169 // for( int i = 0; i < states.length; i++ ) { 170 // final ThreadState state = new ThreadState(); 171 // states[i] = state; 172 // new Thread() { 173 // @Override 174 // public void run() { 175 // for(; ; ) { 176 // benchmark.writer2( state ); 177 // } 178 // } 179 // }.start(); 180 // } 181 // 182 // new Thread() { 183 // @Override 184 // public void run() { 185 // for(; ; ) { 186 // benchmark.readingDrainer(); 187 // } 188 // } 189 // }.start(); 190 // 191 // Thread.sleep( 300000 ); 214 192 } 215 193 -
Tests/JAVA/logger/src/main/java/com/db/logger/benchmarks/RawLogMessageWriteAndDrainBenchmark.java
r594 r595 6 6 import com.db.logger.api.FluentLogBuilder; 7 7 import com.db.logger.api.impl.logger.*; 8 import com.db.logger.api.impl.logger.buffer. DirectAccessLongBuffer;8 import com.db.logger.api.impl.logger.buffer.UnsafeLongsBuffer; 9 9 import com.db.logger.api.impl.logger.buffer.ILongsBuffer; 10 10 import com.db.logger.api.impl.logger.formatters.RawLogMessage; … … 41 41 @Setup 42 42 public void setup() { 43 buffer = new DirectAccessLongBuffer( LENGTH, RecordHelper.NOT_SET );43 buffer = new UnsafeLongsBuffer( LENGTH, RecordHelper.NOT_SET ); 44 44 sequencer = new MCSDSequencer( LENGTH ); 45 45 … … 78 78 logBuilder = logBuilder.with( ( long ) i ); 79 79 } 80 logBuilder. log();80 logBuilder.submit(); 81 81 82 82 BlackHole.consumeCPU( WRITER_BACKOFF ); -
Tests/JAVA/logger/src/main/java/com/db/logger/benchmarks/SimpleLogMessageWriteAndDrainBenchmark.java
r594 r595 6 6 import com.db.logger.api.FluentLogBuilder; 7 7 import com.db.logger.api.impl.logger.*; 8 import com.db.logger.api.impl.logger.buffer. DirectAccessLongBuffer;8 import com.db.logger.api.impl.logger.buffer.UnsafeLongsBuffer; 9 9 import com.db.logger.api.impl.logger.buffer.ILongsBuffer; 10 10 import com.db.logger.api.impl.logger.formatters.SimpleLogMessageExpanded; … … 39 39 @Setup 40 40 public void setup() { 41 buffer = new DirectAccessLongBuffer( LENGTH, RecordHelper.NOT_SET );41 buffer = new UnsafeLongsBuffer( LENGTH, RecordHelper.NOT_SET ); 42 42 sequencer = new MCSDSequencer( LENGTH ); 43 43 … … 75 75 logBuilder = logBuilder.with( ( long ) i ); 76 76 } 77 logBuilder. log();77 logBuilder.submit(); 78 78 79 79 BlackHole.consumeCPU( WRITER_BACKOFF ); -
Tests/JAVA/logger/src/main/java/com/db/logger/benchmarks/helpers/SCSDSequencerBenchmark.java
r594 r595 28 28 private static final Logger log = Logger.getLogger( SCSDSequencerBenchmark.class ); 29 29 30 public static final int LENGTH = Integer.getInteger( "length", 1 << 14 ); 30 public static final int LENGTH_POW = Integer.getInteger( "length-pow", 14 ); 31 public static final int LENGTH = 1 << LENGTH_POW; 31 32 public static final int CELLS_PER_RECORD = Integer.getInteger( "record-size", 8 );//8longs = 1 cache line 32 public static final int WRITER_BACKOFF = Integer.getInteger( "writer-backoff", 7);33 public static final int PAYLOAD = Integer.getInteger( "writer-backoff", 0 ); 33 34 34 35 public static final WaitingStrategy WAITING_STRATEGY = new WaitingStrategy.LimitedSpinning( 1024 * 128 ); … … 36 37 static { 37 38 BasicConfigurator.configure(); 38 System.out.printf( "len=%d, record=%d, payload=%d\n", LENGTH, CELLS_PER_RECORD, WRITER_BACKOFF);39 System.out.printf( "len=%d, record=%d, payload=%d\n", LENGTH, CELLS_PER_RECORD, PAYLOAD ); 39 40 } 40 41 … … 72 73 @GroupThreads( 4 ) 73 74 public void backoffAlone() { 74 BlackHole.consumeCPU( WRITER_BACKOFF);75 BlackHole.consumeCPU( PAYLOAD ); 75 76 } 76 77 … … 81 82 public void claimer3( final ThreadState ts ) { 82 83 claimEntry( ts.sequencer, ts.id, ts.count ); 83 BlackHole.consumeCPU( WRITER_BACKOFF);84 BlackHole.consumeCPU( PAYLOAD ); 84 85 } 85 86 … … 91 92 ts.sequencer.drainTo( DRAIN_DUMMY ); 92 93 } 93 // BlackHole.consumeCPU( WRITER_BACKOFF);94 // BlackHole.consumeCPU( 0 ); 94 95 } 95 96 … … 126 127 benchmark.setup(); 127 128 128 final int BATCH = 1000000 ;129 final int BATCH = 10000000; 129 130 final ThreadState[] states = new ThreadState[3]; 130 131 for( int i = 0; i < states.length; i++ ) { … … 134 135 @Override 135 136 public void run() { 137 state.setup(); 136 138 for( int turn = 0; ; turn += BATCH ) { 137 139 for( int i = 0; i < BATCH; i++ ) { … … 140 142 log.info( "Thread " + state.id + ": " + turn ); 141 143 } 144 // state.destroy(); 142 145 } 143 146 }.start(); -
Tests/JAVA/logger/src/main/java/com/db/logger/benchmarks/helpers/ThreadLocalBenchmark.java
r590 r595 14 14 @State( Scope.Benchmark ) 15 15 public class ThreadLocalBenchmark { 16 // public static final int WRITER_BACKOFF= Integer.getInteger( "writer-backoff", 0 );16 // public static final int PAYLOAD = Integer.getInteger( "writer-backoff", 0 ); 17 17 18 18 public ThreadLocal<Long> counter = new ThreadLocal<Long>(){ -
Tests/JAVA/logger/src/test/java/com/db/logger/api/impl/logger/UnsafeLongBufferTest.java
r594 r595 1 1 package com.db.logger.api.impl.logger; 2 2 3 import com.db.logger.api.impl.logger.buffer. DirectAccessLongBuffer;3 import com.db.logger.api.impl.logger.buffer.UnsafeLongsBuffer; 4 4 import com.db.logger.api.impl.logger.buffer.ILongsBuffer; 5 5 … … 8 8 * created 22.11.13 at 23:24 9 9 */ 10 public class DirectAccessLongBufferTest extends LongBufferTestBase {10 public class UnsafeLongBufferTest extends LongBufferTestBase { 11 11 @Override 12 12 protected ILongsBuffer buffer( final int length ) { 13 return new DirectAccessLongBuffer( length );13 return new UnsafeLongsBuffer( length ); 14 14 } 15 15 16 public DirectAccessLongBufferTest( final int length ) {16 public UnsafeLongBufferTest( final int length ) { 17 17 super( length ); 18 18 }
Note: See TracChangeset
for help on using the changeset viewer.