コード例 #1
0
ファイル: ProbeManager.cs プロジェクト: jonaslsl/modSIC
        public IEnumerable<SelectedProbe> GetNotSupportedObjects(IEnumerable<ObjectType> objectTypes, FamilyEnumeration plataform)
        {
            List<SelectedProbe> selectedProbes = new List<SelectedProbe>();

            var objectTypesByComponentString =
                    from t in objectTypes
                    group t by t.ComponentString into types
                    select new { Capability = types.Key, objectsTypes = types };

            foreach (var type in objectTypesByComponentString)
            {
                IProbeCapabilities capability = this.CreateProbeCapability(type.Capability, plataform);
                IProbe probe = this.GetProbe(capability);
                if (probe == null)
                {
                    probe = this.probes.First().Value;
                    SelectedProbe selectedProbe = new SelectedProbe(probe, type.objectsTypes, (ProbeCapabilities)capability);
                    selectedProbes.Add(selectedProbe);
                }
            }
            return selectedProbes;
        }
コード例 #2
0
        /// <summary>
        /// Executes the collect for the one probe.
        /// </summary>
        /// <param name="collectRequest">The request collect.</param>
        /// <param name="probe">The probe.</param>
        /// <param name="collectExecution">the object that represents the execution of a collect</param>
        /// <returns></returns>
        private ProbeExecution ExecuteCollect(IDocumentSession session, SelectedProbe probe, CollectRequest collectRequest, VariablesEvaluated variables,
                                              IEnumerable<StateType> states, ExecutionLogBuilder executionLog)
        {
            ProbeResult probeResult = null;

            executionLog.StartCollectOf(probe.Capability.OvalObject);

            var initialTimeStamp = DateTime.Now;
            this.SetStartInstrumentationLog(executionLog, initialTimeStamp, probe.Capability.OvalObject);

            probeResult = probe.Execute(connectionContext, Target, variables, collectRequest.GetSystemCharacteristics(session), states);

            this.SetEndInstrumentationLog(executionLog, initialTimeStamp, probe.Capability.OvalObject);

            this.MergeExecutionLogs(executionLog, probe, probeResult);
            return this.CreateTheProbeExecution(probeResult, probe);
        }
コード例 #3
0
 /// <summary>
 /// this method makes the combination between probeLogs and contextLog, provided by ExecutionManager. 
 /// This process normally occours in the end of collect of a probe. 
 /// Because this, in this process is included the End entry in the log.
 /// </summary>
 /// <param name="probe">The probe.</param>
 /// <param name="probeResult">The probe result.</param>
 private void MergeExecutionLogs(ExecutionLogBuilder executionLog, SelectedProbe probe, ProbeResult probeResult)
 {
     executionLog.AddDetailInformation(probeResult.ExecutionLog);
     executionLog.EndCollectOf(probe.Capability.OvalObject);
     probeResult.ExecutionLog = executionLog.BuildExecutionLogs();
 }
コード例 #4
0
        /// <summary>
        /// Creates the probe execution with his collect result
        /// </summary>
        /// <param name="probeResult">The probe result.</param>
        /// <param name="probe">The probe.</param>
        /// <param name="session">The session.</param>
        /// <returns></returns>
        private ProbeExecution CreateTheProbeExecution(ProbeResult probeResult, SelectedProbe probe)
        {
            CollectResultFactory collectResultFactory = new CollectResultFactory();

            ProbeExecution executionOfCurrentProbe = collectFactory.CreateAProbeExecution(probeResult, probe.Capability.OvalObject);
            CollectResult probeExecutionResult = collectResultFactory.CreateCollectResultForTheProbeExecution(probeResult);
            executionOfCurrentProbe.SystemCharacteristics = probeExecutionResult.SystemCharacteristics;

            return executionOfCurrentProbe;
        }