internal string QueryStatistic(RuntimeStatistic stat) { var result = this.QueryStatisticAsLong(stat); if (result == null) { return("-"); } else { return(Convert.ToString(result)); } }
internal long?QueryStatisticAsLong(RuntimeStatistic s) { long res = 0; switch (s) { // Per scheduler statistics case RuntimeStatistic.ProgressLocalRecords: case RuntimeStatistic.RxProgressBytes: case RuntimeStatistic.RxProgressMessages: case RuntimeStatistic.TxProgressBytes: case RuntimeStatistic.TxProgressMessages: { for (int i = 0; i < this.workerGroup.schedulers.Length; i++) { res += this.workerGroup.schedulers[i].statistics[(int)s]; } break; } // Network channel receive statistics case RuntimeStatistic.RxNetBytes: case RuntimeStatistic.RxNetMessages: case RuntimeStatistic.TxHighPriorityBytes: case RuntimeStatistic.TxHighPriorityMessages: case RuntimeStatistic.TxNormalPriorityBytes: case RuntimeStatistic.TxNormalPriorityMessages: { if (this.NetworkChannel != null) { res = this.NetworkChannel.QueryStatistic(s); } else { return(null); } break; } default: return(null); } return(res); }