Debian Codegraph @

tools/run_tests/performance/kill_workers.sh

raw
1 #!/bin/bash
2 # Copyright 2015 gRPC authors.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 set -ex
17
18 cd "$(dirname "$0")/../../.."
19
20 # Make sure there are no pre-existing QPS workers around before starting
21 # the performance test suite
22
23 # C++
24 killall -9 qps_worker || true
25
26 # C#
27 # shellcheck disable=SC2009
28 ps -C mono -o pid=,cmd= | grep QpsWorker | awk '{print $1}' | xargs kill -9 || true
29 # shellcheck disable=SC2009
30 ps -C dotnet -o pid=,cmd= | grep QpsWorker | awk '{print $1}' | xargs kill -9 || true
31
32 # Ruby
33 # shellcheck disable=SC2009
34 ps -C ruby -o pid=,cmd= | grep 'qps/worker.rb' | awk '{print $1}' | xargs kill -9 || true
35
36 # Python
37 # shellcheck disable=SC2009
38 ps -C python -o pid=,cmd= | grep 'qps_worker.py' | awk '{print $1}' | xargs kill -9 || true
39
40 # Java
41 jps | grep LoadWorker | awk '{print $1}' | xargs kill -9 || true
42
43 # Go
44 killall -9 worker || true