Mercurial > hg > Members > tatsuki > jungle-bench
view src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/xml/ReadJungleThread.java @ 20:195c1a644550
benchmark add
author | tatsuki |
---|---|
date | Tue, 17 Mar 2015 15:37:19 +0900 |
parents | 17cc11b04157 |
children | c8d8864714d4 |
line wrap: on
line source
package jp.ac.u_ryukyu.ie.cr.tatsuki.xml; import java.util.Random; import jp.ac.u_ryukyu.cr.ie.tatsuki.xmlTestBbs.JuGrix; public class ReadJungleThread extends Thread { JuGrix jugrix; int findCount; int successCount; int faildCount; boolean loop = true; public ReadJungleThread(JuGrix jugrix) { this.jugrix = jugrix; this.findCount = 0; this.successCount = 0; this.faildCount = 0; } public int getFindCount() { System.out.println("thread count = " + findCount); return findCount; } public void set(boolean loop) { this.loop = loop; } @Override public void run() { while (loop) { findCount++; Random rnd = new Random(); String value = String.valueOf(rnd.nextInt(400)); boolean account = jugrix.isActive("p:" + value,"v:1"); if (account) successCount++; else faildCount++; } } }