resolve comments
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package com.navi.medici;
|
||||
|
||||
public class Constatnts {
|
||||
public class Constants {
|
||||
public static String ALL = "ALL";
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.navi.medici.controller.v1;
|
||||
|
||||
import com.navi.medici.Constatnts;
|
||||
import com.navi.medici.Constants;
|
||||
import com.navi.medici.enums.ExperimentStatus;
|
||||
import com.navi.medici.request.ExperimentSearchRequest;
|
||||
import com.navi.medici.request.v1.LitmusExperiment;
|
||||
@@ -43,6 +43,7 @@ public class ExperimentController {
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Timed(value = "litmus.get.experiments", percentiles = {0.95, 0.99})
|
||||
public ResponseEntity<?> getExperiments(@RequestParam(value = "query", required = false) String query,
|
||||
@RequestParam(value = "page", required = false, defaultValue = "1") int page,
|
||||
@RequestParam(value = "size", required = false, defaultValue = "10") int size,
|
||||
@@ -50,21 +51,17 @@ public class ExperimentController {
|
||||
@RequestParam(value = "owner", required = false) String owner) {
|
||||
ExperimentSearchRequest request = ExperimentSearchRequest.builder()
|
||||
.query(query)
|
||||
.experimentStatus((StringUtils.isNotBlank(experimentStatus) && !experimentStatus.equals(Constatnts.ALL)) ? ExperimentStatus.valueOf(experimentStatus) : null)
|
||||
.owner((StringUtils.isNotBlank(owner) && !owner.equals(Constatnts.ALL)) ? owner : null)
|
||||
.experimentStatus(checkForAllFilter(experimentStatus) ? ExperimentStatus.valueOf(experimentStatus) : null)
|
||||
.owner(checkForAllFilter(owner) ? owner : null)
|
||||
.page(page)
|
||||
.size(size)
|
||||
.build();
|
||||
return ResponseEntity.ok(experimentService.getExperiments(request));
|
||||
}
|
||||
|
||||
// @GetMapping
|
||||
// @Deprecated
|
||||
// @Timed(value = "litmus.fetch.experiment", percentiles = {0.95, 0.99})
|
||||
// public LitmusExperimentCollection fetchExperiments() {
|
||||
// log.info("fetching all experiments");
|
||||
// return experimentService.fetchAllExperiments();
|
||||
// }
|
||||
private static boolean checkForAllFilter(String experimentStatus) {
|
||||
return StringUtils.isNotBlank(experimentStatus) && !experimentStatus.equals(Constants.ALL);
|
||||
}
|
||||
|
||||
@GetMapping("/fetch")
|
||||
@Timed(value = "litmus.core.fetch.experiment.by.name", percentiles = {0.95, 0.99})
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.navi.medici.controller.v1;
|
||||
import com.navi.medici.request.CreateMetricRequest;
|
||||
import com.navi.medici.response.MetricResponse;
|
||||
import com.navi.medici.service.metric.MetricService;
|
||||
import io.micrometer.core.annotation.Timed;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -20,6 +21,7 @@ public class MetricController {
|
||||
private final MetricService metricService;
|
||||
|
||||
@PostMapping
|
||||
@Timed(value = "litmus.create.metric", percentiles = {0.95, 0.99})
|
||||
public ResponseEntity<MetricResponse> createMetric(@RequestBody CreateMetricRequest createMetricRequest, @RequestHeader("x-session-token") String sessionToken){
|
||||
log.info("create request received for creating metric : {}", createMetricRequest.getMetricName());
|
||||
return ResponseEntity.ok(metricService.createMetric(createMetricRequest,sessionToken));
|
||||
|
||||
@@ -97,4 +97,6 @@ public class ExperimentEntity {
|
||||
|
||||
String experimentStatus;
|
||||
|
||||
String experimentImpact;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
--liquibase formatted sql
|
||||
|
||||
--changeset author:akshatsonic id:202302161726
|
||||
|
||||
ALTER table experiments
|
||||
ADD experiment_impact jsonb;
|
||||
@@ -1,10 +1,6 @@
|
||||
#DATASOURCE_URL=jdbc:postgresql://dev-db-service-db.np.navi-tech.in:5432/litmus
|
||||
#DATASOURCE_USERNAME=service_user
|
||||
#DATASOURCE_PASSWORD=JRCFCMXUXBJHGZVTPBNTXHYCCFVMWN
|
||||
DATASOURCE_URL=jdbc:postgresql://localhost:5432/litmus
|
||||
DATASOURCE_USERNAME=postgres
|
||||
DATASOURCE_PASSWORD=
|
||||
#REDIS_HOST=dev-env-redis.twod4l.0001.aps1.cache.amazonaws.com
|
||||
REDIS_HOST=localhost
|
||||
DATASOURCE_URL=jdbc:postgresql://dev-db-service-db.np.navi-tech.in:5432/litmus
|
||||
DATASOURCE_USERNAME=service_user
|
||||
DATASOURCE_PASSWORD=JRCFCMXUXBJHGZVTPBNTXHYCCFVMWN
|
||||
REDIS_HOST=dev-env-redis.twod4l.0001.aps1.cache.amazonaws.com
|
||||
SEGMENT_S3_BUCKET=
|
||||
DEFAULT_POLLING_TIME_SECONDS=300
|
||||
Reference in New Issue
Block a user