{"id":466,"date":"2008-05-13T19:11:04","date_gmt":"2008-05-14T00:11:04","guid":{"rendered":"http:\/\/www.juixe.com\/techknow\/index.php\/2008\/05\/13\/perforce-report\/"},"modified":"2008-05-13T19:11:04","modified_gmt":"2008-05-14T00:11:04","slug":"perforce-report","status":"publish","type":"post","link":"http:\/\/juixe.com\/techknow\/index.php\/2008\/05\/13\/perforce-report\/","title":{"rendered":"Perforce Report"},"content":{"rendered":"<p>I&#8217;m a really competitive developer and I like to see how many files I checked in a week compared to my fellow coworkers.  I know that counting then number of changed files is no way near a correct accounting of my productivity but it is an easily quantifiable metric.  <a href=\"http:\/\/www.juixe.com\/techknow\/index.php?s=perforce\">Perforce<\/a> has an optional <b>P4Report<\/b> download that can be used create reports on the code repository.  P4Report has a command-line client, <b>P4SQL<\/b>.  With P4SQL you can write SQL-like statements to query the whole repository.<\/p>\n<p>Download P4Report and make sure it is in your path.  Once you have it in your path, start the p4sql command.<\/p>\n<p>The first useful SQL statement is to find all the available tables in the system.  To list all tables, you can use the following.<\/p>\n<pre>\nselect * from systabs;\n<\/pre>\n<p>Perforce has a large number of database tables of which I find the following the most useful, changes, files, users, clients, fixes, and branches.<\/p>\n<p>To list all the changes that you have committed you can execute a command like the following, just replace the &#8216;juixe&#8217; with your own username.<\/p>\n<pre>\nselect * from changes where lcase(user) = 'juixe';\n<\/pre>\n<p>I was curious and wanted to find the largest revision any single file has attained, meaning most modified file, to accomplish this I executed the following command.<\/p>\n<pre>\nselect max(revision) from files;\n<\/pre>\n<p>If you use Perforce version control, you can use P4Report to query your teams check-ins and use it as an additional metric or tool in your development process.<\/p>\n<p>Technorati Tags: <a href=\"http:\/\/technorati.com\/tag\/perforce\" rel=\"tag\">perforce<\/a>, <a href=\"http:\/\/technorati.com\/tag\/p4\" rel=\"tag\"> p4<\/a>, <a href=\"http:\/\/technorati.com\/tag\/p4report\" rel=\"tag\"> p4report<\/a>, <a href=\"http:\/\/technorati.com\/tag\/p4sql\" rel=\"tag\"> p4sql<\/a>, <a href=\"http:\/\/technorati.com\/tag\/development\" rel=\"tag\"> development<\/a>, <a href=\"http:\/\/technorati.com\/tag\/process\" rel=\"tag\"> process<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m a really competitive developer and I like to see how many files I checked in a week compared to my fellow coworkers. I know that counting then number of changed files is no way near a correct accounting of my productivity but it is an easily quantifiable metric. Perforce has an optional P4Report download [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[19,23,4],"tags":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p902K-7w","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/466"}],"collection":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/comments?post=466"}],"version-history":[{"count":0,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/466\/revisions"}],"wp:attachment":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/media?parent=466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/categories?post=466"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/tags?post=466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}