Class CpuPerformanceEndpoints

java.lang.Object
io.github.tkasozi.endpoint.v1.CpuPerformanceEndpoints

@RequestMapping("/observer/v1/utilization/cpu") @RestController @ResponseBody public class CpuPerformanceEndpoints extends Object
Handles requests for cpu performance metrics.
  • Constructor Details

    • CpuPerformanceEndpoints

      public CpuPerformanceEndpoints(@NonNull @NonNull CpuEventLogRepository cpuEventLogRepository)
      Constructor.
      Parameters:
      cpuEventLogRepository - Persistence layer for cpu logs.
  • Method Details

    • allCpuEndpoint

      @GetMapping(produces="application/json") public Logs<CpuEventLog> allCpuEndpoint()
      GET.
      Returns:
      List of CPU Events.
    • getCpuUsageByTimeOffset

      @GetMapping(value="/{timeOffset}", produces="application/json") public Logs<CpuEventLog> getCpuUsageByTimeOffset(@PathVariable("timeOffset") Long timeOffset)
      GET by timeOffset.
      Parameters:
      timeOffset - Time within which you want to know the events that happened
      Returns:
      List of CPU usage events