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

Bugfix/rest annotation in metric controller #549

Merged
merged 2 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
* Improve code quality and tests.
* Removed unused variables in configuration.
* Use existing `toString()` method to serialize and hash scheduler public configuration.
* Use recommended annotation in `MetricController`.
### Dependency Upgrades
* Upgrade to Spring Boot 2.6.14.
* Upgrade to Gradle 7.6.
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/com/iexec/core/metric/MetricController.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,22 @@

package com.iexec.core.metric;


import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.http.ResponseEntity.ok;

@RestController
public class MetricController {


private MetricService metricService;
private final MetricService metricService;

public MetricController(MetricService metricService) {
this.metricService = metricService;
}


@RequestMapping(method = RequestMethod.GET, path = "/metrics")
@GetMapping("/metrics")
public ResponseEntity<PlatformMetric> getPlatformMetric() {
return ok(metricService.getPlatformMetrics());
}
Expand Down