2 <html lang="en-us" itemscope itemtype="http://schema.org/Article">
5 <meta name="description" content=" Worked on log_activity Perl script Investigated issue with R/O components for create_dev_snapview.pl...">
6 <meta name="generator" content="Movable Type 5.2.3">
7 <title>log_activity/create_dev_snapview.pl - Status</title>
8 <link rel="alternate" type="application/atom+xml" title="Recent Entries" href="http://defaria.com/blogs/Status/atom.xml">
9 <link rel="canonical" href="http://defaria.com/blogs/Status/2005/12/log-checkins.html">
10 <meta name="viewport" content="width=device-width,initial-scale=1">
11 <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles.css">
13 <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles_ie.css">
14 <script src="/mt/mt-static/support/theme_static/rainier/js/html5shiv.js"></script>
17 <link rel="start" href="http://defaria.com/blogs/Status/">
19 <link rel="prev" href="http://defaria.com/blogs/Status/2005/12/post-3.html" title="log_checkins">
20 <link rel="next" href="http://defaria.com/blogs/Status/2005/12/clearcase-modul.html" title="Clearcase Modules/log_activity">
21 <!-- Open Graph Protocol -->
22 <meta property="og:type" content="article">
23 <meta property="og:locale" content="en-us">
24 <meta property="og:title" content="log_activity/create_dev_snapview.pl">
25 <meta property="og:url" content="http://defaria.com/blogs/Status/2005/12/log-checkins.html">
26 <meta property="og:description" content=" Worked on log_activity Perl script Investigated issue with R/O components for create_dev_snapview.pl...">
27 <meta property="og:site_name" content="Status">
28 <meta property="og:image" content="/mt/mt-static/support/theme_static/rainier/img/siteicon-sample.png">
30 <meta itemprop="description" content=" Worked on log_activity Perl script Investigated issue with R/O components for create_dev_snapview.pl...">
31 <link itemprop="url" href="http://defaria.com/blogs/Status/2005/12/log-checkins.html">
32 <link itemprop="image" href="/mt/mt-static/support/theme_static/rainier/img/siteicon-sample.png">
37 <div id="container-inner">
38 <header id="header" role="banner">
39 <div id="header-inner">
40 <div id="header-content">
42 <a href="http://defaria.com/blogs/Status/">
51 <nav role="navigation">
53 <li><a href="http://defaria.com/blogs/Status/">Home</a></li>
62 <div id="content-inner">
63 <ul class="breadcrumb breadcrumb-list">
64 <li class="breadcrumb-list-item"><a href="http://defaria.com/blogs/Status/">Home</a></li>
65 <li class="breadcrumb-list-item">log_activity/create_dev_snapview.pl</li>
67 <div id="individual-main" class="main" role="main">
68 <article id="entry-1768" class="entry entry-asset asset hentry">
69 <div class="asset-header">
70 <h2 itemprop="name" class="asset-name entry-title">log_activity/create_dev_snapview.pl</h2>
71 <footer class="asset-meta">
72 <ul class="asset-meta-list">
73 <li class="asset-meta-list-item">Posted on <time datetime="2005-12-28T12:59:25-08:00" itemprop="datePublished">December 28, 2005</time></li>
74 <li class="asset-meta-list-item">by <span class="author entry-author vcard"></span></li>
77 <li class="asset-meta-list-item">in <a itemprop="articleSection" rel="tag" href="http://defaria.com/blogs/Status/broadcom/">Broadcom</a></li>
83 <div class="entry-content asset-content" itemprop="articleBody">
85 <li>Worked on log_activity Perl script</li>
87 <li>Investigated issue with R/O components for create_dev_snapview.pl</li>
91 <p>Ray Tran wrote:</p>
93 <blockquote type=cite>
94 <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>
97 <p><b>We need a global area that's truly global!</b></p>
99 <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>
101 <blockquote type=cite>
103 <dt>Activity logs</dt>
104 <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>
108 <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>
110 <p>I've coded up a script called log_checkins which will create a view (named default <- 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.<<i>date</i>>.log where <<i>date</i>> 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>
112 <p>The fields in the logfile (separated with ";") are:</p>
115 <li><<i>date</i>>.<<i>time</i>> (<<i>date</i>> is YYYYMMDD
116 and <<i>time</i>> is HHMMSS 24 hour format). This format makes the logfile easily sortable by date and time with sort(1).</li>
118 <li><<i>username</i>> (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>
120 <li><<i>user</i>>@<<i>host</i>> The user login name (e.g. adefaria) @ host (e.g. ltsjca-adefaria)</li>
122 <li><<i>event</i>> The Clearcase event</li>
124 <li><<i>element</i>> View extended path name</li>
127 <h3>Clearcase Events</h3>
129 <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>
132 <li>checkout directory version</li>
134 <li>checkout version</li>
136 <li>create activity</li>
138 <li>create baseline</li>
140 <li>create branch</li>
142 <li>create branch type</li>
144 <li>create directory element</li>
146 <li>create directory version</li>
148 <li>create file element</li>
150 <li>create hyperlink</li>
152 <li>create label type</li>
154 <li>create trigger type</li>
156 <li>create version</li>
158 <li>destroy activity in versioned object base</li>
160 <li>destroy checkpoint "<<i>checkpoint</i>>" in versioned object base</li>
162 <li>destroy element in versioned object base</li>
164 <li>destroy hyperlink "<<i>hyperlink</i>> in versioned object base</li>
166 <li>destroy sub-branch "<<i>sub-branch</i>>" of branch</li>
168 <li>destroy type in versioned object base</li>
170 <li>destroy version on branch</li>
172 <li>import file element</li>
174 <li>import hyperlink</li>
176 <li>lock activity</li>
180 <li>lock branch type</li>
182 <li>lock trigger type</li>
184 <li>lock versioned object base</li>
186 <li>unlock activity</li>
188 <li>unlock versioned object base</li>
191 <p>There are probably other event types. Also, in most cases the <<i>element</i>>
192 field contains additional information that can be extracted. For example:</p>
194 <div class="code"><pre>
195 20051201.151257;drambo;drambo@PCRMNA-DRAMBO;create
196 version;/vobs/OnePhone/pub/Makefile@@/main/OnePhone_mainline_Intr/OnePhone_3.2_Intr_new/10
199 <p>one can see that this was a creation of a version in the OnePhone
200 vob of pub/Makefile. The part after the @@ is the branch information
201 (/main/OnePhone_mainline_Intr/OnePhone_3.2_Intr_new) and version 10.</p>
203 <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 -> log_activity and change checkin.<<i>date</i>>.log
204 -> activity.<<i>date</i>>.log</p>
206 <blockquote type=cite>
207 <dt>Pulse check log</dt>
208 <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>
210 <dt>Statistic logs</dt>
211 <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>
213 <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>
215 <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>
218 <p>The directory structure that I envisioned is as such</p>
220 <div class="code"><pre>
221 /projects/scm_tools_logs
230 <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>
232 <h2>R/O Components & create_dev_snapview.pl</h2>
234 <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>
236 <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>
238 <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>
240 <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>
242 <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>
244 <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>
246 <nav class="page-navigation entry-navigation pagination content-nav">
247 <ul class="page-navigation-list">
249 <li class="page-navigation-list-item page-navigation-prev"><a rel="prev" href="http://defaria.com/blogs/Status/2005/12/post-3.html" title="log_checkins">Previous entry</a></li>
252 <li class="page-navigation-list-item page-navigation-next"><a rel="next" href="http://defaria.com/blogs/Status/2005/12/clearcase-modul.html" title="Clearcase Modules/log_activity">Next entry</a></li>
257 <aside id="zenback" class="zenback feedback">
258 Please paste Zenback script code here.
265 <aside class="widgets related" role="complementary">
266 <nav class="widget-search widget">
267 <div class="widget-content">
268 <form method="get" id="search" action="http://defaria.com/mt/mt-search.cgi">
270 <input type="text" name="search" value="" placeholder="Search...">
272 <input type="hidden" name="IncludeBlogs" value="8">
274 <input type="hidden" name="limit" value="20">
275 <button type="submit" name="button">
276 <img alt="Search" src="/mt/mt-static/support/theme_static/rainier/img/search-icon.png">
282 <nav class="widget-archive-category widget">
283 <h3 class="widget-header">Categories</h3>
284 <div class="widget-content">
287 <ul class="widget-list">
290 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/ameriquest/">Ameriquest (99)</a>
298 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/audience/">Audience (3)</a>
306 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/broadcom/">Broadcom (76)</a>
314 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/gpdb/">GPDB (35)</a>
322 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/general-dynamics/">General Dynamics (61)</a>
330 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/general-electric/">General Electric (13)</a>
338 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/hewlett-packard/">Hewlett Packard (13)</a>
346 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/lynuxworks/">LynuxWorks (162)</a>
354 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/pqa/">PQA (35)</a>
362 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/salira/">Salira (79)</a>
370 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/tellabs/">Tellabs (2)</a>
378 <li class="widget-list-item"><a href="http://defaria.com/blogs/Status/texas-instruments/">Texas Instruments (31)</a>
390 <nav class="widget-archive-dropdown widget">
391 <h3 class="widget-header">Archives</h3>
392 <div class="widget-content">
394 <option>Select a Month...</option>
396 <option value="http://defaria.com/blogs/Status/2016/02/">February 2016</option>
400 <option value="http://defaria.com/blogs/Status/2014/09/">September 2014</option>
404 <option value="http://defaria.com/blogs/Status/2014/04/">April 2014</option>
408 <option value="http://defaria.com/blogs/Status/2014/03/">March 2014</option>
412 <option value="http://defaria.com/blogs/Status/2013/02/">February 2013</option>
416 <option value="http://defaria.com/blogs/Status/2012/09/">September 2012</option>
420 <option value="http://defaria.com/blogs/Status/2012/08/">August 2012</option>
424 <option value="http://defaria.com/blogs/Status/2012/05/">May 2012</option>
428 <option value="http://defaria.com/blogs/Status/2012/04/">April 2012</option>
432 <option value="http://defaria.com/blogs/Status/2012/02/">February 2012</option>
436 <option value="http://defaria.com/blogs/Status/2012/01/">January 2012</option>
440 <option value="http://defaria.com/blogs/Status/2011/10/">October 2011</option>
444 <option value="http://defaria.com/blogs/Status/2011/07/">July 2011</option>
448 <option value="http://defaria.com/blogs/Status/2010/09/">September 2010</option>
452 <option value="http://defaria.com/blogs/Status/2010/08/">August 2010</option>
456 <option value="http://defaria.com/blogs/Status/2010/04/">April 2010</option>
460 <option value="http://defaria.com/blogs/Status/2010/03/">March 2010</option>
464 <option value="http://defaria.com/blogs/Status/2010/02/">February 2010</option>
468 <option value="http://defaria.com/blogs/Status/2009/05/">May 2009</option>
472 <option value="http://defaria.com/blogs/Status/2009/04/">April 2009</option>
476 <option value="http://defaria.com/blogs/Status/2008/07/">July 2008</option>
480 <option value="http://defaria.com/blogs/Status/2008/05/">May 2008</option>
484 <option value="http://defaria.com/blogs/Status/2008/04/">April 2008</option>
488 <option value="http://defaria.com/blogs/Status/2008/03/">March 2008</option>
492 <option value="http://defaria.com/blogs/Status/2008/02/">February 2008</option>
496 <option value="http://defaria.com/blogs/Status/2008/01/">January 2008</option>
500 <option value="http://defaria.com/blogs/Status/2007/12/">December 2007</option>
504 <option value="http://defaria.com/blogs/Status/2007/11/">November 2007</option>
508 <option value="http://defaria.com/blogs/Status/2007/10/">October 2007</option>
512 <option value="http://defaria.com/blogs/Status/2007/09/">September 2007</option>
516 <option value="http://defaria.com/blogs/Status/2007/08/">August 2007</option>
520 <option value="http://defaria.com/blogs/Status/2007/07/">July 2007</option>
524 <option value="http://defaria.com/blogs/Status/2007/06/">June 2007</option>
528 <option value="http://defaria.com/blogs/Status/2007/05/">May 2007</option>
532 <option value="http://defaria.com/blogs/Status/2007/04/">April 2007</option>
536 <option value="http://defaria.com/blogs/Status/2007/03/">March 2007</option>
540 <option value="http://defaria.com/blogs/Status/2007/01/">January 2007</option>
544 <option value="http://defaria.com/blogs/Status/2006/12/">December 2006</option>
548 <option value="http://defaria.com/blogs/Status/2006/11/">November 2006</option>
552 <option value="http://defaria.com/blogs/Status/2006/10/">October 2006</option>
556 <option value="http://defaria.com/blogs/Status/2006/09/">September 2006</option>
560 <option value="http://defaria.com/blogs/Status/2006/07/">July 2006</option>
564 <option value="http://defaria.com/blogs/Status/2006/06/">June 2006</option>
568 <option value="http://defaria.com/blogs/Status/2006/05/">May 2006</option>
572 <option value="http://defaria.com/blogs/Status/2006/04/">April 2006</option>
576 <option value="http://defaria.com/blogs/Status/2006/03/">March 2006</option>
580 <option value="http://defaria.com/blogs/Status/2006/02/">February 2006</option>
584 <option value="http://defaria.com/blogs/Status/2006/01/">January 2006</option>
588 <option value="http://defaria.com/blogs/Status/2005/12/">December 2005</option>
592 <option value="http://defaria.com/blogs/Status/2005/11/">November 2005</option>
596 <option value="http://defaria.com/blogs/Status/2005/10/">October 2005</option>
600 <option value="http://defaria.com/blogs/Status/2005/09/">September 2005</option>
604 <option value="http://defaria.com/blogs/Status/2005/08/">August 2005</option>
608 <option value="http://defaria.com/blogs/Status/2005/07/">July 2005</option>
612 <option value="http://defaria.com/blogs/Status/2005/06/">June 2005</option>
616 <option value="http://defaria.com/blogs/Status/2005/05/">May 2005</option>
620 <option value="http://defaria.com/blogs/Status/2005/04/">April 2005</option>
624 <option value="http://defaria.com/blogs/Status/2005/03/">March 2005</option>
628 <option value="http://defaria.com/blogs/Status/2005/02/">February 2005</option>
632 <option value="http://defaria.com/blogs/Status/2005/01/">January 2005</option>
636 <option value="http://defaria.com/blogs/Status/2004/12/">December 2004</option>
640 <option value="http://defaria.com/blogs/Status/2004/09/">September 2004</option>
644 <option value="http://defaria.com/blogs/Status/2004/08/">August 2004</option>
648 <option value="http://defaria.com/blogs/Status/2004/07/">July 2004</option>
652 <option value="http://defaria.com/blogs/Status/2004/06/">June 2004</option>
656 <option value="http://defaria.com/blogs/Status/2004/05/">May 2004</option>
660 <option value="http://defaria.com/blogs/Status/2004/04/">April 2004</option>
664 <option value="http://defaria.com/blogs/Status/2004/03/">March 2004</option>
668 <option value="http://defaria.com/blogs/Status/2004/02/">February 2004</option>
672 <option value="http://defaria.com/blogs/Status/2004/01/">January 2004</option>
676 <option value="http://defaria.com/blogs/Status/2003/12/">December 2003</option>
680 <option value="http://defaria.com/blogs/Status/2003/11/">November 2003</option>
688 <div class="widget-syndication widget section">
689 <div class="widget-content">
690 <p><img src="http://defaria.com/mt/mt-static/images/status_icons/feed.gif" alt="Subscribe to feed" width="9" height="9" /> <a href="http://defaria.com/blogs/Status/atom.xml">Subscribe to this blog's feed</a></p>
698 <footer id="footer" role="contentinfo">
699 <div id="footer-inner">
700 <div id="footer-content">
701 <nav role="navigation">
703 <li><a href="http://defaria.com/blogs/Status/">Home</a></li>
709 <p class="license">© Copyright 2016.</p>
710 <p class="poweredby">Powered by <a href="http://www.movabletype.org/">Movable Type</a></p>
716 <script src="http://defaria.com/mt/mt-static/jquery/jquery.min.js"></script>
717 <script src="http://defaria.com/blogs/Status/mt-theme-scale2.js"></script>