• Bug
  • Status: Closed
  • 1 Critical
  • Resolution: Fixed
  • hhuynh
  • Reporter: tgautier
  • February 27, 2008
  • 0
  • Watchers: 0
  • May 21, 2008
  • April 01, 2008

Description

After playing around with the Shared Editor for a while, I have the following stats for a lock:

Average Held Time: 74676 Times Requested: 674

note that 74676/674 = 111

Moving that object around results in a new stat:

Average Held Time: 144521 Times Requested: 802

note that 144521/802 = 180

It’s not entirely clear that this number is truly an average, but I wouldn’t expect it to increase the way it is…however I wouldn’t expect the average to go from 111 to 180.

To reproduce:

Run the shared editor Turn on lock stats (trace >= 1) Create an object (image) Click refresh Move the object around Click refresh

Why does the Average Held Time increase so much?? Maybe this is just a SharedEditor thing.

Comments

Taylor Gautier 2008-02-27

I ran this sample program, where Main.instance is a root, and it gave me unexpected results, basically every time I refreshed the statistics, for lock count x, the Average Held Time stat was 500x. Based on the Thread.sleep(1000) I would have expected it to be 1000.

import java.io.*; import java.util.concurrent.atomic.*;

public class Main { public static final Main instance = new Main(); public AtomicInteger counter = new AtomicInteger(0); public String msg;

public void run() throws Exception
{
    for (int i = 0; i < 1000; i++) {
        lockit();
    }
}

private synchronized void lockit() throws Exception
{
    Thread.sleep(1000);
}

public static void main(String[] args) throws Exception
{
   instance.run();
} \}

Fiona OShea 2008-02-28

review during bug fix time.