Package org.apache.jmeter.monitor.model

Examples of org.apache.jmeter.monitor.model.Connector


   * @return thread load
   */ 
  public static int calculateThreadLoad(Status stat){
    int load = 0;
    if (stat != null){
      Connector cntr = (Connector)stat.getConnector().get(0);
      double max = (double)cntr.getThreadInfo().getMaxThreads();
      double current =
        (double)cntr.getThreadInfo().getCurrentThreadsBusy();
      load = (int)((current/max) * 100);
    }
    return load;
  }
View Full Code Here


            // modifications. Weblogic will return nothing for
            // the connector, therefore we need to check the size
            // of the list. Peter 12.22.04
            double threadWeight = 0;
            if (stat.getConnector().size() > 0) {
                Connector cntr = fetchConnector(stat);
                int maxThread = cntr.getThreadInfo().getMaxThreads();
                int curThread = cntr.getThreadInfo().getCurrentThreadsBusy();
                double thdiv = (double) curThread / (double) maxThread;
                threadWeight = DEFAULT_THREAD_FACTOR * thdiv;
            }
            return (int) (memWeight + threadWeight);
        } else {
View Full Code Here

     * @param stat
     * @return integer representing the status
     */
    public static int calculateStatus(Status stat) {
        if (stat != null && stat.getConnector().size() > 0) {
            Connector cntr = fetchConnector(stat);
            int max = cntr.getThreadInfo().getMaxThreads();
            int current = cntr.getThreadInfo().getCurrentThreadsBusy();
            // int spare = cntr.getThreadInfo().getMaxSpareThreads();
            double per = (double) current / (double) max;
            if (per > WARNING_PER) {
                return WARNING;
            } else if (per >= ACTIVE_PER && per <= WARNING_PER) {
View Full Code Here

     * @return thread load
     */
    public static int calculateThreadLoad(Status stat) {
        int load = 0;
        if (stat != null && stat.getConnector().size() > 0) {
            Connector cntr = fetchConnector(stat);
            double max = cntr.getThreadInfo().getMaxThreads();
            double current = cntr.getThreadInfo().getCurrentThreadsBusy();
            load = (int) ((current / max) * 100);
        }
        return load;
    }
View Full Code Here

     *
     * @param stat
     * @return connector
     */
    private static Connector fetchConnector(Status stat) {
        Connector cntr = null;
        String connectorPrefix = stat.getConnectorPrefix();
        if (connectorPrefix != null && connectorPrefix.length() > 0) {
           // loop to fetch desired connector
           for (int i = 0; i < stat.getConnector().size(); i++) {
               cntr = (Connector) stat.getConnector().get(i);
               if (cntr.getName().startsWith(connectorPrefix)) {
                   return cntr;
               }
           }          
        }
        // default : get first connector
View Full Code Here

      // modifications. Weblogic will return nothing for
      // the connector, therefore we need to check the size
      // of the list. Peter 12.22.04
      double threadWeight = 0;
      if (stat.getConnector().size() > 0) {
        Connector cntr = (Connector) stat.getConnector().get(0);
        int maxThread = cntr.getThreadInfo().getMaxThreads();
        int curThread = cntr.getThreadInfo().getCurrentThreadsBusy();
        double thdiv = (double) curThread / (double) maxThread;
        threadWeight = DEFAULT_THREAD_FACTOR * thdiv;
      }
      return (int) (memWeight + threadWeight);
    } else {
View Full Code Here

   * @param stat
   * @return integer representing the status
   */
  public static int calculateStatus(Status stat) {
    if (stat != null && stat.getConnector().size() > 0) {
      Connector cntr = (Connector) stat.getConnector().get(0);
      int max = cntr.getThreadInfo().getMaxThreads();
      int current = cntr.getThreadInfo().getCurrentThreadsBusy();
      // int spare = cntr.getThreadInfo().getMaxSpareThreads();
      double per = (double) current / (double) max;
      if (per > WARNING_PER) {
        return WARNING;
      } else if (per >= ACTIVE_PER && per <= WARNING_PER) {
View Full Code Here

   * @return thread load
   */
  public static int calculateThreadLoad(Status stat) {
    int load = 0;
    if (stat != null && stat.getConnector().size() > 0) {
      Connector cntr = (Connector) stat.getConnector().get(0);
      double max = cntr.getThreadInfo().getMaxThreads();
      double current = cntr.getThreadInfo().getCurrentThreadsBusy();
      load = (int) ((current / max) * 100);
    }
    return load;
  }
View Full Code Here

            // modifications. Weblogic will return nothing for
            // the connector, therefore we need to check the size
            // of the list. Peter 12.22.04
            double threadWeight = 0;
            if (stat.getConnector().size() > 0) {
                Connector cntr = fetchConnector(stat);
                int maxThread = cntr.getThreadInfo().getMaxThreads();
                int curThread = cntr.getThreadInfo().getCurrentThreadsBusy();
                double thdiv = (double) curThread / (double) maxThread;
                threadWeight = DEFAULT_THREAD_FACTOR * thdiv;
            }
            return (int) (memWeight + threadWeight);
        } else {
View Full Code Here

     * @param stat
     * @return integer representing the status
     */
    public static int calculateStatus(Status stat) {
        if (stat != null && stat.getConnector().size() > 0) {
            Connector cntr = fetchConnector(stat);
            int max = cntr.getThreadInfo().getMaxThreads();
            int current = cntr.getThreadInfo().getCurrentThreadsBusy();
            // int spare = cntr.getThreadInfo().getMaxSpareThreads();
            double per = (double) current / (double) max;
            if (per > WARNING_PER) {
                return WARNING;
            } else if (per >= ACTIVE_PER && per <= WARNING_PER) {
View Full Code Here

TOP

Related Classes of org.apache.jmeter.monitor.model.Connector

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.