| #ifndef THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_HAL_SHARED_MEM_SERVER_INTERFACE_H |
| #define THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_HAL_SHARED_MEM_SERVER_INTERFACE_H |
| #include <cstdint> |
| #include <string> |
| #include <string_view> |
| #include <utility> |
| |
| #include "absl/status/statusor.h" |
| #include "absl/time/time.h" |
| |
| namespace milotic_tlbmc { |
| class IpcServer { |
| public: |
| virtual ~IpcServer() = default; |
| // Returns the sensor value and timestamp given the sensor name. |
| virtual absl::StatusOr<std::pair<float, uint64_t>> ReadSensorValue( |
| const std::string& sensor_name) = 0; |
| // copybara:strip_begin(g3-shared-libs) |
| // Note: Metrics is no longer in shared memory but in process (gbmcweb) own |
| // memory. We still keep the API in this shared memory layer to keep the |
| // change less disruptive. |
| virtual void UpdateMetricsRequestCount(bool is_tlbmc_request) = 0; |
| virtual void UpdateMetricsResponse(absl::Duration response_time, |
| int status_code, |
| std::string_view resource_url) = 0; |
| virtual void UpdateMetricsRps(absl::Duration time_delta) = 0; |
| // copybara:strip_end |
| }; |
| } // namespace milotic_tlbmc |
| #endif // THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_HAL_SHARED_MEM_SERVER_INTERFACE_H |