示例#1
0
        public StateReport(State state, ICommonWriter <Message> commonWriter, ICommonWriter <Entity> commonWriter2, ConnectionsFactory connectionsFactory)
        {
            ConsistanceOrders = state.ConsistanceOrders.Count;
            foreach (string key in state.Collectors.Keys.ToArray())
            {
                if (state.Collectors.TryGetValue(key, out var val))
                {
                    CollectorsCount += val.Count;
                    foreach (var coll in val)
                    {
                        Collectors.Add(new CollectorReport()
                        {
                            Phone = coll.Phone, Group = key
                        });
                    }
                }
            }
            Messages               = commonWriter.GetQueueCount();
            TotalConnections       = connectionsFactory.TotalConnections;
            ConnectionsHotReserve  = connectionsFactory.HotReserve;
            ExecutingOrdersJournal = state.ExecutingOrdersJournal;

            Orders       = state.CountOrders();
            TargetOrders = state.CountTargetOrders();
        }
示例#2
0
 public bool CheckPauseNecessity()
 {
     return(commonWriter.GetQueueCount() > 150000);
 }