Adds basic performance tests for XACML PDP
[policy/xacml-pdp.git] / testsuites / performance / src / main / resources / testplans / results.sh
1 #!/bin/bash
2
3 #============LICENSE_START=======================================================
4 #ONAP Policy API Performance
5 #================================================================================
6 #Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
7 #================================================================================
8 #Licensed under the Apache License, Version 2.0 (the "License");
9 #you may not use this file except in compliance with the License.
10 #You may obtain a copy of the License at
11 #
12 #     http://www.apache.org/licenses/LICENSE-2.0
13 #
14 #Unless required by applicable law or agreed to in writing, software
15 #distributed under the License is distributed on an "AS IS" BASIS,
16 #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 #See the License for the specific language governing permissions and
18 #limitations under the License.
19 #============LICENSE_END=========================================================
20
21 LOGFILE=$1
22 if [[ ! -f $LOGFILE ]]; then
23   echo "The file '$LOGFILE' in not provided."
24   echo "Please provide log file to process."
25   exit 1
26 fi
27
28 echo "File being processed: " $LOGFILE
29 RES=$(awk -F "," 'NR>1 { total += $15 } END { print total/NR }' $LOGFILE)
30 echo "Average Latency: " $RES
31 LC=$(awk 'END{print NR}' $LOGFILE)
32 echo "Total Requests:" $LC
33 echo "Requests/sec:" $((LC/5))
34