Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/databases/cassandra4/files/maven/build-bench.xml
46786 views
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<!--
3
Licensed to the Apache Software Foundation (ASF) under one
4
or more contributor license agreements. See the NOTICE file
5
distributed with this work for additional information
6
regarding copyright ownership. The ASF licenses this file
7
to you under the Apache License, Version 2.0 (the
8
"License"); you may not use this file except in compliance
9
with the License. You may obtain a copy of the License at
10
11
http://www.apache.org/licenses/LICENSE-2.0
12
13
Unless required by applicable law or agreed to in writing, software
14
distributed under the License is distributed on an "AS IS" BASIS,
15
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
See the License for the specific language governing permissions and
17
limitations under the License.
18
-->
19
<project basedir="." name="apache-cassandra-bench"
20
xmlns:if="ant:if" xmlns:unless="ant:unless">
21
22
<property name="async-profiler.version" value="2.9"/>
23
<condition property="async-profiler.suffix" value="linux-arm64">
24
<and>
25
<os arch="aarch64"/>
26
<isset property="isLinux"/>
27
</and>
28
</condition>
29
<condition property="async-profiler.suffix" value="linux-x64">
30
<and>
31
<os arch="amd64"/>
32
<isset property="isLinux"/>
33
</and>
34
</condition>
35
<condition property="async-profiler.suffix" value="macos">
36
<isset property="isMac"/>
37
</condition>
38
<property name="async-profiler.name" value="async-profiler-${async-profiler.version}-${async-profiler.suffix}"/>
39
<property name="async-profiler.base" value="${build.dir}/async-profiler"/>
40
41
<property name="test.profiler.opts.default" value="event=cpu;threads=true;output=flamegraph;simple=true;ann=true"/>
42
<property name="test.profiler.output" value="${build.test.dir}/profiler"/>
43
44
<target name="-microbench">
45
<jmh/>
46
</target>
47
48
<target name="-microbench-with-profiler" depends="-fetch-async-profiler">
49
<condition property="test.profiler.opts" value="${test.profiler.opts.default}" else="${profiler.opts}">
50
<or>
51
<not>
52
<isset property="profiler.opts"/>
53
</not>
54
<equals arg1="${profiler.opts}" arg2=""/>
55
</or>
56
</condition>
57
58
<property name="async-profiler.lib.path" value="${async-profiler.base}/build/libasyncProfiler.so"/>
59
60
<mkdir dir="${test.profiler.output}"/>
61
62
<jmh>
63
<extra-args>
64
<arg value="-prof"/>
65
<arg value="async:libPath=${async-profiler.lib.path};dir=${test.profiler.output};${test.profiler.opts}"/>
66
</extra-args>
67
</jmh>
68
</target>
69
70
<macrodef name="jmh">
71
<element name="extra-args" optional="true"/>
72
<sequential>
73
<java classname="org.openjdk.jmh.Main" fork="true" failonerror="true" >
74
<classpath>
75
<path refid="cassandra.classpath.test"/>
76
<pathelement location="${test.classes}"/>
77
<pathelement location="${test.conf}"/>
78
<pathelement location="${async-profiler.base}/lib/async-profiler.jar"/>
79
<pathelement location="${async-profiler.base}/lib/converter.jar"/>
80
</classpath>
81
82
<jvmarg line="${java11-jvmargs}"/>
83
<jvmarg line="${_std-test-jvmargs}"/>
84
<jvmarg line="${test.jvm.args}"/>
85
86
<arg value="-foe"/>
87
<arg value="true"/>
88
<arg value="-rf"/>
89
<arg value="json"/>
90
<arg value="-rff"/>
91
<arg value="${build.test.dir}/jmh-result.json"/>
92
<arg value="-v"/>
93
<arg value="EXTRA"/>
94
95
<arg line="${jmh.args}"/>
96
97
<extra-args/>
98
99
<!-- TODO https://issues.apache.org/jira/browse/CASSANDRA-18873 -->
100
<arg value="-e" if:blank="${benchmark.name}"/>
101
<arg value="ZeroCopyStreamingBench|MutationBench|FastThreadLocalBench" if:blank="${benchmark.name}"/>
102
103
<arg value=".*microbench.*${benchmark.name}"/>
104
</java>
105
</sequential>
106
</macrodef>
107
108
<target name="-fetch-async-profiler">
109
<mkdir dir="${tmp.dir}"/>
110
<mkdir dir="${async-profiler.base}"/>
111
112
<antcall target="-fetch-async-profiler-mac" if:true="${isMac}" inheritrefs="true"/>
113
<antcall target="-fetch-async-profiler-linux" if:true="${isLinux}" inheritrefs="true"/>
114
115
<move todir="${async-profiler.base}">
116
<fileset dir="${async-profiler.base}/${async-profiler.name}">
117
<include name="**"/>
118
</fileset>
119
</move>
120
<delete dir="${async-profiler.base}/${async-profiler.name}" includeemptydirs="true"/>
121
</target>
122
123
<target name="-fetch-async-profiler-linux">
124
<get src="https://github.com/async-profiler/async-profiler/releases/download/v${async-profiler.version}/${async-profiler.name}.tar.gz"
125
dest="${tmp.dir}/${async-profiler.name}.tar.gz" retries="3" httpusecaches="true" skipexisting="true"/>
126
<gunzip src="${tmp.dir}/${async-profiler.name}.tar.gz" dest="${tmp.dir}/"/>
127
<untar src="${tmp.dir}/${async-profiler.name}.tar" dest="${async-profiler.base}/"/>
128
<delete file="${tmp.dir}/${async-profiler.name}.tar"/>
129
</target>
130
131
<target name="-fetch-async-profiler-mac">
132
<get src="https://github.com/async-profiler/async-profiler/releases/download/v${async-profiler.version}/${async-profiler.name}.zip"
133
dest="${tmp.dir}/${async-profiler.name}.zip" retries="3" httpusecaches="true" skipexisting="true"/>
134
<unzip src="${tmp.dir}/${async-profiler.name}.zip" dest="${async-profiler.base}/"/>
135
</target>
136
137
</project>
138
139