private void GenerateData() { EventDescriptionBoard board = new EventDescriptionBoard() { TimeSettings = new TimeSettings() { Origin = 0, PrecisionCut = 0, TicksToMs = 0.0001 }, TimeSlice = new Durable(StartTime.Ticks, FinishTime.Ticks), CPUCoreCount = Environment.ProcessorCount }; FrameGroup group = new FrameGroup(board); List <SyncEvent> syncEvents = new List <SyncEvent>(Collector.SwitchContexts.Events.Count); foreach (SwitchContextData sc in Collector.SwitchContexts.Events) { if (board.TimeSlice.Start <= sc.Timestamp.Ticks && sc.Timestamp.Ticks <= board.TimeSlice.Finish) { syncEvents.Add(new SyncEvent() { CPUID = sc.CPUID, NewThreadID = sc.NewThreadID, OldThreadID = sc.OldThreadID, Timestamp = new Tick() { Start = sc.Timestamp.Ticks } }); } } SynchronizationMap syncMap = new SynchronizationMap(syncEvents); group.AddSynchronization(syncMap); Group = group; }
protected override SynchronizationMap CreateStatusMap() { var statusMap = new SynchronizationMap(EManagerAgent, WhiskWorkAgent); statusMap.AddReciprocalEntry("0a - Scheduled for development", WhiskWorkBeginStep); statusMap.AddReciprocalEntry("2 - Development", "/cmsdev/wip/analysis/inprocess"); statusMap.AddReverseEntry("/cmsdev/wip/analysis/done", "2 - Development"); statusMap.AddReverseEntry("/cmsdev/wip/development/inprocess", "2 - Development"); statusMap.AddReciprocalEntry("3 - Ready for test", "/cmsdev/wip/development/done"); statusMap.AddReverseEntry("/cmsdev/wip/feedback", "3 - Ready for test"); statusMap.AddReverseEntry("/cmsdev/wip/feedback/review", "3 - Ready for test"); statusMap.AddReverseEntry("/cmsdev/wip/feedback/test", "3 - Ready for test"); statusMap.AddReciprocalEntry("4a ACCEPTED - In Dev", "/done"); statusMap.AddForwardEntry("4a FAILED - In Dev", "/cmsdev/wip/development/inprocess"); statusMap.AddReverseEntry("/test/inprocess", "4a ACCEPTED - In Dev"); statusMap.AddReciprocalEntry("4b ACCEPTED - In Test", "/test/done"); statusMap.AddForwardEntry("4b FAILED - In Test", "/cmsdev/wip/development/inprocess"); statusMap.AddReverseEntry("/stage", "4b ACCEPTED - In Test"); statusMap.AddReciprocalEntry("5 - Approved (ready for deploy)", "/approved"); statusMap.AddForwardEntry("4c ACCEPTED - In Stage", "/approved"); statusMap.AddForwardEntry("4c FAILED - In Stage", "/cmsdev/wip/development/inprocess"); statusMap.AddReciprocalEntry("7 - Deployed to prod", "/deployed"); statusMap.AddReciprocalEntry("0b - Scheduled for analysis", "/cmsanalysis/scheduled"); statusMap.AddReciprocalEntry("1 - Analysis", "/cmsanalysis/inprocess"); return statusMap; }
private void SynchronizeStatusReverse(SynchronizationMap statusMap) { var statusSynchronizer = new StatusSynchronizer(statusMap, _eManagerAgent, _whiskWorkAgent); Console.WriteLine("Synchronizing status eManager->whiteboard"); statusSynchronizer.Synchronize(); }
protected override SynchronizationMap CreateStatusMap() { var statusMap = new SynchronizationMap(EManagerAgent, WhiskWorkAgent); statusMap.AddReciprocalEntry("0a - Scheduled for development", WhiskWorkBeginStep); statusMap.AddReciprocalEntry("2 - Development", "/cmsdev/wip/analysis/inprocess"); statusMap.AddReverseEntry("/cmsdev/wip/analysis/done", "2 - Development"); statusMap.AddReverseEntry("/cmsdev/wip/development/inprocess", "2 - Development"); statusMap.AddReciprocalEntry("3 - Ready for test", "/cmsdev/wip/development/done"); statusMap.AddReverseEntry("/cmsdev/wip/feedback", "3 - Ready for test"); statusMap.AddReverseEntry("/cmsdev/wip/feedback/review", "3 - Ready for test"); statusMap.AddReverseEntry("/cmsdev/wip/feedback/test", "3 - Ready for test"); statusMap.AddReciprocalEntry("4a ACCEPTED - In Dev", "/done"); statusMap.AddForwardEntry("4a FAILED - In Dev", "/cmsdev/wip/development/inprocess"); statusMap.AddReverseEntry("/test/inprocess", "4a ACCEPTED - In Dev"); statusMap.AddReciprocalEntry("4b ACCEPTED - In Test", "/test/done"); statusMap.AddForwardEntry("4b FAILED - In Test", "/cmsdev/wip/development/inprocess"); statusMap.AddReverseEntry("/stage", "4b ACCEPTED - In Test"); statusMap.AddReciprocalEntry("5 - Approved (ready for deploy)", "/approved"); statusMap.AddForwardEntry("4c ACCEPTED - In Stage", "/approved"); statusMap.AddForwardEntry("4c FAILED - In Stage", "/cmsdev/wip/development/inprocess"); statusMap.AddReciprocalEntry("7 - Deployed to prod", "/deployed"); statusMap.AddReciprocalEntry("0b - Scheduled for analysis", "/cmsanalysis/scheduled"); statusMap.AddReciprocalEntry("1 - Analysis", "/cmsanalysis/inprocess"); return(statusMap); }
private void SynchronizeExistence(SynchronizationMap statusMap) { var creationSynchronizer = new CreationSynchronizer(statusMap, _eManagerAgent, _whiskWorkAgent); Console.WriteLine("Synchronizing existence (eManager->whiteboard)"); creationSynchronizer.Synchronize(); }
public void Init() { Inititialize(); _masterStub = Mocks.Stub<ISynchronizationAgent>(); _slaveMock = Mocks.StrictMock<ISynchronizationAgent>(); _propertyMap = new SynchronizationMap(_masterStub, _slaveMock); _synchronizer = new DataSynchronizer(_propertyMap, _masterStub, _slaveMock); }
public void Init() { Inititialize(); _masterStub = Mocks.Stub <ISynchronizationAgent>(); _slaveMock = Mocks.StrictMock <ISynchronizationAgent>(); var map = new SynchronizationMap(_masterStub, _slaveMock); map.AddReciprocalEntry("scheduled", "planned"); _synchronizer = new CreationSynchronizer(map, _masterStub, _slaveMock); }
private void SynchronizeStatus(SynchronizationMap statusMap) { if (!_isSafeSynch) { var statusSynchronizer = new StatusSynchronizer(statusMap, _whiskWorkAgent, _eManagerAgent); Console.WriteLine("Synchronizing status whiteboard->eManager"); statusSynchronizer.Synchronize(); } else { Console.WriteLine("Synchronizing status whiteboard->eManager DISABLED!"); } }
public void Init() { Inititialize(); _masterStub = Mocks.Stub <ISynchronizationAgent>(); _slaveMock = Mocks.StrictMock <ISynchronizationAgent>(); var map = new SynchronizationMap(_masterStub, _slaveMock); map.AddReciprocalEntry("/analysis", "Development"); map.AddReciprocalEntry("/done", "Done"); _synchronizer = new StatusSynchronizer(map, _masterStub, _slaveMock); }
public void ShouldIgnoreMissingMappingWhenSynchronizingCreation() { var map = new SynchronizationMap(_masterStub, _slaveMock); var synchronizer = new CreationSynchronizer(map, _masterStub, _slaveMock); using (Mocks.Record()) { SetupResult.For(_masterStub.GetAll()).Return(new[] { Entry("1", "notMapped") }); Expect.Call(_slaveMock.GetAll()).Return(new SynchronizationEntry[0]); } using (Mocks.Playback()) { synchronizer.Synchronize(); } }
protected override DataSynchronizer CreatePropertyMap() { var propertyMap = new SynchronizationMap(EManagerAgent, WhiskWorkAgent); propertyMap.AddReciprocalEntry("name", "name"); propertyMap.AddReciprocalEntry("unid", "unid"); propertyMap.AddReciprocalEntry("title", "title"); propertyMap.AddReciprocalEntry("team", "team"); propertyMap.AddReciprocalEntry("release", "release"); propertyMap.AddReciprocalEntry("project", "project"); propertyMap.AddReciprocalEntry("leanstatus", "leanstatus"); propertyMap.AddReciprocalEntry("priority", "priority"); var propertySynchronizer = new DataSynchronizer(propertyMap, EManagerAgent, WhiskWorkAgent); propertySynchronizer.SynchronizeOrdinal = true; return propertySynchronizer; }
protected override DataSynchronizer CreatePropertyMap() { var propertyMap = new SynchronizationMap(EManagerAgent, WhiskWorkAgent); propertyMap.AddReciprocalEntry("name", "name"); propertyMap.AddReciprocalEntry("unid", "unid"); propertyMap.AddReciprocalEntry("title", "title"); propertyMap.AddReciprocalEntry("team", "team"); propertyMap.AddReciprocalEntry("release", "release"); propertyMap.AddReciprocalEntry("project", "project"); propertyMap.AddReciprocalEntry("leanstatus", "leanstatus"); propertyMap.AddReciprocalEntry("priority", "priority"); var propertySynchronizer = new DataSynchronizer(propertyMap, EManagerAgent, WhiskWorkAgent); propertySynchronizer.SynchronizeOrdinal = true; return(propertySynchronizer); }
public void ShouldIgnoreMissingMappingWhenSynchronizingStatus() { var map = new SynchronizationMap(_masterStub, _slaveMock); _synchronizer = new StatusSynchronizer(map, _masterStub, _slaveMock); using (Mocks.Record()) { SetupResult.For(_masterStub.GetAll()).Return(new[] { Entry("1", "/done") }); Expect.Call(_slaveMock.GetAll()).Return(new[] { Entry("1", "UnknownMap") }); } using (Mocks.Playback()) { _synchronizer.Synchronize(); } }
private void SynchronizeResponsible() { var responsibleMap = new SynchronizationMap(_whiskWorkAgent, _eManagerAgent); responsibleMap.AddReciprocalEntry("unid", "unid"); responsibleMap.AddReciprocalEntry("responsible", "CurrentPerson"); var responsibleSynchronizer = new DataSynchronizer(responsibleMap, _whiskWorkAgent, _eManagerAgent); if (!_isSafeSynch) { Console.WriteLine("Synchronizing responsible whiteboard->eManager"); responsibleSynchronizer.Synchronize(); } else { Console.WriteLine("Synchronizing responsible whiteboard->eManager DISABLED!"); } }
protected override SynchronizationMap CreateStatusMap() { var statusMap = new SynchronizationMap(EManagerAgent, WhiskWorkAgent); statusMap.AddReciprocalEntry(_new, WhiskWorkBeginStep); statusMap.AddReciprocalEntry(_inProcess, "/cmsdev/wip/analysis/inprocess"); statusMap.AddReverseEntry("/cmsdev/wip/analysis/done", _inProcess); statusMap.AddReverseEntry("/cmsdev/wip/development/inprocess", _inProcess); statusMap.AddReciprocalEntry(_readyForTest, "/cmsdev/wip/development/done"); statusMap.AddReverseEntry("/cmsdev/wip/feedback", _readyForTest); statusMap.AddReverseEntry("/cmsdev/wip/feedback/review", _readyForTest); statusMap.AddReverseEntry("/cmsdev/wip/feedback/test", _readyForTest); statusMap.AddReciprocalEntry(_approvedInDev, "/done"); statusMap.AddForwardEntry(_failed, "/cmsdev/wip/development/inprocess"); statusMap.AddReverseEntry("/test/inprocess", _approvedInDev); statusMap.AddReciprocalEntry(_approvedInTest, "/test/done"); statusMap.AddReverseEntry("/stage", _approvedInTest); statusMap.AddReciprocalEntry(_approvedInStage, "/approved"); statusMap.AddReciprocalEntry(_closed, "/deployed"); return(statusMap); }
protected override SynchronizationMap CreateStatusMap() { var statusMap = new SynchronizationMap(EManagerAgent, WhiskWorkAgent); statusMap.AddReciprocalEntry(_new, WhiskWorkBeginStep); statusMap.AddReciprocalEntry(_inProcess, "/cmsdev/wip/analysis/inprocess"); statusMap.AddReverseEntry("/cmsdev/wip/analysis/done", _inProcess); statusMap.AddReverseEntry("/cmsdev/wip/development/inprocess", _inProcess); statusMap.AddReciprocalEntry(_readyForTest, "/cmsdev/wip/development/done"); statusMap.AddReverseEntry("/cmsdev/wip/feedback", _readyForTest); statusMap.AddReverseEntry("/cmsdev/wip/feedback/review", _readyForTest); statusMap.AddReverseEntry("/cmsdev/wip/feedback/test", _readyForTest); statusMap.AddReciprocalEntry(_approvedInDev, "/done"); statusMap.AddForwardEntry(_failed, "/cmsdev/wip/development/inprocess"); statusMap.AddReverseEntry("/test/inprocess", _approvedInDev); statusMap.AddReciprocalEntry(_approvedInTest, "/test/done"); statusMap.AddReverseEntry("/stage", _approvedInTest); statusMap.AddReciprocalEntry(_approvedInStage, "/approved"); statusMap.AddReciprocalEntry(_closed, "/deployed"); return statusMap; }
public CreationSynchronizer(SynchronizationMap map, ISynchronizationAgent master, ISynchronizationAgent slave) { _map = map; _master = master; _slave = slave; }
public DataSynchronizer(SynchronizationMap propertyMap, ISynchronizationAgent master, ISynchronizationAgent slave) { _propertyMap = propertyMap; _master = master; _slave = slave; }
public void ConstructorTest() { var instance = new SynchronizationMap(); Assert.IsNotNull(instance.SynchronizedFields); }