From cba3ae8d48b36ed0d96eba4f1dd3ca411c560d4d Mon Sep 17 00:00:00 2001 From: "halil.cakal" Date: Thu, 10 Apr 2025 14:02:54 +0100 Subject: [PATCH] Scrape all metrics and add them to cps documentation - add a new dummy annotation (TimedCustom) for Gauge metrics (cm handle state) - add a description field for the counter annotation (CountCmHandleSearchExecution) - add a python script (with tests) to scrape the metrics mentioned above using a single regex for all - remove redundancies (distribution management) from pom.xml of checkstyle module since there is no artifact released from checkstyle - import and display the output (metrics.cvs) in admin-guide docs Issue-ID: CPS-2709 Change-Id: Iaee23f0a20c05e5aea033baacad1f23cb61e8b34 Signed-off-by: halil.cakal --- .gitignore | 3 + checkstyle/pom.xml | 22 +--- .../rest/controller/NetworkCmProxyController.java | 6 +- .../NetworkCmProxyInventoryController.java | 5 +- .../rest/util/CountCmHandleSearchExecution.java | 9 +- .../cps/ncmp/config/CmHandleStateGaugeConfig.java | 10 ++ .../java/org/onap/cps/ncmp/config/TimedCustom.java | 47 ++++++++ docs/ScrapeMetrics.py | 123 +++++++++++++++++++++ docs/admin-guide.rst | 8 +- docs/csv/metrics.csv | 57 ++++++++++ docs/test_ScrapeMetrics.py | 104 +++++++++++++++++ 11 files changed, 367 insertions(+), 27 deletions(-) mode change 100755 => 100644 cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java mode change 100755 => 100644 cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java create mode 100644 cps-ncmp-service/src/main/java/org/onap/cps/ncmp/config/TimedCustom.java create mode 100644 docs/ScrapeMetrics.py create mode 100644 docs/csv/metrics.csv create mode 100644 docs/test_ScrapeMetrics.py diff --git a/.gitignore b/.gitignore index a721cb4489..f7e2bf7aa8 100755 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ cps-ncmp-rest-stub/dependency-reduced-pom.xml cps-application/archunit_store cps-ri/src/main/resources/changelog/db/changes/data/dmi/generated-csv/generated_yang_resource_* +checkstyle/src/main/__pycache__/ +docs/venv/ +docs/__pycache__/ target/ log/ diff --git a/checkstyle/pom.xml b/checkstyle/pom.xml index 114c3257e6..b54f2290c4 100644 --- a/checkstyle/pom.xml +++ b/checkstyle/pom.xml @@ -2,7 +2,7 @@