1 /* 2 Bloof - visualize the evolution of your software project 3 Copyright ( C ) 2003 Lukasz Pekacki <lukasz@pekacki.de> 4 http://bloof.sf.net/ 5 6 This program is free software; you can redistribute it and/or modify it 7 under the terms of the GNU General Public License. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 this program; if not, write to the Free Software Foundation, Inc., 16 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 18 $RCSfile: PaperMetrics.java,v $ 19 Created on $Date: 2003/05/30 13:52:23 $ 20 */ 21 package net.sf.bloof.test.db; 22 23 24 /*** 25 * 26 * @author Lukasz Pekacki <pekacki@users.sourceforge.net> 27 * @version $Id: PaperMetrics.java,v 1.1 2003/05/30 13:52:23 pekacki Exp $ 28 */ 29 public class PaperMetrics { 30 /* 31 public static void main( String[] args ) { 32 PaperMetrics pm = new PaperMetrics( ); 33 try { 34 //Bloof.openProject( Bloof.LOCAL_POSTGRES_DATABASE ); 35 //db = Bloof.getDatabase( ); 36 //pm.averageChangesPerMonth( ); 37 pm.fillDB( ); 38 } catch ( Exception e ) { 39 e.printStackTrace( ); 40 } 41 } 42 43 private void fillDB( ) 44 throws InvalidRepositoryLocationException, SQLException, ScmAccessException { 45 RepositoryLocation kdeloc = 46 new RepositoryLocation( CvsConnectionMethod.LOGFILE, "bloof", "localhost", "path" ); 47 CvsAccess cvsa = new CvsAccess( kdeloc, "c:/java/bloof-contrib/logs/kdebase.log" ); 48 Bloof.newProject( cvsa, Bloof.LOCAL_POSTGRES_DATABASE ); 49 50 } 51 52 private void codeAgeMonthlyOfDevel( ) throws Exception { 53 ResultSet rs = db.executeQuery( "select min( tstamp ), max( tstamp ) from revision" ); 54 Calendar fromDate = Calendar.getInstance( ); 55 Calendar toDate = Calendar.getInstance( ); 56 Calendar runDate = Calendar.getInstance( ); 57 rs.next( ); 58 fromDate.set( 2002, 4, 0 ); 59 runDate.set( 2002, 4, 1 ); 60 toDate.set( 2002, 5, 1 ); 61 String devel = "akaplan"; 62 while ( runDate.before( toDate ) ) { 63 long dayage = 0; 64 rs = 65 db.executeQuery( 66 "select file, max( tstamp ) from Revision " 67 + " WHERE tstamp < = '" 68 + new java.sql.Date( runDate.getTime( ).getTime( ) ) 69 + "' " 70 + " AND tstamp > '" 71 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 72 + "' " 73 + " AND developer = '" 74 + devel 75 + "' group by file" ); 76 Hashtable files = new Hashtable( ); 77 while ( rs.next( ) ) { 78 files.put( rs.getString( 1 ), rs.getTimestamp( 2 ) ); 79 } 80 for ( Iterator iter = files.keySet( ).iterator( ); iter.hasNext( ); ) { 81 String element = ( String ) iter.next( ); 82 rs = 83 db.executeQuery( 84 "select max( tstamp ) from Revision " 85 + " WHERE file = '" 86 + element 87 + "' " 88 + " AND tstamp < '" 89 + ( ( Timestamp ) files.get( element ) ).toString( ) 90 + "'" ); 91 if ( rs.next( ) ) { 92 if ( rs.getObject( 1 ) != null ) { 93 94 Timestamp ts = ( Timestamp ) files.get( element ); 95 dayage += ts.getTime( ) - rs.getTimestamp( 1 ).getTime( ); 96 } 97 } 98 99 } 100 if ( files.size( ) > 0 ) { 101 dayage = dayage / files.size( ); 102 } 103 d( new java.sql.Date( runDate.getTime( ).getTime( ) ) + ";" + dayage ); 104 fromDate.add( Calendar.DATE, 1 ); 105 runDate.add( Calendar.DATE, 1 ); 106 107 } 108 } 109 110 private void codeAgeMonthly( ) throws Exception { 111 ResultSet rs = db.executeQuery( "select min( tstamp ), max( tstamp ) from revision" ); 112 Calendar fromDate = Calendar.getInstance( ); 113 Calendar toDate = Calendar.getInstance( ); 114 Calendar runDate = Calendar.getInstance( ); 115 rs.next( ); 116 fromDate.setTime( rs.getDate( 1 ) ); 117 runDate.setTime( rs.getDate( 1 ) ); 118 runDate.add( Calendar.DATE, 30 ); 119 toDate.setTime( rs.getDate( 2 ) ); 120 while ( runDate.before( toDate ) ) { 121 rs = 122 db.executeQuery( 123 "select max( tstamp ) as max from Revision " 124 + " WHERE tstamp < = '" 125 + new java.sql.Date( runDate.getTime( ).getTime( ) ) 126 + "' " 127 + " group by file" ); 128 int files = 0; 129 long age = 0; 130 while ( rs.next( ) ) { 131 age += ( runDate.getTimeInMillis( ) - rs.getTimestamp( 1 ).getTime( ) ); 132 files++; 133 } 134 long relage = age / files; 135 d( new java.sql.Date( runDate.getTime( ).getTime( ) ) + ";" + relage ); 136 // next interval 137 fromDate.add( Calendar.DATE, 30 ); 138 runDate.add( Calendar.DATE, 30 ); 139 } 140 141 } 142 143 private void averageChangesPerMonth( ) throws Exception { 144 ResultSet rs = db.executeQuery( "select min( tstamp ), max( tstamp ) from revision" ); 145 Calendar fromDate = Calendar.getInstance( ); 146 Calendar toDate = Calendar.getInstance( ); 147 Calendar runDate = Calendar.getInstance( ); 148 rs.next( ); 149 fromDate.setTime( rs.getDate( 1 ) ); 150 runDate.setTime( rs.getDate( 1 ) ); 151 runDate.add( Calendar.DATE, 30 ); 152 toDate.setTime( rs.getDate( 2 ) ); 153 int oldNum = 0; 154 double newNum = 0; 155 while ( runDate.before( toDate ) ) { 156 rs = 157 db.executeQuery( 158 "select count( * ) from Revision " 159 + "WHERE tstamp > = '" 160 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 161 + "' " 162 + " AND tstamp < '" 163 + new java.sql.Date( runDate.getTime( ).getTime( ) ) 164 + "' " ); 165 rs.next( ); 166 if ( oldNum > 0 ) { 167 newNum = ( double ) ( rs.getInt( 1 ) ) / ( double ) oldNum; 168 } else { 169 newNum = 1; 170 } 171 d( new java.sql.Date( runDate.getTime( ).getTime( ) ) + ";" + newNum + ";" + rs.getInt( 1 ) ); 172 oldNum = rs.getInt( 1 ); 173 // next interval 174 fromDate.add( Calendar.DATE, 30 ); 175 runDate.add( Calendar.DATE, 30 ); 176 } 177 178 } 179 180 private void modulesProcentualSourceCodeSum( ) throws Exception { 181 ResultSet rs; 182 String moduleRoot = "/cvsroot/j/ju/junit/junit/junit/"; 183 String[] modules = 184 {"awtui", "extensions", "framework", "runner", "samples", "swingui", "tests", "textui"}; 185 for ( int i = 0; i < modules.length; i++ ) { 186 String prefix = moduleRoot + modules[i]; 187 String query = 188 "SELECT ( sum( lines_add )+sum( lines_del ) ) from revision where file like '" 189 + prefix 190 + "%'"; 191 rs = db.executeQuery( query ); 192 rs.next( ); 193 } 194 195 } 196 197 private void conncurrentChangesinTenDaysInterval( ) throws SQLException { 198 ResultSet rs; 199 Calendar fromDate = Calendar.getInstance( ); 200 Calendar toDate = Calendar.getInstance( ); 201 Calendar runDate = Calendar.getInstance( ); 202 fromDate.set( 2000, 9, 31 ); 203 runDate.set( 2000, 10, 1 ); 204 toDate.set( 2000, 11, 1 ); 205 d( "Anzahl ueberlappender Aenderungen bezueglich Dateien im Zeitraum bis jeweils:" ); 206 while ( runDate.before( toDate ) ) { 207 HashMap files = new HashMap( ); 208 int sumCollab = 0; 209 String query = 210 "SELECT file, developer, count( * ) from revision " 211 + "WHERE tstamp > = '" 212 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 213 + "' " 214 + " AND tstamp < '" 215 + new java.sql.Date( runDate.getTime( ).getTime( ) ) 216 + "' " 217 + "group by file, developer"; 218 rs = db.executeQuery( query ); 219 220 while ( rs.next( ) ) { 221 // d( rs.getString( 1 ) + " " + rs.getString( 2 ) + " " + rs.getString( 3 ) ); 222 if ( files.containsKey( rs.getString( 1 ) ) ) { 223 int value = ( ( Integer ) files.get( rs.getString( 1 ) ) ).intValue( ); 224 sumCollab += value; 225 sumCollab += rs.getInt( 3 ); 226 files.put( rs.getString( 1 ), new Integer( 0 ) ); 227 } else { 228 files.put( rs.getString( 1 ), new Integer( rs.getInt( 3 ) ) ); 229 } 230 } 231 232 d( new java.sql.Date( runDate.getTime( ).getTime( ) ) + ";" + sumCollab ); 233 // next 10 days 234 fromDate.add( Calendar.DATE, 1 ); 235 runDate.add( Calendar.DATE, 1 ); 236 } 237 } 238 239 private void allChangesinTenDaysInterval( ) throws SQLException { 240 ResultSet rs; 241 Calendar fromDate = Calendar.getInstance( ); 242 Calendar toDate = Calendar.getInstance( ); 243 Calendar runDate = Calendar.getInstance( ); 244 fromDate.set( 2000, 9, 31 ); 245 runDate.set( 2000, 10, 1 ); 246 toDate.set( 2000, 11, 1 ); 247 d( "Anzahl von Aenderungen im Zeitraum bis jeweils:" ); 248 while ( runDate.before( toDate ) ) { 249 String query = 250 "SELECT count( * ) from revision " 251 + "WHERE tstamp > = '" 252 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 253 + "' " 254 + " AND tstamp < '" 255 + new java.sql.Date( runDate.getTime( ).getTime( ) ) 256 + "' "; 257 rs = db.executeQuery( query ); 258 rs.next( ); 259 d( new java.sql.Date( runDate.getTime( ).getTime( ) ) + ";" + rs.getInt( 1 ) ); 260 // next 10 days 261 fromDate.add( Calendar.DATE, 1 ); 262 runDate.add( Calendar.DATE, 1 ); 263 } 264 } 265 266 private void topDevelsfilesChangedinTenDaysInterval( ) throws SQLException { 267 cleanTopDevelopers( ); 268 ResultSet rs = db.executeQuery( "select min( tstamp ), max( tstamp ) from revision" ); 269 Calendar fromDate = Calendar.getInstance( ); 270 Calendar toDate = Calendar.getInstance( ); 271 Calendar maxDate = Calendar.getInstance( ); 272 rs.next( ); 273 fromDate.setTime( rs.getDate( 1 ) ); 274 toDate.setTime( rs.getDate( 1 ) ); 275 toDate.add( Calendar.DATE, 10 ); 276 maxDate.setTime( rs.getDate( 2 ) ); 277 d( "Anzahl von Dateien, die einer gešndert hat im Zeitraum bis jeweils:" ); 278 String top = ""; 279 for ( Iterator iter = topDevelopers.keySet( ).iterator( ); iter.hasNext( ); ) { 280 String element = ( String ) iter.next( ); 281 top += element + ";"; 282 } 283 d( top ); 284 while ( toDate.before( maxDate ) ) { 285 cleanTopDevelopers( ); 286 String query = 287 "SELECT developer, count( distinct file ) from revision " 288 + "WHERE tstamp > = '" 289 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 290 + "' " 291 + " AND tstamp < '" 292 + new java.sql.Date( toDate.getTime( ).getTime( ) ) 293 + "' " 294 + " GROUP BY developer"; 295 rs = db.executeQuery( query ); 296 while ( rs.next( ) ) { 297 if ( topDevelopers.containsKey( rs.getString( 1 ) ) ) { 298 topDevelopers.put( rs.getString( 1 ), new Integer( rs.getInt( 2 ) ) ); 299 } 300 } 301 String zeile = new java.sql.Date( toDate.getTime( ).getTime( ) ) + ";"; 302 for ( Iterator iter = topDevelopers.keySet( ).iterator( ); iter.hasNext( ); ) { 303 String element = ( String ) iter.next( ); 304 zeile += ( ( Integer ) topDevelopers.get( element ) ).intValue( ) + ";"; 305 } 306 d( zeile ); 307 // next 10 days 308 fromDate.add( Calendar.DATE, 10 ); 309 toDate.add( Calendar.DATE, 10 ); 310 } 311 } 312 313 private void topDevelsfilesCooperateWithHowManyinTenDaysInterval( ) throws SQLException { 314 ResultSet rs = db.executeQuery( "select min( tstamp ), max( tstamp ) from revision" ); 315 Calendar fromDate = Calendar.getInstance( ); 316 Calendar toDate = Calendar.getInstance( ); 317 Calendar maxDate = Calendar.getInstance( ); 318 rs.next( ); 319 fromDate.setTime( rs.getDate( 1 ) ); 320 toDate.setTime( rs.getDate( 1 ) ); 321 toDate.add( Calendar.DATE, 10 ); 322 maxDate.setTime( rs.getDate( 2 ) ); 323 d( "Anzahl von Leuten, mit denen einer zusammenarbeitet hat im Zeitraum bis jeweils:" ); 324 String top = ""; 325 for ( Iterator iter = topDevelopers.keySet( ).iterator( ); iter.hasNext( ); ) { 326 String element = ( String ) iter.next( ); 327 top += element + ";"; 328 } 329 while ( toDate.before( maxDate ) ) { 330 String devel = "yosh"; 331 String query = 332 "SELECT count( distinct developer ) from revision " 333 + "WHERE tstamp > = '" 334 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 335 + "' " 336 + " AND tstamp < '" 337 + new java.sql.Date( toDate.getTime( ).getTime( ) ) 338 + "' " 339 + " AND file in " 340 + " ( select distinct file from revision " 341 + " where developer = '" 342 + devel 343 + "' AND " 344 + " tstamp > = '" 345 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 346 + "' " 347 + " AND tstamp < '" 348 + new java.sql.Date( toDate.getTime( ).getTime( ) ) 349 + "' ) "; 350 rs = db.executeQuery( query ); 351 rs.next( ); 352 d( new java.sql.Date( toDate.getTime( ).getTime( ) ) + ";" + rs.getInt( 1 ) ); 353 // next 10 days 354 fromDate.add( Calendar.DATE, 10 ); 355 toDate.add( Calendar.DATE, 10 ); 356 } 357 } 358 359 private void continuity( ) throws SQLException { 360 ResultSet rs = db.executeQuery( "select min( tstamp ) from revision" ); 361 Calendar fromDate = Calendar.getInstance( ); 362 rs.next( ); 363 Date lastDate = null; 364 fromDate.setTime( rs.getDate( 1 ) ); 365 String devel = "neo"; 366 String query = "SELECT distinct tstamp from revision " + " where developer = '" + devel + "' "; 367 rs = db.executeQuery( query ); 368 while ( rs.next( ) ) { 369 Date changeDate = rs.getDate( 1 ); 370 if ( lastDate == null ) { 371 lastDate = changeDate; 372 } 373 if ( !changeDate.toString( ).equals( lastDate.toString( ) ) ) { 374 lastDate = changeDate; 375 while ( fromDate.getTime( ).before( changeDate ) ) { 376 fromDate.add( Calendar.DATE, 1 ); 377 if ( fromDate.getTime( ).before( changeDate ) ) { 378 d( new java.sql.Date( fromDate.getTime( ).getTime( ) ) + ";0" ); 379 } 380 } 381 d( new java.sql.Date( changeDate.getTime( ) ) + ";1" ); 382 } 383 } 384 } 385 386 private void locPerMonth( ) throws SQLException { 387 Bloof.openProject( Bloof.LOCAL_POSTGRES_DATABASE ); 388 Database db = Bloof.getDatabase( ); 389 ResultSet rs = db.executeQuery( "select min( tstamp ), max( tstamp ) from revision" ); 390 Calendar fromDate = Calendar.getInstance( ); 391 Calendar toDate = Calendar.getInstance( ); 392 Calendar maxDate = Calendar.getInstance( ); 393 rs.next( ); 394 fromDate.setTime( rs.getDate( 1 ) ); 395 toDate.setTime( rs.getDate( 1 ) ); 396 toDate.add( Calendar.DATE, 30 ); 397 maxDate.setTime( rs.getDate( 2 ) ); 398 while ( toDate.before( maxDate ) ) { 399 String query = 400 "SELECT ( count( distinct developer ) ) from revision " 401 + "WHERE tstamp > = '" 402 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 403 + "' " 404 + " AND tstamp < '" 405 + new java.sql.Date( toDate.getTime( ).getTime( ) ) 406 + "' "; 407 408 rs = db.executeQuery( query ); 409 rs.next( ); 410 d( new java.sql.Date( toDate.getTime( ).getTime( ) ) + ";" + rs.getInt( 1 ) ); 411 // next 30 days 412 fromDate.add( Calendar.DATE, 30 ); 413 toDate.add( Calendar.DATE, 30 ); 414 } 415 } 416 417 private void loc( ) throws SQLException { 418 Bloof.openProject( Bloof.LOCAL_POSTGRES_DATABASE ); 419 Database db = Bloof.getDatabase( ); 420 ResultSet rs = db.executeQuery( "select min( tstamp ), max( tstamp ) from revision" ); 421 Calendar fromDate = Calendar.getInstance( ); 422 Calendar toDate = Calendar.getInstance( ); 423 Calendar runDate = Calendar.getInstance( ); 424 rs.next( ); 425 fromDate.set( 2001, 10, 1 ); 426 runDate.set( 2001, 10, 1 ); 427 toDate.set( 2001, 11, 1 ); 428 String devel = "bex"; 429 String query = 430 "SELECT ( sum( lines_add )+sum( lines_del ) ) as sum, date_trunc( 'day',tstamp ) as ts from revision " 431 + "WHERE tstamp > = '" 432 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 433 + "' " 434 + " AND tstamp < '" 435 + new java.sql.Date( toDate.getTime( ).getTime( ) ) 436 + "' " 437 + " AND developer = '" 438 + devel 439 + "' " 440 + " GROUP by ts ORDER by ts "; 441 rs = db.executeQuery( query ); 442 while ( rs.next( ) ) { 443 while ( runDate.getTime( ).before( rs.getDate( 2 ) ) ) { 444 runDate.add( Calendar.DATE, 1 ); 445 if ( runDate.getTime( ).before( rs.getDate( 2 ) ) ) { 446 d( "0" ); 447 // d( new java.sql.Date( runDate.getTime( ).getTime( ) ) + ";0" ); 448 } 449 } 450 451 //d( rs.getDate( 2 ).toString( ) + ";" + rs.getInt( 1 ) ); 452 d( rs.getInt( 1 ) + "" ); 453 } 454 while ( runDate.before( toDate ) ) { 455 runDate.add( Calendar.DATE, 1 ); 456 if ( runDate.before( toDate ) ) { 457 //d( new java.sql.Date( runDate.getTime( ).getTime( ) ) + ";0" ); 458 459 d( "0" ); 460 } 461 } 462 463 } 464 465 private void vergleichSelbsterzeugteFremderzeugteDateien( ) throws SQLException { 466 Bloof.openProject( Bloof.LOCAL_POSTGRES_DATABASE ); 467 Database db = Bloof.getDatabase( ); 468 StringIterator iter = db.getDevelopersOrderedByName( ); 469 while ( iter.hasNext( ) ) { 470 String devel = ( String ) iter.next( ); 471 ResultSet innerRs = 472 db.executeQuery( "select count( * ) from revision where developer = '" + devel + "'" ); 473 innerRs.next( ); 474 int totalChanges = innerRs.getInt( 1 ); 475 innerRs = 476 db.executeQuery( 477 "select count( * ) from revision where developer = '" 478 + devel 479 + "'" 480 + "AND file in ( select file from revision WHERE version = '1.1' and developer = '" 481 + devel 482 + "' )" ); 483 innerRs.next( ); 484 int selfCreatedChanges = innerRs.getInt( 1 ); 485 d( devel + ";" + selfCreatedChanges + ";" + ( totalChanges - selfCreatedChanges ) ); 486 } 487 } 488 489 private void vergleichDateienGeaendertMitDavonDateienVonanderenGeaendertImMonat( ) 490 throws SQLException { 491 Bloof.openProject( Bloof.LOCAL_POSTGRES_DATABASE ); 492 Database db = Bloof.getDatabase( ); 493 ResultSet rs = db.executeQuery( "select min( tstamp ), max( tstamp ) from revision" ); 494 Calendar fromDate = Calendar.getInstance( ); 495 Calendar toDate = Calendar.getInstance( ); 496 Calendar maxDate = Calendar.getInstance( ); 497 rs.next( ); 498 fromDate.setTime( rs.getDate( 1 ) ); 499 toDate.setTime( rs.getDate( 1 ) ); 500 toDate.add( Calendar.DATE, 30 ); 501 maxDate.setTime( rs.getDate( 2 ) ); 502 while ( toDate.before( maxDate ) ) { 503 String devel = "jaycox"; 504 String query = 505 "SELECT count( distinct developer ) from revision " 506 + "WHERE tstamp > = '" 507 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 508 + "' " 509 + " AND tstamp < '" 510 + new java.sql.Date( toDate.getTime( ).getTime( ) ) 511 + "' " 512 + " AND file in " 513 + " ( select distinct file from revision " 514 + " where developer = '" 515 + devel 516 + "' AND " 517 + " tstamp > = '" 518 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 519 + "' " 520 + " AND tstamp < '" 521 + new java.sql.Date( toDate.getTime( ).getTime( ) ) 522 + "' ) "; 523 rs = db.executeQuery( query ); 524 rs.next( ); 525 d( new java.sql.Date( toDate.getTime( ).getTime( ) ) + ";" + rs.getInt( 1 ) ); 526 // next 10 days 527 fromDate.add( Calendar.DATE, 30 ); 528 toDate.add( Calendar.DATE, 30 ); 529 } 530 } 531 532 private void eigenAnteilAnAenderungen( ) throws SQLException { 533 Bloof.openProject( Bloof.LOCAL_POSTGRES_DATABASE ); 534 Database db = Bloof.getDatabase( ); 535 ResultSet rs = db.executeQuery( "select min( tstamp ), max( tstamp ) from revision" ); 536 Calendar fromDate = Calendar.getInstance( ); 537 Calendar toDate = Calendar.getInstance( ); 538 Calendar runDate = Calendar.getInstance( ); 539 rs.next( ); 540 fromDate.set( 2001, 9, 31 ); 541 runDate.set( 2001, 10, 1 ); 542 toDate.set( 2001, 11, 1 ); 543 String devel = "baddog"; 544 while ( runDate.before( toDate ) ) { 545 String query = 546 "SELECT count( distinct file ) from revision " 547 + " WHERE developer <> '" 548 + devel 549 + "'" 550 + " AND tstamp > = '" 551 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 552 + "' " 553 + " AND tstamp < '" 554 + new java.sql.Date( runDate.getTime( ).getTime( ) ) 555 + "' " 556 + " AND file in " 557 + " ( select distinct file from revision WHERE developer = '" 558 + devel 559 + "' " 560 + " AND tstamp > = '" 561 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 562 + "' " 563 + " AND tstamp < '" 564 + new java.sql.Date( runDate.getTime( ).getTime( ) ) 565 + "' ) "; 566 query = 567 "SELECT count( distinct file ) from revision " 568 + " WHERE developer = '" 569 + devel 570 + "'" 571 + " AND tstamp > = '" 572 + new java.sql.Date( fromDate.getTime( ).getTime( ) ) 573 + "' " 574 + " AND tstamp < '" 575 + new java.sql.Date( runDate.getTime( ).getTime( ) ) 576 + "' "; 577 rs = db.executeQuery( query ); 578 rs.next( ); 579 //d( new java.sql.Date( runDate.getTime( ).getTime( ) ) + ";" + rs.getInt( 1 ) ); 580 d( rs.getInt( 1 ) + "" ); 581 fromDate.add( Calendar.DATE, 1 ); 582 runDate.add( Calendar.DATE, 1 ); 583 } 584 } 585 private void cleanTopDevelopers( ) { 586 topDevelopers.put( "mitch", new Integer( 0 ) ); 587 //topDevelopers.put( "neo", new Integer( 0 ) ); 588 //topDevelopers.put( "yosh", new Integer( 0 ) ); 589 //topDevelopers.put( "film", new Integer( 0 ) ); 590 //topDevelopers.put( "pcg", new Integer( 0 ) ); 591 //topDevelopers.put( "sopwith", new Integer( 0 ) ); 592 } 593 private static void d( String s ) { 594 System.out.print( s ); 595 System.out.print( "\n" ); 596 } 597 private static Logger sLogger = Logger.getLogger( PaperMetrics.class.getName( ) ); 598 private HashMap topDevelopers = new HashMap( ); 599 private static Database db; 600 */ 601 }

This page was automatically generated by Maven