所以我想知道Azure中RoleStatus和getHealthStatus()的更新诊断是什么?
由于 Supraja J
答案 0 :(得分:0)
public override bool OnStart()
{
RoleEnvironment.StatusCheck += RoleEnvironmentStatusCheck;
return base.OnStart();
}
private void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
{
Trace.WriteLine("The status of the role instance: " + e.Status, "Information");
}
另见:
RoleInstanceStatusCheckEventArgs.SetBusy():http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleinstancestatuscheckeventargs.setbusy.aspx
和
RoleEnvironment.RequestRecycle():http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleenvironment.requestrecycle.aspx