Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000505.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: log_activity/create_dev_snapview.pl</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000504.html" title="log_checkins" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000506.html" title="Clearcase Modules/log_activity" />
17
18    
19
20    
21
22    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
23 </head>
24 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
25    <div id="container">
26       <div id="container-inner" class="pkg">
27
28          <div id="banner">
29             <div id="banner-inner" class="pkg">
30                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
31                <h2 id="banner-description">Searchable status reports and work log</h2>
32             </div>
33          </div>
34
35          <div id="pagebody">
36             <div id="pagebody-inner" class="pkg">
37                <div id="alpha">
38                   <div id="alpha-inner" class="pkg">
39
40                      <p class="content-nav">
41                         <a href="http://defaria.com/blogs/Status/archives/000504.html">&laquo; log_checkins</a> |
42                         <a href="http://defaria.com/blogs/Status/">Main</a>
43                         | <a href="http://defaria.com/blogs/Status/archives/000506.html">Clearcase Modules/log_activity &raquo;</a>
44                      </p>
45
46                      <a id="a000505"></a>
47                      <div class="entry" id="entry-505">
48                         <h3 class="entry-header">log_activity/create_dev_snapview.pl</h3>
49                         <div class="entry-content">
50                            <div class="entry-body">
51                               <ul>
52   <li>Worked on log_activity Perl script</li>
53
54   <li>Investigated issue with R/O components for create_dev_snapview.pl</li>
55 </ul>
56                            </div>
57                            <div id="more" class="entry-more">
58                               <h2>log_activity</h2>
59
60 <p>Ray Tran wrote:</p>
61
62 <blockquote type=cite>
63   <p>To summarize the three logging projects. The primary log directory is /projects/scm_tools_logs in San Jose. Please let me know if you have any input or suggestions</p>
64 </blockquote>
65
66 <p><b>We need a global area that's truly global!</b></p>
67
68 <p>Turns out that /projects/scm_tools_logs doesn't exist. I assume you meant /projects/IT_SCM/logs. However /projects/IT_SCM doesn't exist on either ccase-rmna-3 nor ccase-sj1-1... So running a script that requires Clearcase such as this I cannot access the directory where I need to deposit the log files! Additionally I cannot access /projects/IT_SCM/SCM/lib for my libraries nor /projects/IT_SCM/SCM/cc where the script would be residing...</p>
69
70 <blockquote type=cite>
71 <dl>
72   <dt>Activity logs</dt>
73     <dd><p>This is a log of who checked things out and into ClearCase and from what view. I think we can do this hourly and append to the log file so it doesn't take too long to run.</p></dd>
74 </dl>
75 </blockquote>
76
77 <p>Turns out lshistory is pretty flexible and efficient. One does not need to do a cleartool find on all elements and then call lshistory on individual elements, etc. The lshistory command supports a -recursive parameter. But we really want to report things across vobs. The lshistory command also supports a -avobs parameter. Two limitations here... First lshistory needs to work the context of a view. Secondly, -avobs only works on vobs that are mounted.</p>
78
79 <p>I've coded up a script called log_checkins which will create a view (named default &lt;- I can change this) if necessary and also mounts all vobs prior to calling lshistory. It also supports a -n parameter for number of days - thus -n 7 will produce a weeks worth of log files. Logfiles are named checkin.&lt;<i>date</i>&gt;.log where &lt;<i>date</i>&gt; is the date in YYYYMMDD format. So -n 1 (or not specifying -n) will produce a log file for the previous day (e.g. checkin.20051227.log) encompassing all activity on that day, while specifying -n 7 will produce 7 logfiles, one for each of the last 7 days properly dated.</p>
80
81 <p>The fields in the logfile (separated with ";") are:</p>
82
83 <ol>
84   <li>&lt;<i>date</i>&gt;.&lt;<i>time</i>&gt; (&lt;<i>date</i>&gt; is YYYYMMDD
85 and &lt;<i>time</i>&gt; is HHMMSS 24 hour format). This format makes the logfile easily sortable by date and time with sort(1).</li>
86
87   <li>&lt;<i>username</i>&gt; (Not sure where lshistory gets the username, normally is the same as the next field but sometimes it's different - e.g. "Clear Case Administrator")</li>
88
89   <li>&lt;<i>user</i>&gt;@&lt;<i>host</i>&gt; The user login name (e.g. adefaria) @ host (e.g. ltsjca-adefaria)</li>
90
91   <li>&lt;<i>event</i>&gt; The Clearcase event</li>
92
93   <li>&lt;<i>element</i>&gt; View extended path name</li>
94 </ol>
95
96 <h3>Clearcase Events</h3>
97
98 <p>I ran log_checkins for the last 30 days and examined the log files. No filtering for only "check in" events were done. The range of Clearcase events are:</p>
99
100 <ul>
101   <li>checkout directory version</li>
102
103   <li>checkout version</li>
104
105   <li>create activity</li>
106
107   <li>create baseline</li>
108
109   <li>create branch</li>
110
111   <li>create branch type</li>
112
113   <li>create directory element</li>
114
115   <li>create directory version</li>
116
117   <li>create file element</li>
118
119   <li>create hyperlink</li>
120
121   <li>create label type</li>
122
123   <li>create trigger type</li>
124
125   <li>create version</li>
126
127   <li>destroy activity in versioned object base</li>
128
129   <li>destroy checkpoint "&lt;<i>checkpoint</i>&gt;" in versioned object base</li>
130
131   <li>destroy element in versioned object base</li>
132
133   <li>destroy hyperlink "&lt;<i>hyperlink</i>&gt; in versioned object base</li>
134
135   <li>destroy sub-branch "&lt;<i>sub-branch</i>&gt;" of branch</li>
136
137   <li>destroy type in versioned object base</li>
138
139   <li>destroy version on branch</li>
140
141   <li>import file element</li>
142
143   <li>import hyperlink</li>
144
145   <li>lock activity</li>
146
147   <li>lock branch</li>
148
149   <li>lock branch type</li>
150
151   <li>lock trigger type</li>
152
153   <li>lock versioned object base</li>
154
155   <li>unlock activity</li>
156
157   <li>unlock versioned object base</li>
158 </ul>
159
160 <p>There are probably other event types. Also, in most cases the &lt;<i>element</i>&gt;
161 field contains additional information that can be extracted. For example:</p>
162
163 <div class="code"><pre>
164 20051201.151257;drambo;drambo@PCRMNA-DRAMBO;create
165 version;/vobs/OnePhone/pub/Makefile@@/main/OnePhone_mainline_Intr/OnePhone_3.2_Intr_new/10
166 </pre></div>
167
168 <p>one can see that this was a creation of a version in the OnePhone
169 vob of pub/Makefile. The part after the @@ is the branch information
170 (/main/OnePhone_mainline_Intr/OnePhone_3.2_Intr_new) and version 10.</p>
171
172 <p>Although you asked for checked out things, checked in things are more interesting. In fact I'd say that all of the above Clearcase events are interesting and that we should just log all of it (and I'll change log_checkins -&gt; log_activity and change checkin.&lt;<i>date</i>&gt;.log
173 -&gt; activity.&lt;<i>date</i>&gt;.log</p>
174
175 <blockquote type=cite>
176   <dt>Pulse check log</dt>
177     <dd><p>This is a script that should run a quick checkout and time the process. This should run at least every 15 minutes. I'm not sure if we need to set this up for each VOB or if we can just create a IT_SCM VOB and checkout from there. We then control how much data gets moved. For example in Perforce, I've created some file that are 100MB in size. I total the files and check this out. I now have control over the data.</p></dd>
178  
179   <dt>Statistic logs</dt>
180     <dd><p>This is a script that would create two logs - one general data for each site, one for each VOB of each site.</p>
181  
182     <p>The general data should have at the least - date_time;site;number of VOBs; number of total VOB size; number of snapshot views; number of dynamic views; number of file elements; number of directory element;...</p>
183  
184     <p>The VOB specific data - date_time;site;VOB_name;size of database;size of source pool; size of devired object; size of cleartext; size of admin data</p></dd>
185 </dl>
186  
187     <p>The directory structure that I envisioned is as such</p>
188  
189 <div class="code"><pre>
190 /projects/scm_tools_logs
191  
192  - cc
193       - 2005
194           - 12
195              - 01
196  </pre></div>
197 </blockquote>
198
199 <p>I see little benefit in constructing such a directory structure, especially programmatically. Instead I place the YYYYMMDD in the file name of the log file in a format described above. This format is easily parseable, sortable and grepable and it also compresses nicely. A directory structure such as above could easily be created at a later time or sets of logfiles could be easily gzipped and tar'ed (e.g. mkdir 2005; tar -zcf 2005/activity.logs.gz activity.2005*; rm activity.2005*).</p>
200
201 <h2>R/O Components & create_dev_snapview.pl</h2>
202
203 <p>After speaking at length with Shivdutt about this and learning more about UCM, projects, streams and the like I see a problem here. Let me explain it based on how I see this...</p>
204
205 <p>With UCM you have projects which contain components which can be R/W or R/O. Projects also have streams, one integration stream (and an associated integration view) and one or more development streams (and their associated development views).</p>
206
207 <p>When a development view is created in a development stream it is populated with all of the components in the project based on baselines. The difference here is that you can use different baselines for the various R/W components but you cannot use different baselines for the R/O components. The baseline information for R/O components is kept "globally" at the project level and is not modifiable in the development streams. Since, theoretically, R/O components are not modifiable they considered shared for all development streams.</p>
208
209 <p>While R/O components can have their baselines changed (usually advanced) at the project level, the act of doing so affects all development streams (dynamic development streams will be affected immediately while snapshot development views at next update time).</p>
210
211 <p>So if we had create_dev_snapview.pl alter the baselines of the R/O components by retarding (or advancing) them, then the side effect would affect other developers. We don't want that!</p>
212
213 <p>The only way to handle this would be to create a new project where the R/O components could be set to a previous set. This would be much more intensive and could easily be come unwieldy. For example, if you wanted 3 days worth of "history" we would need to create 3 projects to contain them.</p>
214                            </div>
215                         </div>
216                         <p class="entry-footer">
217                            <span class="post-footers">Posted by  on December 28, 2005 12:59 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000505.html">Permalink</a>
218                         </p>
219                      </div>
220
221                      
222
223                      
224                   </div>
225                </div>
226             </div>
227          </div>
228       </div>
229    </div>
230 </body>
231 </html>