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

Implemented health api #116

Merged
merged 4 commits into from
Jan 6, 2025
Merged
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
14 changes: 7 additions & 7 deletions crates/libs/core/src/runtime/stateful_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
strings::WStringWrap,
sync::{fabric_begin_end_proxy2, CancellationToken},
types::{
FaultType, LoadMetric, LoadMetricListRef, MoveCost, ReplicaRole,
FaultType, HealthInformation, 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())
pub fn report_partition_health(&self, healthinfo: &HealthInformation) -> crate::Result<()> {
let healthinfo_ref = &healthinfo.into();
unsafe { self.com_impl.ReportPartitionHealth(healthinfo_ref) }
}

/// 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, healthinfo: &HealthInformation) -> crate::Result<()> {
let healthinfo_ref = &healthinfo.into();
unsafe { self.com_impl.ReportReplicaHealth(healthinfo_ref) }
}
}

Expand Down
Loading