Path: blob/main/databases/cassandra4/files/maven/build-bench.xml
46786 views
<?xml version="1.0" encoding="UTF-8" standalone="no"?>1<!--2Licensed to the Apache Software Foundation (ASF) under one3or more contributor license agreements. See the NOTICE file4distributed with this work for additional information5regarding copyright ownership. The ASF licenses this file6to you under the Apache License, Version 2.0 (the7"License"); you may not use this file except in compliance8with the License. You may obtain a copy of the License at910http://www.apache.org/licenses/LICENSE-2.01112Unless required by applicable law or agreed to in writing, software13distributed under the License is distributed on an "AS IS" BASIS,14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15See the License for the specific language governing permissions and16limitations under the License.17-->18<project basedir="." name="apache-cassandra-bench"19xmlns:if="ant:if" xmlns:unless="ant:unless">2021<property name="async-profiler.version" value="2.9"/>22<condition property="async-profiler.suffix" value="linux-arm64">23<and>24<os arch="aarch64"/>25<isset property="isLinux"/>26</and>27</condition>28<condition property="async-profiler.suffix" value="linux-x64">29<and>30<os arch="amd64"/>31<isset property="isLinux"/>32</and>33</condition>34<condition property="async-profiler.suffix" value="macos">35<isset property="isMac"/>36</condition>37<property name="async-profiler.name" value="async-profiler-${async-profiler.version}-${async-profiler.suffix}"/>38<property name="async-profiler.base" value="${build.dir}/async-profiler"/>3940<property name="test.profiler.opts.default" value="event=cpu;threads=true;output=flamegraph;simple=true;ann=true"/>41<property name="test.profiler.output" value="${build.test.dir}/profiler"/>4243<target name="-microbench">44<jmh/>45</target>4647<target name="-microbench-with-profiler" depends="-fetch-async-profiler">48<condition property="test.profiler.opts" value="${test.profiler.opts.default}" else="${profiler.opts}">49<or>50<not>51<isset property="profiler.opts"/>52</not>53<equals arg1="${profiler.opts}" arg2=""/>54</or>55</condition>5657<property name="async-profiler.lib.path" value="${async-profiler.base}/build/libasyncProfiler.so"/>5859<mkdir dir="${test.profiler.output}"/>6061<jmh>62<extra-args>63<arg value="-prof"/>64<arg value="async:libPath=${async-profiler.lib.path};dir=${test.profiler.output};${test.profiler.opts}"/>65</extra-args>66</jmh>67</target>6869<macrodef name="jmh">70<element name="extra-args" optional="true"/>71<sequential>72<java classname="org.openjdk.jmh.Main" fork="true" failonerror="true" >73<classpath>74<path refid="cassandra.classpath.test"/>75<pathelement location="${test.classes}"/>76<pathelement location="${test.conf}"/>77<pathelement location="${async-profiler.base}/lib/async-profiler.jar"/>78<pathelement location="${async-profiler.base}/lib/converter.jar"/>79</classpath>8081<jvmarg line="${java11-jvmargs}"/>82<jvmarg line="${_std-test-jvmargs}"/>83<jvmarg line="${test.jvm.args}"/>8485<arg value="-foe"/>86<arg value="true"/>87<arg value="-rf"/>88<arg value="json"/>89<arg value="-rff"/>90<arg value="${build.test.dir}/jmh-result.json"/>91<arg value="-v"/>92<arg value="EXTRA"/>9394<arg line="${jmh.args}"/>9596<extra-args/>9798<!-- TODO https://issues.apache.org/jira/browse/CASSANDRA-18873 -->99<arg value="-e" if:blank="${benchmark.name}"/>100<arg value="ZeroCopyStreamingBench|MutationBench|FastThreadLocalBench" if:blank="${benchmark.name}"/>101102<arg value=".*microbench.*${benchmark.name}"/>103</java>104</sequential>105</macrodef>106107<target name="-fetch-async-profiler">108<mkdir dir="${tmp.dir}"/>109<mkdir dir="${async-profiler.base}"/>110111<antcall target="-fetch-async-profiler-mac" if:true="${isMac}" inheritrefs="true"/>112<antcall target="-fetch-async-profiler-linux" if:true="${isLinux}" inheritrefs="true"/>113114<move todir="${async-profiler.base}">115<fileset dir="${async-profiler.base}/${async-profiler.name}">116<include name="**"/>117</fileset>118</move>119<delete dir="${async-profiler.base}/${async-profiler.name}" includeemptydirs="true"/>120</target>121122<target name="-fetch-async-profiler-linux">123<get src="https://github.com/async-profiler/async-profiler/releases/download/v${async-profiler.version}/${async-profiler.name}.tar.gz"124dest="${tmp.dir}/${async-profiler.name}.tar.gz" retries="3" httpusecaches="true" skipexisting="true"/>125<gunzip src="${tmp.dir}/${async-profiler.name}.tar.gz" dest="${tmp.dir}/"/>126<untar src="${tmp.dir}/${async-profiler.name}.tar" dest="${async-profiler.base}/"/>127<delete file="${tmp.dir}/${async-profiler.name}.tar"/>128</target>129130<target name="-fetch-async-profiler-mac">131<get src="https://github.com/async-profiler/async-profiler/releases/download/v${async-profiler.version}/${async-profiler.name}.zip"132dest="${tmp.dir}/${async-profiler.name}.zip" retries="3" httpusecaches="true" skipexisting="true"/>133<unzip src="${tmp.dir}/${async-profiler.name}.zip" dest="${async-profiler.base}/"/>134</target>135136</project>137138139