示例#1
0
        public static int RunJobs(
            JobType jobType,
            JobScope jobScope,
            IEnumerable <string> jobNames,
            JobConfiguration configuration = null,
            bool debug = false
            )
        {
            configuration = configuration ?? JobConstants.DefaultJobConfiguration;
            JobConfiguration.DumpConfiguration(configuration, JobConstants.JobConfigFile);
            Console.WriteLine($"Running jobs with config: {configuration.ToString()}");
            var jobsList = CreateJobList(jobType, jobScope, jobNames, configuration);

            if (jobsList.Any())
            {
                var jobs  = RunJobsCommand.BuildJobsDict(jobsList);
                var tasks = RunJobsCommand.ScheduleJobs(jobs, debug);
                return(RunJobsCommand.WaitAll(tasks));
            }
            else
            {
                Console.WriteLine("No job selected. Possible jobs are:");
                Console.WriteLine("TODO");
                return(1);
            }
        }
示例#2
0
        public static List <ReportRow> GetReportData(DateTime startDate)
        {
            var DLConnectionString = GetDatabaseConnectionStrings();

            var jobsList = RunJobsCommand.CreateJobList(JobType.All, JobScope.All, new List <string>(), JobConstants.DefaultJobConfiguration);
            var DLJobs   = jobsList.Select(x => x.Id()).Where(x => x.Contains("Jobs.Fetcher")).ToList();

            var dlLogEntries = GetLogs("logging", startDate, DLConnectionString, DLJobs);

            dlLogEntries.ForEach(x => {
                (x.FirstName, x.SurName) = RuntimeLog.ParseLogName(x.FullName, '.', 3);
            });
            return(dlLogEntries);
        }
示例#3
0
        public static List <ReportRow> GetReportData(DateTime startDate)
        {
            var ConnectionStrings  = GetDatabaseConnectionStrings();
            var APConnectionString = ConnectionStrings.Item1;
            var DLConnectionString = ConnectionStrings.Item2;

            var jobsList = RunJobsCommand.CreateJobList(JobType.All, JobScope.All, new List <string>(), JobConstants.DefaultJobConfiguration);
            var APJobs   = jobsList.Select(x => x.Id()).Where(x => x.Contains("Jobs.Transformation")).ToList();
            var DLJobs   = jobsList.Select(x => x.Id()).Where(x => x.Contains("Jobs.Fetcher")).ToList();

            var apLogEntries = GetLogs("application", startDate, APConnectionString, APJobs);
            var dlLogEntries = GetLogs("logging", startDate, DLConnectionString, DLJobs);

            var all = dlLogEntries.Union(apLogEntries).OrderBy(x => x.FullName).ToList();

            all.ForEach(x => {
                (x.FirstName, x.SurName) = RuntimeLog.ParseLogName(x.FullName, '.', 3);
            });
            return(all);
        }