Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update for check performance #36

Merged
merged 49 commits into from
Oct 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5fc2b1d
update for check performance
Oct 11, 2022
82d8be4
Bump version [skip ci]
Oct 11, 2022
b23dac3
fix docker file
pasqualespica Oct 11, 2022
efa7cc3
Bump version [skip ci]
Oct 11, 2022
c0c2f20
fix docker file cfg
pasqualespica Oct 11, 2022
7b4ae80
Bump version [skip ci]
Oct 11, 2022
c7723cc
increase connections for request
Oct 11, 2022
0115f7c
Merge branch 'fix_performance' of https://github.com/pagopa/pagopa-sp…
Oct 11, 2022
4f5ef4a
Bump version [skip ci]
Oct 11, 2022
5e51b0c
Merge branch 'fix_performance' of
Oct 11, 2022
5fbdaf5
Merge branch 'fix_performance' of https://github.com/pagopa/pagopa-sp…
Oct 11, 2022
2b13dc4
Bump version [skip ci]
Oct 11, 2022
8426012
Bump version [skip ci]
Oct 11, 2022
8c613bc
Merge branch 'fix_performance' of
Oct 11, 2022
b596913
Merge branch 'fix_performance' of https://github.com/pagopa/pagopa-sp…
Oct 11, 2022
a830a03
Bump version [skip ci]
Oct 11, 2022
04c6b51
Merge branch 'fix_performance' of
Oct 11, 2022
f05e715
Bump version [skip ci]
Oct 11, 2022
e79a517
removed iuv gen call
Oct 11, 2022
4b988f4
Bump version [skip ci]
Oct 11, 2022
8ecf5ea
Bump version [skip ci]
Oct 11, 2022
06a8127
fix#1
pasqualespica Oct 11, 2022
fc5247a
Bump version [skip ci]
Oct 11, 2022
b3ea5f7
fix#2
pasqualespica Oct 11, 2022
e135444
Bump version [skip ci]
Oct 11, 2022
0d016a6
fix#3
pasqualespica Oct 11, 2022
ca0af90
Bump version [skip ci]
Oct 11, 2022
6c540a6
fix#4
pasqualespica Oct 11, 2022
96a361d
Bump version [skip ci]
Oct 11, 2022
3fe9313
fix#7
pasqualespica Oct 11, 2022
a13c98d
Bump version [skip ci]
Oct 11, 2022
453da87
fix#8
pasqualespica Oct 11, 2022
b8cd193
Bump version [skip ci]
Oct 11, 2022
5af76d1
fix#9
pasqualespica Oct 12, 2022
eadcc89
Bump version [skip ci]
Oct 12, 2022
b2fa57e
fix#10
pasqualespica Oct 12, 2022
6e69789
Bump version [skip ci]
Oct 12, 2022
7debdbb
fix#11
pasqualespica Oct 12, 2022
8e072f2
Bump version [skip ci]
Oct 12, 2022
4d93a47
fix10
pasqualespica Oct 12, 2022
c796935
Bump version [skip ci]
Oct 12, 2022
ccb3eed
fix11
pasqualespica Oct 12, 2022
0dbb37a
Bump version [skip ci]
Oct 12, 2022
437db43
fix
Oct 14, 2022
c23f99b
fix
Oct 14, 2022
d0e8983
Merge branch 'fix_performance' of https://github.com/pagopa/pagopa-sp…
Oct 14, 2022
a4b2c6d
Bump version [skip ci]
Oct 14, 2022
3a9c6c6
fix helm dev prod
pasqualespica Oct 16, 2022
387cc4c
Bump version [skip ci]
Oct 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public class CosmosDBConfiguration extends AbstractCosmosConfiguration {
CosmosClientBuilder getCosmosClientBuilder() {
AzureKeyCredential azureKeyCredential = new AzureKeyCredential(key);
DirectConnectionConfig directConnectionConfig = new DirectConnectionConfig();
GatewayConnectionConfig gatewayConnectionConfig = new GatewayConnectionConfig();
//GatewayConnectionConfig gatewayConnectionConfig = new GatewayConnectionConfig();
return new CosmosClientBuilder()
.endpoint(uri)
.credential(azureKeyCredential)
.directMode(directConnectionConfig, gatewayConnectionConfig);
.directMode(directConnectionConfig);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ public Object logExecutionTime(ProceedingJoinPoint joinPoint) throws Throwable {
long startTime = System.currentTimeMillis();
Object result = joinPoint.proceed();
long endTime = System.currentTimeMillis();
log.trace("Time taken for Execution of {} is: {}ms", joinPoint.getSignature().toShortString(), (endTime - startTime));
log.info("Time taken for Execution of {} is: {}ms", joinPoint.getSignature().toShortString(), (endTime - startTime));
return result;
}

@Around(value = "repository() || service()")
public Object logTrace(ProceedingJoinPoint joinPoint) throws Throwable {
log.debug("Call method {} - args: {}", joinPoint.getSignature().toShortString(), joinPoint.getArgs());
log.info("Call method {} - args: {}", joinPoint.getSignature().toShortString(), joinPoint.getArgs());
Object result = joinPoint.proceed();
log.debug("Return method {} - result: {}", joinPoint.getSignature().toShortString(), result);
log.info("Return method {} - result: {}", joinPoint.getSignature().toShortString(), result);
return result;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package it.gov.pagopa.spontaneouspayment.controller.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import it.gov.pagopa.spontaneouspayment.model.AppInfo;
import it.gov.pagopa.spontaneouspayment.model.ProblemJson;
import it.gov.pagopa.spontaneouspayment.service.PaymentsService;

@RestController()
public class TestCosmosDBPerformance {

@Autowired
private PaymentsService paymentsService;

@Operation(summary = "test performance", description = "", security = {@SecurityRequirement(name = "ApiKey"), @SecurityRequirement(name = "Authorization")}, tags = {"Home"})
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = ProblemJson.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema())),
@ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(schema = @Schema())),
@ApiResponse(responseCode = "429", description = "Too many requests", content = @Content(schema = @Schema())),
@ApiResponse(responseCode = "500", description = "Service unavailable", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = ProblemJson.class)))})
@GetMapping(value = "/testcosmos/{organizationfiscalcode}/{serviceId}")
@ResponseStatus(HttpStatus.OK)
public ResponseEntity<String> testCosmosDB(@PathVariable("organizationfiscalcode") String organizationFiscalCode, @PathVariable("serviceId") String serviceId) {
it.gov.pagopa.spontaneouspayment.entity.Service s = new it.gov.pagopa.spontaneouspayment.entity.Service();
s.setId(serviceId);
paymentsService.checkServiceOrganization(organizationFiscalCode, s);
return new ResponseEntity<>(
"\"The call for " + organizationFiscalCode + "and" + serviceId + " was successfull\"",
HttpStatus.OK);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private String callIuvGeneratorService(String organizationFiscalCode, ServiceRef
return Optional.ofNullable(iuvObj).orElseThrow(() -> new AppException(AppError.IUV_ACQUISITION_ERROR, organizationFiscalCode, auxDigit, segregationCode)).getIuv();
}

private void checkServiceOrganization(@NotBlank String organizationFiscalCode,
public void checkServiceOrganization(@NotBlank String organizationFiscalCode,
@NotNull it.gov.pagopa.spontaneouspayment.entity.Service service) {
var org = orgRepository.getCreditInstitutionByOrgFiscCodeAndServiceId(organizationFiscalCode, service.getId());
if (org.isEmpty()) {
Expand Down