Skip to content

Commit

Permalink
Implemented health api
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan Kumar committed Jan 2, 2025
1 parent f8cf77f commit ee0babe
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions crates/libs/core/src/runtime/stateful_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use crate::{
strings::WStringWrap,
sync::{fabric_begin_end_proxy2, CancellationToken},
types::{
FaultType, LoadMetric, LoadMetricListRef, MoveCost, ReplicaRole,
ServicePartitionAccessStatus, ServicePartitionInformation,
HealthInformation, FaultType, LoadMetric, LoadMetricListRef, MoveCost,
ReplicaRole, ServicePartitionAccessStatus, ServicePartitionInformation,
},
};

Expand Down Expand Up @@ -380,16 +380,16 @@ impl StatefulServicePartition {
/// by batching reports per a configured duration (Default: 30 seconds). If the report has high priority,
/// you can specify send options to send it immediately.
/// TODO: not yet implemented
/// Reports current partition health.
pub fn report_partition_health(&self) -> crate::Result<()> {
Err(FabricErrorCode::E_NOTIMPL.into())
/// Reports current partition health.
pub fn report_partition_health(&self, partitionhealthinfo: &HealthInformation) -> crate::Result<()> {
let healthinfo = &partitionhealthinfo.into();
unsafe { self.com_impl.ReportPartitionHealth(healthinfo) }
}

/// TODO: not yet implemented
/// Reports health on the current stateful service replica of the partition.
pub fn report_replica_health(&self) -> crate::Result<()> {
Err(FabricErrorCode::E_NOTIMPL.into())
pub fn report_replica_health(&self, replicahealthinfo: &HealthInformation) -> crate::Result<()> {
let healthinfo = &replicahealthinfo.into();
unsafe {self.com_impl.ReportReplicaHealth(healthinfo)}
}
}

Expand Down

0 comments on commit ee0babe

Please sign in to comment.