Package com.dianping.cat.configuration.server.entity

Examples of com.dianping.cat.configuration.server.entity.Domain


    m_normalizePayload.normalize(model, payload);
  }

  private void setDefaultThreshold(Model model, Payload payload) {
    Map<String, Domain> domains = m_manager.getLongConfigDomains();
    Domain d = domains.get(payload.getDomain());

    if (d != null) {
      int longUrlTime = d.getUrlThreshold() == null ? m_manager.getLongUrlDefaultThreshold() : d.getUrlThreshold()
            .intValue();

      if (longUrlTime != 500 && longUrlTime != 1000 && longUrlTime != 2000 && longUrlTime != 3000
            && longUrlTime != 4000 && longUrlTime != 5000) {
        double sec = (double) (longUrlTime) / (double) 1000;
        NumberFormat nf = new DecimalFormat("#.##");
        String option = "<option value=\"" + longUrlTime + "\"" + ">" + nf.format(sec) + " Sec</option>";

        model.setDefaultThreshold(option);
      }

      int longSqlTime = d.getSqlThreshold();

      if (longSqlTime != 100 && longSqlTime != 500 && longSqlTime != 1000) {
        double sec = (double) (longSqlTime);
        NumberFormat nf = new DecimalFormat("#");
        String option = "<option value=\"" + longSqlTime + "\"" + ">" + nf.format(sec) + " ms</option>";
View Full Code Here

TOP

Related Classes of com.dianping.cat.configuration.server.entity.Domain

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.