Examples of JavaThread


Examples of com.dianping.cat.consumer.problem.model.entity.JavaThread

        Map<String, JavaThread> threads = entry.getThreads();
        String type = entry.getType();
        String status = entry.getStatus();

        for (Entry<String, JavaThread> problemEntry : threads.entrySet()) {
          JavaThread thread = problemEntry.getValue();

          for (Entry<Integer, Segment> segmentEntry : thread.getSegments().entrySet()) {
            Segment segment = segmentEntry.getValue();
            int minute = segment.getId();
            int count = segment.getMessages().size();
            String summaryKey = type;
View Full Code Here

Examples of com.dianping.cat.consumer.problem.model.entity.JavaThread

    if (messages.size() < MAX_LOG_SIZE) {
      messages.add(tree.getMessageId());
    }

    //make problem thread id = thread group name, make report small
    JavaThread thread = entry.findOrCreateThread(tree.getThreadGroupName());

    if (thread.getGroupName() == null) {
      thread.setGroupName(tree.getThreadGroupName());
    }
    if (thread.getName() == null) {
      thread.setName(tree.getThreadName());
    }

    Segment segment = thread.findOrCreateSegment(getSegmentByMessage(tree));
    List<String> segmentMessages = segment.getMessages();

    segment.incCount();
    if (segmentMessages.size() < MAX_LOG_SIZE) {
      segmentMessages.add(tree.getMessageId());
View Full Code Here

Examples of com.dianping.cat.consumer.problem.model.entity.JavaThread

  public void visitSegment(Segment segment) {
    int minute = segment.getId();
    int count = segment.getCount();
    Machine machine = m_report.findOrCreateMachine(m_currentDomain);
    Entry entry = findOrCreatEntry(machine, m_currentType, m_currentState);
    JavaThread thread = entry.findOrCreateThread(m_currentThread);
    Segment temp = thread.findOrCreateSegment(minute);

    temp.setCount(temp.getCount() + count);
  }
View Full Code Here

Examples of com.dianping.cat.consumer.problem.model.entity.JavaThread

    List<Entry> entries = machine.getEntries();
    for (Entry temp : entries) {
      Map<String, JavaThread> threads = temp.getThreads();

      for (java.util.Map.Entry<String, JavaThread> entry : threads.entrySet()) {
        JavaThread thread = entry.getValue();

        String groupName = thread.getGroupName();
        GroupStatistics statistics = findOrCreatGroupStatistics(groupName, m_minutes);
        statistics.add(thread.getSegments(), temp.getType());
      }
    }
    long currentTimeMillis = System.currentTimeMillis();
    long currentHours = currentTimeMillis - currentTimeMillis % (60 * 60 * 1000);
    if (currentHours == m_model.getLongDate()) {
View Full Code Here

Examples of com.dianping.cat.consumer.problem.model.entity.JavaThread

    List<Entry> entries = machine.getEntries();
    for (Entry temp : entries) {
      Map<String, JavaThread> threads = temp.getThreads();

      for (java.util.Map.Entry<String, JavaThread> entry : threads.entrySet()) {
        JavaThread thread = entry.getValue();
        String groupName = thread.getGroupName();
        String threadId = thread.getId();
        GroupStatistics statistics = findOrCreatGroupStatistics(groupName, m_minutes);

        if (groupName.equals(m_groupName)) {
          statistics.add(threadId, thread.getSegments(), m_minutes, temp.getType());
          findOrCreatThreadInfo(groupName, threadId);
        } else {
          statistics.add(groupName, thread.getSegments(), m_minutes, temp.getType());
          findOrCreatThreadInfo(groupName, groupName);
        }
      }
    }
    long currentTimeMillis = System.currentTimeMillis();
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

    assertEquals("Enters count incorrect :" + count, 2, count);
  }

  public void testCountOwners_2_2_1() throws Exception {
    JavaMonitor monitor = (JavaMonitor)setup.findMonitorThreadConfig(2, 2, 1).getMonitor();
    JavaThread owner = monitor.getOwner();

    assertNotNull("Owner count incorrect", owner);
  }
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

    assertNull(error, error);
  }
 
  public void testNameOwners_2_2_1() throws Exception {
    JavaMonitor monitor = (JavaMonitor)setup.findMonitorThreadConfig(2, 2, 1).getMonitor();
    JavaThread owner = monitor.getOwner();

    assertEquals("Owner name incorrect", generatePrefix(2, 2, 1) + "-"
        + SetupJavaMonitor_ObjectMonitors.monitorOwnerThreadName + "-0", owner.getName());
  }
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

   
    while (waiters.hasNext()) {
      Object next = waiters.next();
     
      if (next instanceof JavaThread) {
        JavaThread thread = (JavaThread) next;
        foundSet.add(thread.getName());
      }
    }
   
    for(int i=0; i < count; i++) {
      String threadName = prefix+"-"+i;
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

        if (next instanceof CorruptData) {
          System.out.println("enter waiter corrupt: "+ next);
          continue;
        }
       
        JavaThread thread = (JavaThread) next;
       
        try {
          System.out.println("EnterWaiter: "+thread.getName());
        } catch (CorruptDataException e) {
          assertNotNull(e.getCorruptData());
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
               
               
      }
     
      System.out.println("\nmonitor.getNotifyWaiters():");
     
      Iterator notifiers = monitor.getNotifyWaiters().iterator();
     
      while (notifiers.hasNext()) {
        Object next = notifiers.next();
       
        if (next instanceof CorruptData) {
          System.out.println("notify waiter corrupt: "+ next);
          continue;
        }
       
        JavaThread thread = (JavaThread) next;
       
        try {
          System.out.println("NotifyWaiter: "+thread.getName());
        } catch (CorruptDataException e) {
          assertNotNull(e.getCorruptData());
          // TODO Auto-generated catch block
          e.printStackTrace();
        }               
      }
     
      JavaThread thread;
      try {
        thread = monitor.getOwner();
        if (thread == null) {
          System.out.println("Owner thread = null");
        } else {
          try {
            System.out.println("Owner thread = "+thread.getName());
          } catch (CorruptDataException e) {
            assertNotNull(e.getCorruptData());
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

    assertEquals("Enters count incorrect :" + count, 1, count);
  }

  public void testCountOwners_0_1_1() throws Exception {
    JavaMonitor monitor = (JavaMonitor) setup.findMonitorThreadConfig(0, 1, 1).getMonitor();
    JavaThread owner = monitor.getOwner();

    assertNotNull("Owner count incorrect", owner);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.