You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/01/19 10:25:41 UTC

[GitHub] [apisix] tokers commented on a change in pull request #6136: ci: support for generating flame graph

tokers commented on a change in pull request #6136:
URL: https://github.com/apache/apisix/pull/6136#discussion_r787593684



##########
File path: ci/performance_test.sh
##########
@@ -0,0 +1,117 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+. ./ci/common.sh
+
+set -ex
+
+install_dependencies() {
+    apt-get -y update --fix-missing
+    apt-get -y install lua5.1 liblua5.1-0-dev libldap2-dev
+    export_or_prefix
+    export OPENRESTY_VERSION=source
+    ./utils/linux-install-openresty.sh
+    bash utils/install-dependencies.sh install_luarocks
+    make deps
+}
+
+install_wrk2() {
+    cd ..
+    git clone https://github.com/giltene/wrk2
+    cd wrk2 || true
+    make
+    ln -s $PWD/wrk /usr/bin
+    cd ..
+}
+
+install_stap_tools() {
+    # install ddeb source repo
+    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C8CAB6595FDFF622
+
+    codename=$(lsb_release -c | awk  '{print $2}')
+    sudo tee /etc/apt/sources.list.d/ddebs.list << EOF
+    deb http://ddebs.ubuntu.com/ ${codename}      main restricted universe multiverse
+    deb http://ddebs.ubuntu.com/ ${codename}-updates  main restricted universe multiverse
+    deb http://ddebs.ubuntu.com/ ${codename}-proposed main restricted universe multiverse
+EOF
+
+    sudo apt-get update
+    sudo apt-get install linux-image-$(uname -r)-dbgsym
+    sudo apt install elfutils libdw-dev
+    sudo apt-get install -y python3-setuptools python3-wheel
+
+    # install systemtap
+    cd /usr/local/
+    wget http://sourceware.org/systemtap/ftp/releases/systemtap-4.6.tar.gz
+    tar -zxf systemtap-4.6.tar.gz
+    mv systemtap-4.6 systemtap
+    cd systemtap
+    ./configure && make all && sudo make install &&  stap --version
+    cd ..
+
+    # see https://github.com/openresty/stapxx/pull/48
+    git clone https://github.com/api7/stapxx.git -b luajit-gc64
+    git clone https://github.com/openresty/openresty-systemtap-toolkit.git
+    git clone https://github.com/brendangregg/FlameGraph.git
+}
+
+
+run_performance_test() {
+    sudo chmod -R 777 ./
+    ulimit -n 10240
+
+    pip3 install -r t/perf/requirements.txt --user
+
+    #openresty-debug
+    export OPENRESTY_PREFIX="/usr/local/openresty-debug"
+    export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/bin:$OPENRESTY_PREFIX/luajit/bin:$PATH
+
+    mkdir output
+    python3 ./t/perf/test_http.py >$PWD/output/performance.txt 2>&1 &

Review comment:
       Does this script end up automatically?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org