private void ReportInstanceHealthHelper(Health.HealthInformation healthInfo, Health.HealthReportSendOptions sendOptions)
        {
            using (var pin = new PinCollection())
            {
                var nativeSendOptions = IntPtr.Zero;
                if (sendOptions != null)
                {
                    nativeSendOptions = sendOptions.ToNative(pin);
                }

                this.nativePartition.ReportInstanceHealth2(healthInfo.ToNative(pin), nativeSendOptions);
            }
        }
 /// <summary>
 /// Reports health on the current stateless service instance.
 /// Specifies send options that control how the report is sent to the health store.
 /// </summary>
 /// <param name="healthInfo">The <see cref="System.Fabric.Health.HealthInformation"/> that describes the health report information.</param>
 /// <param name="sendOptions">
 /// <para>The <see cref="System.Fabric.Health.HealthReportSendOptions"/> that controls how the report is sent.</para>
 /// </param>
 /// <remarks>
 /// <para>The health information describes the report details, like the source ID, the property, the health state
 /// and other relevant details.
 /// Internally, the partition uses an internal health client to send the reports to the health store.
 /// The client optimizes messages to Health Manager 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.
 /// </para>
 /// <para>Read more about <see href="https://docs.microsoft.com/azure/service-fabric/service-fabric-report-health">health reporting</see>.</para>
 /// </remarks>
 public void ReportInstanceHealth(Health.HealthInformation healthInfo, Health.HealthReportSendOptions sendOptions)
 {
     Requires.Argument("healthInfo", healthInfo).NotNull();
     Utility.WrapNativeSyncInvoke(() => this.ReportInstanceHealthHelper(healthInfo, sendOptions), "StatelessPartition.ReportInstanceHealth");
 }
Exemplo n.º 3
0
 public void ReportPartitionHealth(SfHealthInformation healthInfo, System.Fabric.Health.HealthReportSendOptions sendOptions) =>
 ReportPartitionHealth(healthInfo);