aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugins-context/pom.xml
blob: 90cd4bf6309864fb6944d9bae6402e5bfdaa32df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!--
  ============LICENSE_START=======================================================
   Copyright (C) 2018 Ericsson. All rights reserved.
  ================================================================================
  Licensed 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.

  SPDX-License-Identifier: Apache-2.0
  ============LICENSE_END=========================================================
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.onap.policy.apex-pdp.plugins</groupId>
        <artifactId>plugins</artifactId>
        <version>3.1.1-SNAPSHOT</version>
    </parent>

    <groupId>org.onap.policy.apex-pdp.plugins.plugins-context</groupId>
    <artifactId>plugins-context</artifactId>
    <packaging>pom</packaging>

    <name>${project.artifactId}</name>
    <description>Plugins for 3pps that distribute context</description>

    <dependencies>
        <dependency>
            <groupId>org.onap.policy.apex-pdp.context</groupId>
            <artifactId>context-management</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <modules>
        <module>plugins-context-schema</module>
        <module>plugins-context-distribution</module>
        <module>plugins-context-locking</module>
        <module>plugins-context-persistence</module>
    </modules>
</project>
>$param" >&2 script_usage exit 1 ;; esac done } function generate_report() { # Create needed directories. mkdir -p $TEMP_DIR "$(dirname "$OUTFILE")" # Scrape raw metrics (suppress progress meter). curl --fail --silent --show-error --output $TEMP_DIR/metrics-raw.txt "$METRICS_URL" # Remove comments, sort by name, and separate by tabs. grep --invert-match "^#" $TEMP_DIR/metrics-raw.txt | sort | sed 's/,[}]/}\t/' >$TEMP_DIR/metrics-all.txt # Extract useful metrics. grep -E "^cps_|^spring_data_" $TEMP_DIR/metrics-all.txt >$TEMP_DIR/metrics-cps.txt # Extract into columns. grep "_count" $TEMP_DIR/metrics-cps.txt | sed 's/_count//' | cut -f 1 >$TEMP_DIR/column1.txt grep "_count" $TEMP_DIR/metrics-cps.txt | cut -f 2 >$TEMP_DIR/column2.txt grep "_sum" $TEMP_DIR/metrics-cps.txt | cut -f 2 >$TEMP_DIR/column3.txt grep "_max" $TEMP_DIR/metrics-cps.txt | cut -f 2 >$TEMP_DIR/column4.txt # Combine columns into report. paste $TEMP_DIR/column{1,2,3,4}.txt >$TEMP_DIR/report.txt # Sort by Sum (column 3), descending. sort --general-numeric-sort --reverse --field-separator=$'\t' --key=3 $TEMP_DIR/report.txt >$TEMP_DIR/report-sorted.txt # Compile final report, with column headers. echo -e "Method\tCount\tSum\tMax" >"$OUTFILE" cat $TEMP_DIR/report-sorted.txt >>"$OUTFILE" # Output path to generated file echo "$OUTFILE" } function cleanup() { rm -f $TEMP_DIR/* && rmdir $TEMP_DIR 2>/dev/null } # Set up the cleanup function to be triggered upon script exit trap cleanup EXIT # Main script logic parse_params "$@" generate_report exit 0