Professional Documents
Culture Documents
Agenda
What I mean by critical path My simple way of finding it Review some sample code Questions Bonus Material
Critical path
Simple definition: how long is this going
to take?
in 1950s Used to manage chemical plant maintenance projects Critical path is the sequence of events which determines the duration of the project Delays l in tasks k on the h C CP d delay l the h entire project CP must be managed to stay on schedule To finish project earlier, tasks on CP must be somehow shortened
CPM process
Identify y activities Identify sequence and dependencies Draw network diagram of activities Estimate duration of activities
(critical path) Monitor & update as project progresses Delays in tasks not on CP may change the CP!
schedules Batch schedules can be drawn as a network diagram Predecessor Successor relationships between jobs Like projects, we like our batch windows to finish on time! Like a project, a batch schedule has a CP
CP Calculation
Formally:
CP is path with no slack for any task
Slack = difference between earliest & latest start or finish time of task Latest finish = latest time task can finish without delaying project
And how do you figure that???
Informally:
diagram Add up task duration on each path Select the longest path
Simple example
Task B Task A
Start
T kE Task Task C
End
Task D
Task F
Simple example
Task B Task A
Start
T kE Task Task C
End
Task D
Task F
Simple example
Task B Task A
Start
T kE Task Task C
End
Task D
Task F
Simple example
Task B Task A
Start
T kE Task Task C
End
Task D
Task F
Simple example
Task B Task A
Start
T kE Task Task C
End
Task D
Task F
Simple example
Task B Task A
Start
T kE Task Task C
End
Task D
Task F
Simple example
Task B Task A
Start 15 mins 20 mins
T kE Task
10 mins
Task C
15 mins
Task D
30 mins
Task F
5 mins
Simple example
Task B Task A
Start 15 mins 20 mins
T kE Task
10 mins
Task C
15 mins
Task D
30 mins
Task F
5 mins
dependencies
Tooling Options
Microsoft Project
- Not really meant for this purpose + See CMG Proceedings: Schwarz/Aurand, 1999 and Zaslavsky, 2001 - Cost and effort? + Can make output exactly what you want - Time / effort + Sample code on your CD!
SAS/OR
schedule? - prediction of the critical path - usually one-time analysis 2. Why did job X finish late last night? - an ongoing question / process - requires the CP for job X Fortunately, #2 is much easier!
We are answering a question, not predicting di i the h f future We just need to explain what happened Look at the jobs in the critical path for job X for anomalies
Simple example
Task B Task A
Start
19:00
20 mins 19:35
T kE Task
10 mins 19:55 End
15 mins 19:15
Task C
15 mins 19:45
Task D
30 mins 19:30
Task F
5 mins 19:50
Working backwards
E ended last Task B Task A
Start
19:00
19:35
T kE Task
19:55 End
19:15
Task C
19:45
Task D
19:30
Task F
19:50
19:35
T kE Task
19:55 End
19:15
Task C
19:45
Task D
19:30
Task F
19:50
19:35
T kE Task
19:55 End
19:15
Task C
19:45
Task D
19:30
Task F
19:50
Critical Path is E C D
Task B Task A
Start
19:00
19:35
T kE Task
19:55 End
19:15
Task C
19:45
Task D
19:30
Task F
19:50
Complicating simplicity
Schedule changes every day
Weekly / monthly processing Application changes
pristine Jobs may be run multiple timesbe sure to use the correct instance If you want to graph the entire schedule it gets more complicated
investigate i i al late-finishing fi i hi job j b The cause is on the CP Find changes If the CP changes g day to day: why? Investigate impact of periodic schedule differences Addition of monthly processing jobs may j y change g the CP
What I do
performance database
<jobid="#AMCS331"> <sys>COCJ</sys><cls>0</cls><desc>MCSX4000</desc><cnt>24</cnt> <acpu>2.18</acpu><aet>13.8</aet><mcpu>2.70</mcpu><met>26.7</met> Norms, averages, <runi="2009 i 200905092:01:55" 2:01:55 rse rse="1:59:46,2:01:56,2:02:09"> 2:02:09maximums > i <et>13.7</et><cp>2.16</cp><io>21632</io> </run> May have multiple <runi="200905080:51:46"rse="0:51:45,0:51:48,0:52:02"> runs p per day y <et>16.5</et><cp>2.11</cp><io>21690</io> </run> <runi="200905071:24:41"rse="1:22:04,1:24:41,1:24:52"> Read, start, end times <et>11.4</et><cp>2.12</cp><io>21740</io><sys>CO1J</sys> </run> </job> Stats for single
Note relatively compact format designed to reduce d th the fil file sizeunfortunately i f t t l that th t increases i the complexity of interpreting the data
run
Sunday afternoon
May not be bug free Will not satisfy all your needs For illustrative purposes only easier to
HTML / JavaScript application Data is in XML files I t Internet tE Explorer l only l Uses XPath & XSLT
Application flow
Selection criteria populated in HTML Calls findIt() to find the critical path,
getRunsDate(job, date) returns array of executions of a job on a given batch date getLatestPred(job, app) returns predecessor that ran last getRunsDate is an
findIt()
Save stats for this job to array Then find preds and add them to the t ea array ay Loop through array and build HTML table
getLatestPred(cjob, capp)
XPath to get array of preds Use DOM calls to get data from XML Xpath to find job name from op id Get the runs for a pred job Check run to see if it is the latest pred so far If it is, save it
special simply retrieves list of runs from the XML file Typical housekeeping code initializing variables etc variables, etc. Sample in the paper was much more complicated due to it being pulled from the application that does the graphing
Summary
Critical Path Analysis for Performance
Analysis usually involves answering why not predicting the future why, In such a case, start at the end and work backwards That type of analysis is easy to code Record R d a snapshot h of f the h schedule h d l daily as well as the job performance
Questions / comments ?
Cut and paste HTML tables works well Even better: automate it
sendExcel() function on CD
If Excel not open, open open it
Open a new workbook
If previous workbook not open Add new sheet to work book with data
Useful references
XPath, XPath XSLT, XSLT XML quick reference
cards