Package com.dianping.cat.home.utilization.entity

Examples of com.dianping.cat.home.utilization.entity.ApplicationState


          String project = typeInfo.getProjectName();

          if (!validataService(project)) {
            long failure = typeInfo.getFailureCount();
            Domain d = utilizationReport.findOrCreateDomain(project);
            ApplicationState service = d.findApplicationState("PigeonService");

            if (service != null) {
              service.setFailureCount(service.getFailureCount() + failure);

              long count = service.getCount();
              if (count > 0) {
                service.setFailurePercent(service.getFailureCount() * 1.0 / count);
              }
            }
          }
        }
      }
View Full Code Here


    } else if ("Call".equals(typeName)) {
      typeName = "PigeonCall";
    } else if (typeName.startsWith(MEMCACHED)) {
      typeName = MEMCACHED;
    }
    ApplicationState applicationState = null;

    if (m_types.contains(typeName)) {
      applicationState = domain.findOrCreateApplicationState(typeName);
      copyAttribute(type, applicationState);
    }
    super.visitType(type);

    if (applicationState != null) {
      long max = 0;

      for (Entry<Integer, Long> entry : m_counts.entrySet()) {
        long value = entry.getValue();

        if (value > max) {
          max = value;
        }
      }
      applicationState.setMaxQps(max * 1.0 / (5 * 60));
    }

    m_counts.clear();
  }
 
View Full Code Here

TOP

Related Classes of com.dianping.cat.home.utilization.entity.ApplicationState

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.