I'm looking to get a count of the number of artifacts in my repository. Is there a way to get an artifact count in Rational clearcase via cleartool?
3 Answers
It depends what you consider an artifact. If you want to count the number of file elements without counting the versioned directories, the following cleartool find command will report that (assuming that you are on Unix and have the "wc" command for counting). Go to the root directory of the VOB and run:
cleartool find . -all -type f -print | wc -l
If you want all versioned elements including versioned directories, leave out the "-type f":
cleartool find . -all -print | wc -l
In any case you will also get the elements counted that are not visible in the current view, and the results will not include the view-private files and directories.

- 662
- 1
- 6
- 23
Well, there's a faster way. Use the countdb
tool in <ClearCase install dir>/etc/utils
.
CD to the VOB's db directory and run:
<path to etc/utils dir>/countdb vob_db
Look for the line starting "ELEMENT,
" that's the number of "artifacts" since for ClearCase, directories are also versionned objects.
You may need to lock the VOB before doing this, or run the check against a recent backup.
You can get a number of useful metrics out of this:
- How deep are your version trees? (VERSION line / ELEMENT line)
- How many labels are on the average version (VERSION_LABEL_LINK / VERSION)

- 1,262,500
- 529
- 4,410
- 5,250

- 1,048
- 6
- 7
-
I didn't know (or had forgotten) about countdb. +1 – VonC Feb 27 '16 at 22:09