DebugCounters ICountersDb.NewCounters() { var counters = new DebugCounters(this); lock (_mutex) { _all.Add(counters); } return counters; }
public ResolvingThread(Self self, IManager engine) { _helloMsgGap = self.config.HelloMessageGap; _engine = engine; _todos = new BlockingCollection<Action>(); _isStoppedEvent = new ManualResetEvent(false); _thr = new Thread(discovery_update_main) { Name = "l4p.VcallModel.ResolvingThread" }; _stopFlagIsOn = false; _groovyTimer = new Stopwatch(); _counters = Context.Get<ICountersDb>().NewCounters(); }
DebugCounters ICountersDb.SumAll() { DebugCounters[] all; lock (_mutex) { all = _all.ToArray(); } var sum = new DebugCounters(this); foreach (var counters in all) { sum.Accumulate(counters); } return sum; }
public WcfDiscovery(Self self, IManager engine) { _self = self; _engine = engine; var listener = new AnnouncementService(); listener.OnlineAnnouncementReceived += (sender, args) => handle_hello_message(args.EndpointDiscoveryMetadata); _mutex = new Object(); _serviceEndpoint = new UdpAnnouncementEndpoint(); _announcementService = new ServiceHost(listener); _announcementService.AddServiceEndpoint(_serviceEndpoint); _announcementCleint = new AnnouncementClient(new UdpAnnouncementEndpoint()); _counters = Context.Get<ICountersDb>().NewCounters(); }
public Manager(Self self) { _self = self; _counters = Context.Get<ICountersDb>().NewCounters(); }
private DurableQueue() { _ops = new LinkedList<IDurableOperation>(); _counters = Context.Get<ICountersDb>().NewCounters(); }
private ActiveThread(Config config) { _config = config; _RunInContextOf = config.RunInContextOf; _que = ActionQueue.New(); _durables = DurableQueue.New(); _isStartedEvent = new ManualResetEvent(false); _isStoppedEvent = new ManualResetEvent(false); _thr = new Thread(main) { Name = _config.Name }; _counters = Context.Get<ICountersDb>().NewCounters(); _stopFlagIsOn = false; }
private Repository() { _hostings = new Dictionary<string, HostingInfo>(); _counters = Context.Get<ICountersDb>().NewCounters(); }
private Repository() { _counters = Context.Get<ICountersDb>().NewCounters(); _peers = new List<ICommPeer>(); }
protected CommPeer() { _tag = Helpers.GetRandomName(); _counters = Context.Get<ICountersDb>().NewCounters(); _state = State.None; }
private Repository() { _proxies = new Dictionary<string, ProxyInfo>(); _counters = Context.Get<ICountersDb>().NewCounters(); }
public Repository() { _publishers = new List<Publisher>(); _subscribers = new List<Subscriber>(); _peers = new Dictionary<string, RemotePeer>(); _counters = Context.Get<ICountersDb>().NewCounters(); }
public static void Accumulate(this DebugCounters lhsCounters, DebugCounters rhsCounters) { foreach (var field in _counterFields) { int lhs = (int) field.GetValue(lhsCounters, null); int rhs = (int) field.GetValue(rhsCounters, null); field.SetValue(lhsCounters, lhs + rhs, null); } }