Package com.dianping.cat.consumer.dependency.model.entity

Examples of com.dianping.cat.consumer.dependency.model.entity.Index


    if (m_exceptions.contains(type)) {
      long current = event.getTimestamp() / 1000 / 60;
      int min = (int) (current % (60));
      Segment segment = report.findOrCreateSegment(min);
      Index index = segment.findOrCreateIndex("Exception");

      index.incTotalCount();
      index.incErrorCount();
    }
  }
View Full Code Here


    if (m_types.contains(type) || isCache(type)) {
      long current = t.getTimestamp() / 1000 / 60;
      int min = (int) (current % (60));
      Segment segment = report.findOrCreateSegment(min);
      Index index = segment.findOrCreateIndex(type);

      if (!t.getStatus().equals(Transaction.SUCCESS)) {
        index.incErrorCount();
      }
      index.incTotalCount();
      index.setSum(index.getSum() + t.getDurationInMillis());
      index.setAvg(index.getSum() / index.getTotalCount());
    }

    if (isCache(type)) {
      updateDependencyInfo(report, t, type, "Cache");
    }
View Full Code Here

    Assert.assertEquals(m_orginalContent.replaceAll("\r", ""), m_manager.getConfig().toString().replaceAll("\r", ""));
  }
 
  @Test
  public void testBuildNodeStateByError(){
    Index index = new Index("URL");
    index.setAvg(40.0);
    index.setErrorCount(50);
    index.setSum(1000.0);
    index.setTotalCount(100);
   
    Pair<Integer, String> state = m_manager.buildNodeState("cat", index);
    Assert.assertEquals(GraphConstrant.OK, (int)state.getKey());
   
    index.setErrorCount(100);
    state = m_manager.buildNodeState("cat", index);
    Assert.assertEquals(GraphConstrant.WARN, (int)state.getKey());

    index.setErrorCount(200);
    state = m_manager.buildNodeState("cat", index);
    Assert.assertEquals(GraphConstrant.ERROR, (int)state.getKey());
  }
View Full Code Here

    Assert.assertEquals(GraphConstrant.ERROR, (int)state.getKey());
  }
 
  @Test
  public void testBuildNodeStateByResponse(){
    Index index = new Index("URL");
    String domain = "UserWeb";
    index.setAvg(5.0);
    index.setErrorCount(5);
    index.setSum(1000.0);
    index.setTotalCount(100);
   
    Pair<Integer, String> state = m_manager.buildNodeState(domain, index);
    Assert.assertEquals(GraphConstrant.OK, (int)state.getKey());
   
    index.setAvg(10.0);
    state = m_manager.buildNodeState(domain, index);
    Assert.assertEquals(GraphConstrant.WARN, (int)state.getKey());

    index.setAvg(100.0);
    state = m_manager.buildNodeState(domain, index);
    Assert.assertEquals(GraphConstrant.ERROR, (int)state.getKey());
  }
View Full Code Here

    for (Segment segment : segments.values()) {
      Map<String, Dependency> dependencies = segment.getDependencies();
      Map<String, Index> indexs = segment.getIndexs();

      for (Index index : indexs.values()) {
        Index temp = result.findOrCreateIndex(index.getName());
        merger.mergeIndex(temp, index);
      }
      for (Dependency dependency : dependencies.values()) {
        Dependency temp = result.findOrCreateDependency(dependency.getKey());
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.dependency.model.entity.Index

Copyright © 2018 www.massapicom. 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.