Ejemplo n.º 1
0
        internal static unsafe IList <LoadMetricInformation> CreateFromNativeList(NativeTypes.FABRIC_LOAD_METRIC_INFORMATION_LIST *nativeResultList)
        {
            var rv = new List <LoadMetricInformation>();

            var nativeArray = (NativeTypes.FABRIC_LOAD_METRIC_INFORMATION *)nativeResultList->Items;

            for (int i = 0; i < nativeResultList->Count; i++)
            {
                var nativeItem = *(nativeArray + i);
                rv.Add(LoadMetricInformation.CreateFromNative(nativeItem));
            }

            return(rv);
        }
Ejemplo n.º 2
0
        internal static unsafe ClusterLoadInformation CreateFromNative(
            NativeTypes.FABRIC_CLUSTER_LOAD_INFORMATION nativeLoadInformation)
        {
            IList <LoadMetricInformation> loadMetricInformationList;

            if (nativeLoadInformation.LoadMetricInformationList == IntPtr.Zero)
            {
                loadMetricInformationList = new List <LoadMetricInformation>();
            }
            else
            {
                loadMetricInformationList = LoadMetricInformation.CreateFromNativeList(
                    (NativeTypes.FABRIC_LOAD_METRIC_INFORMATION_LIST *)nativeLoadInformation.LoadMetricInformationList);
            }

            return(new ClusterLoadInformation
            {
                LastBalancingStartTimeUtc = NativeTypes.FromNativeFILETIME(nativeLoadInformation.LastBalancingStartTimeUtc),
                LastBalancingEndTimeUtc = NativeTypes.FromNativeFILETIME(nativeLoadInformation.LastBalancingEndTimeUtc),
                LoadMetricInformationList = loadMetricInformationList
            });
        }