public static FlowStats CreateFromNetBytes(byte[] buffer, int offset, out int newOffset)
        {
            FlowStats flowStats = new FlowStats();

            flowStats.CountIopsRead  = (ulong)Utils.Int64FromNetBytes(buffer, offset); offset += 8;
            flowStats.CountIopsWrite = (ulong)Utils.Int64FromNetBytes(buffer, offset); offset += 8;
            for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
            {
                flowStats.TokSecRead[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
                offset += 8;
            }
            for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
            {
                flowStats.TokSecWrite[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
                offset += 8;
            }
            for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
            {
                flowStats.QLenRead[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
                offset += 8;
            }
            for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
            {
                flowStats.QLenWrite[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
                offset += 8;
            }
            for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
            {
                flowStats.InFlightRead[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
                offset += 8;
            }
            for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
            {
                flowStats.InFlightWrite[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
                offset += 8;
            }
            newOffset = offset;
            return(flowStats);
        }
示例#2
0
文件: Rap.cs 项目: sibaoli/Moirai
 internal void SetFlowStats(FlowStats flowStats)
 {
     this.flowStats = flowStats;
 }
 public static FlowStats CreateFromNetBytes(byte[] buffer, int offset, out int newOffset)
 {
     FlowStats flowStats = new FlowStats();
     flowStats.CountIopsRead = (ulong)Utils.Int64FromNetBytes(buffer, offset); offset += 8;
     flowStats.CountIopsWrite = (ulong)Utils.Int64FromNetBytes(buffer, offset); offset += 8;
     for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
     {
         flowStats.TokSecRead[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
         offset += 8;
     }
     for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
     {
         flowStats.TokSecWrite[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
         offset += 8;
     }
     for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
     {
         flowStats.QLenRead[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
         offset += 8;
     }
     for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
     {
         flowStats.QLenWrite[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
         offset += 8;
     }
     for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
     {
         flowStats.InFlightRead[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
         offset += 8;
     }
     for (uint VecIdx = 0; VecIdx < Parameters.OKTO_MAX_VEC_LEN; VecIdx++)
     {
         flowStats.InFlightWrite[VecIdx] = (ulong)Utils.Int64FromNetBytes(buffer, offset);
         offset += 8;
     }
     newOffset = offset;
     return flowStats;
 }
示例#4
0
 internal void SetFlowStats(FlowStats flowStats)
 {
     this.flowStats = flowStats;
 }