/// <summary> /// Logs the progress of a job, given as a number of completed tasks /// out of a total number of tasks. /// </summary> /// <param name="jobName">Name of the job.</param> /// <param name="processName">Name of the process associated with the job.</param> /// <param name="total">The total number of tasks.</param> /// <param name="completed">The completed number of tasks.</param> public void logJobProgress(String jobName, String processName, int total, int completed) { Category category = Category.PROGRESS; Priority priority = GlobVar.DEFAULT_PRIORITY; ProcessWrapper proc = new ProcessWrapper(processName); JobWrapper job = new JobWrapper(jobName); String message = processName + ", " + jobName + ": " + completed.ToString() + " of " + total.ToString() + " job tasks completed"; job.Update(total, completed); MessageWrapper mess = new MessageWrapper(message, category, priority); LogRelWrapper rel = new LogRelWrapper(mess.MessageId, proc.ProcessId, job.JobId); }
/// <summary> /// Logs the completion of a job. /// </summary> /// <param name="jobName">Name of the job.</param> /// <param name="processName">Name of the process associated with the job.</param> public void logJobComplete(String jobName, String processName) { Category category = Category.PROGRESS; Priority priority = GlobVar.DEFAULT_PRIORITY; double percent = 100.0; ProcessWrapper proc = new ProcessWrapper(processName); JobWrapper job = new JobWrapper(jobName); String message = processName + ", " + jobName + ": Job Completed"; job.Update(percent); MessageWrapper mess = new MessageWrapper(message, category, priority); LogRelWrapper rel = new LogRelWrapper(mess.MessageId, proc.ProcessId, job.JobId); }
/// <summary> /// Logs the start of a job with a given number of total tasks. /// </summary> /// <param name="jobName">Name of the job.</param> /// <param name="processName">Name of the process associated with the job.</param> /// <param name="totalTasks">The number of total tasks for this job.</param> public void logJobStartWithTotalTasks(String jobName, String processName, int totalTasks) { Category category = Category.PROGRESS; Priority priority = GlobVar.DEFAULT_PRIORITY; int completed = 0; ProcessWrapper proc = new ProcessWrapper(processName); JobWrapper job = new JobWrapper(jobName); String message = processName + ", " + jobName + ": Job started with " + totalTasks.ToString() + " total tasks"; job.Update(totalTasks, completed); MessageWrapper mess = new MessageWrapper(message, category, priority); LogRelWrapper rel = new LogRelWrapper(mess.MessageId, proc.ProcessId, job.JobId); }
/// <summary> /// Logs the starting of a job. /// </summary> /// <param name="jobName">Name of the job.</param> /// <param name="processName">Name of the process associated with the job.</param> public void logJobStart(String jobName, String processName) { Category category = Category.PROGRESS; Priority priority = GlobVar.DEFAULT_PRIORITY; ProcessWrapper proc = new ProcessWrapper(processName); JobWrapper job = new JobWrapper(jobName); String message = processName + ", " + jobName + ": Job started"; // Reset progress, just in case the job is already in the database. job.Update(GlobVar.DEFAULT_PLANNED_COUNT, GlobVar.DEFAULT_COMPLETED_COUNT); MessageWrapper mess = new MessageWrapper(message, category, priority); LogRelWrapper rel = new LogRelWrapper(mess.MessageId, proc.ProcessId, job.JobId); }