Skip to content

Commit

Permalink
Merge pull request #20 from pagopa/config-performance-test
Browse files Browse the repository at this point in the history
Performance test
  • Loading branch information
gioelemella authored Oct 28, 2024
2 parents e5fd2c1 + 02ecd59 commit adae9f4
Show file tree
Hide file tree
Showing 32 changed files with 359 additions and 278 deletions.
2 changes: 1 addition & 1 deletion .devops/performance-test-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ variables:
poolImage: 'pagopa-uat-loadtest-linux'
API_SUBSCRIPTION_KEY: "$(UAT_API_SUBSCRIPTION_KEY)"
${{ if eq(parameters['ENVIRONMENT'], 'prod') }}:
poolImage: 'pagopa-prod-loadtest-linux'
poolImage: 'pagopa-uat-loadtest-linux'
API_SUBSCRIPTION_KEY: "$(PROD_API_SUBSCRIPTION_KEY)"

pool:
Expand Down
2 changes: 1 addition & 1 deletion docker/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ then
echo "No environment specified: local is used."
fi

pip3 install yq --break-system-packages
pip3 install yq

if [ "$ENV" = "local" ]; then
image="service-local:latest"
Expand Down
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: gpd-payments-pull
description: Microservice pagopa-gpd-payments-pull
type: application
version: 0.26.0
appVersion: 1.1.5
version: 0.32.0
appVersion: 1.1.5-6-config-performance-test
dependencies:
- name: microservice-chart
version: 2.8.0
Expand Down
4 changes: 2 additions & 2 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: "gpd-payments-pull"
image:
repository: ghcr.io/pagopa/pagopa-gpd-payments-pull
tag: "1.1.5"
tag: "1.1.5-6-config-performance-test"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down Expand Up @@ -79,7 +79,7 @@ microservice-chart:
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
JAVA_TOOL_OPTIONS: "-javaagent:/deployments/jmx_prometheus_javaagent-0.19.0.jar=12345:/deployments/config.yaml -javaagent:/deployments/opentelemetry-javaagent.jar -javaagent:/deployments/applicationinsights-agent.jar"
GPD_DB_URL: "vertx-reactive:postgresql://pagopa-d-gpd-postgresql.postgres.database.azure.com:5432/apd?sslmode=require&tcpKeepAlive=true"
GPD_DB_URL: "jdbc:postgresql://pagopa-d-gpd-pgflex.postgres.database.azure.com:6432/apd?sslmode=require&prepareThreshold=0&tcpKeepAlive=true"
envFieldRef:
envSecret:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-d-connection-string'
Expand Down
12 changes: 6 additions & 6 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: "gpd-payments-pull"
image:
repository: ghcr.io/pagopa/pagopa-gpd-payments-pull
tag: "1.1.5"
tag: "1.1.5-6-config-performance-test"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down Expand Up @@ -45,15 +45,15 @@ microservice-chart:
allowPrivilegeEscalation: false
resources:
requests:
memory: "512Mi"
memory: "768Mi"
cpu: "300m"
limits:
memory: "768Mi"
cpu: "600m"
cpu: "300m"
autoscaling:
enable: true
minReplica: 1
maxReplica: 1
minReplica: 3
maxReplica: 10
pollingInterval: 10 # seconds
cooldownPeriod: 50 # seconds
triggers:
Expand All @@ -79,7 +79,7 @@ microservice-chart:
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
JAVA_TOOL_OPTIONS: "-javaagent:/deployments/jmx_prometheus_javaagent-0.19.0.jar=12345:/deployments/config.yaml -javaagent:/deployments/opentelemetry-javaagent.jar -javaagent:/deployments/applicationinsights-agent.jar"
GPD_DB_URL: "vertx-reactive:postgresql://gpd-db.p.internal.postgresql.pagopa.it:6432/apd?sslmode=require&prepareThreshold=0"
GPD_DB_URL: "jdbc:postgresql://gpd-db.p.internal.postgresql.pagopa.it:6432/apd?sslmode=require&prepareThreshold=0"
envFieldRef:
envSecret:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-p-connection-string'
Expand Down
12 changes: 6 additions & 6 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: "gpd-payments-pull"
image:
repository: ghcr.io/pagopa/pagopa-gpd-payments-pull
tag: "1.1.5"
tag: "1.1.5-6-config-performance-test"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down Expand Up @@ -45,15 +45,15 @@ microservice-chart:
allowPrivilegeEscalation: false
resources:
requests:
memory: "512Mi"
memory: "768Mi"
cpu: "300m"
limits:
memory: "768Mi"
cpu: "600m"
cpu: "300m"
autoscaling:
enable: true
minReplica: 1
maxReplica: 1
minReplica: 10
maxReplica: 10
pollingInterval: 10 # seconds
cooldownPeriod: 50 # seconds
triggers:
Expand All @@ -79,7 +79,7 @@ microservice-chart:
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
JAVA_TOOL_OPTIONS: "-javaagent:/deployments/jmx_prometheus_javaagent-0.19.0.jar=12345:/deployments/config.yaml -javaagent:/deployments/opentelemetry-javaagent.jar -javaagent:/deployments/applicationinsights-agent.jar"
GPD_DB_URL: "vertx-reactive:postgresql://gpd-db.u.internal.postgresql.pagopa.it:6432/apd?sslmode=require&prepareThreshold=0&tcpKeepAlive=true"
GPD_DB_URL: "jdbc:postgresql://gpd-db.u.internal.postgresql.pagopa.it:6432/apd?sslmode=require&prepareThreshold=0&tcpKeepAlive=true"
envFieldRef:
envSecret:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-u-connection-string'
Expand Down
62 changes: 26 additions & 36 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "pagopa-gpd-payments-pull",
"description": "GPD Payments Pull Services",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "1.1.5"
"version": "1.1.5-6-config-performance-test"
},
"servers": [
{
Expand Down Expand Up @@ -82,7 +82,8 @@
"format": "int32",
"default": 50,
"maximum": 100,
"minimum": 1,
"minimum": 0,
"exclusiveMinimum": true,
"type": "integer"
}
},
Expand Down Expand Up @@ -215,32 +216,29 @@
"type": "string"
},
"dueDate": {
"description": "Is the date by which (TO) the Payment option is payable.",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/LocalDateTime"
},
{
"description": "Is the date by which (TO) the Payment option is payable."
}
]
},
"retentionDate": {
"description": "Not currently used in any logic. The purpose of this date will be to give the possibility to specify a time period after the dueDate within which a payment option, even if expired, will still be payable.",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/LocalDateTime"
},
{
"description": "Not currently used in any logic. The purpose of this date will be to give the possibility to specify a time period after the dueDate within which a payment option, even if expired, will still be payable."
}
]
},
"insertedDate": {
"description": "date of insertion of the OP",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/LocalDateTime"
},
{
"description": "date of insertion of the OP"
}
]
},
Expand All @@ -250,22 +248,20 @@
"type": "integer"
},
"status": {
"description": "Status of the OP",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/PaymentOptionStatus"
},
{
"description": "Status of the OP"
}
]
},
"lastUpdatedDate": {
"description": "OP update date",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/LocalDateTime"
},
{
"description": "OP update date"
}
]
}
Expand Down Expand Up @@ -323,52 +319,47 @@
"type": "string"
},
"insertedDate": {
"description": "Date of entry of the Debt Position",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/LocalDateTime"
},
{
"description": "Date of entry of the Debt Position"
}
]
},
"publishDate": {
"description": "Date of publication of the Debt Position. In the case of Positions created by ACA it corresponds to the insertion date.",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/LocalDateTime"
},
{
"description": "Date of publication of the Debt Position. In the case of Positions created by ACA it corresponds to the insertion date."
}
]
},
"validityDate": {
"description": "Start date of validity of the Debt Position. if set to null it goes directly to valid when publishing",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/LocalDateTime"
},
{
"description": "Start date of validity of the Debt Position. if set to null it goes directly to valid when publishing"
}
]
},
"status": {
"description": "State of the Debt Position. Will be\nVALID\n or\nPARTIALLY_PAID",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/PaymentNoticeStatus"
},
{
"description": "State of the Debt Position. Will be\nVALID\n or\nPARTIALLY_PAID"
}
]
},
"lastUpdateDate": {
"description": "Date of update of the Debt Position",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/LocalDate"
},
{
"description": "Date of update of the Debt Position"
}
]
},
Expand Down Expand Up @@ -411,12 +402,11 @@
"type": "integer"
},
"dueDate": {
"description": "Is the date by which the Payment option is payable.",
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/LocalDateTime"
},
{
"description": "Is the date by which the Payment option is payable."
}
]
},
Expand Down Expand Up @@ -512,4 +502,4 @@
}
}
}
}
}
7 changes: 5 additions & 2 deletions performance-test/src/payment_pull_service_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export default function () {

let responseBody = JSON.parse(response.body);

if (response.status >= 400) {
console.log("ERROR: ", responseBody);
}
check(response, {
'Payment Pull Service getPaymentNotices status is 200': () => response.status === 200,
'Payment Pull Service getPaymentNotices body has list of payment notices': () =>
Expand All @@ -41,6 +44,6 @@ export default function () {

export async function teardown(data) {
// 4. teardown code
let response = await deleteToGPD(`${gpdURIBasePath}/organizations/${organizationTaxCode}/debtpositions/${iupd}`);
check(response, { 'Delete performance test debt position status is 200': () => response.status === 200 });
let response = await deleteToGPD(`${gpdURIBasePath}/organizations/${organizationTaxCode}/debtpositions/${iupd}`);
check(response, { 'Delete performance test debt position status is 200': () => response.status === 200 });
}
Loading

0 comments on commit adae9f4

Please sign in to comment.