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 && 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 = stat.getConnector().get(i);
               if (cntr.getName().startsWith(connectorPrefix)) {
                   return cntr;
               }
           }
        }
        // default : get first connector
View Full Code Here

            System.out.println("free: " + bfree);
            System.out.println("total: " + btotal);
            System.out.println("max: " + bmax);

            for (int idx = 0; idx < objects; idx++) {
                Connector cnn = of.createConnector();
                Workers wkrs = of.createWorkers();
                for (int idz = 0; idz < 26; idz++) {
                    Worker wk0 = of.createWorker();
                    wk0.setCurrentQueryString("/manager/status");
                    wk0.setCurrentUri("http://localhost/manager/status");
                    wk0.setMethod("GET");
                    wk0.setProtocol("http");
                    wk0.setRemoteAddr("?");
                    wk0.setRequestBytesReceived(132);
                    wk0.setRequestBytesSent(18532);
                    wk0.setStage("K");
                    wk0.setVirtualHost("?");
                    wkrs.getWorker().add(wk0);
                }
                cnn.setWorkers(wkrs);

                RequestInfo rqinfo = of.createRequestInfo();
                rqinfo.setBytesReceived(0);
                rqinfo.setBytesSent(434374);
                rqinfo.setErrorCount(10);
                rqinfo.setMaxTime(850);
                rqinfo.setProcessingTime(2634);
                rqinfo.setRequestCount(1002);
                cnn.setRequestInfo(rqinfo);

                ThreadInfo thinfo = of.createThreadInfo();
                thinfo.setCurrentThreadCount(50);
                thinfo.setCurrentThreadsBusy(12);
                thinfo.setMaxSpareThreads(50);
                thinfo.setMaxThreads(150);
                thinfo.setMinSpareThreads(10);
                cnn.setThreadInfo(thinfo);

                Jvm vm = of.createJvm();
                Memory mem = of.createMemory();
                mem.setFree(77280);
                mem.setTotal(134210000);
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

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.