Package org.eurekaj.proxy

Examples of org.eurekaj.proxy.StoreIncomingStatisticsElement


      }

      StringBuilder sb = new StringBuilder();
      sb.append(agentName).append(":Threads:").append(threadname).append(":ThreadCount");
     
      StoreIncomingStatisticsElement maxElem = new StoreIncomingStatisticsElement();
      maxElem.setGuiPath(sb.toString());
      maxElem.setTimeperiod(timeperiod);
      maxElem.setValue(threadCount);
            maxElem.setUnitType(UnitType.N.value());
            maxElem.setValueType(ValueType.VALUE.value());
      statList.add(maxElem);
    }
    return statList;
  }
View Full Code Here


      } catch (NumberFormatException nfe) {
        log.error("Unable to read in timestamp");
      }
     
     
      StoreIncomingStatisticsElement commitedElem = new StoreIncomingStatisticsElement();
      commitedElem.setGuiPath(agentName + ":Memory:GC:Time Spent In GC(%)");
      commitedElem.setTimeperiod(timeperiod);
            commitedElem.setValue(gcTimeStr);
      commitedElem.setUnitType(UnitType.N.value());
            commitedElem.setValueType(ValueType.VALUE.value());
      statList.add(commitedElem);
    }
    return statList;
  }
View Full Code Here

  public static StringBuilder convertStatListToJson(List<StoreIncomingStatisticsElement> statElemList, String accessToken) {
    StringBuilder jsonBuilder = new StringBuilder();
        jsonBuilder.append("{ \"storeLiveStatistics\": [");
        for (int index = 0; index < statElemList.size() - 1; index++) {
            StoreIncomingStatisticsElement element = statElemList.get(index);
            jsonBuilder.append("{ ");
            jsonBuilder.append("\"guiPath\": \"" + element.getGuiPath() + "\", ");
            jsonBuilder.append("\"timeperiod\": " + element.getTimeperiod() + ", ");
            jsonBuilder.append("\"value\": \"" + element.getValue() + "\", ");
            jsonBuilder.append("\"valueType\": \"" + element.getValueType() + "\", ");
            jsonBuilder.append("\"unitType\": \"" + element.getUnitType() + "\"");
            jsonBuilder.append("}, ");
        }

        //Last element
        if (statElemList.size() > 0) {
            StoreIncomingStatisticsElement element = statElemList.get(statElemList.size() - 1);
            jsonBuilder.append("{ ");
            jsonBuilder.append("\"guiPath\": \"" + element.getGuiPath() + "\", ");
            jsonBuilder.append("\"timeperiod\": " + element.getTimeperiod() + ", ");
            jsonBuilder.append("\"value\": \"" + element.getValue() + "\", ");
            jsonBuilder.append("\"valueType\": \"" + element.getValueType() + "\", ");
            jsonBuilder.append("\"unitType\": \"" + element.getUnitType() + "\"");
            jsonBuilder.append("}");
        }
        jsonBuilder.append("], \"accessToken\": \"" + accessToken + "\" }");
       
        log.info(jsonBuilder.toString());
View Full Code Here

                append(":").
                append(className).
                append(":").
                append(methodName);

                StoreIncomingStatisticsElement statElem = new StoreIncomingStatisticsElement();
                statElem.setGuiPath(sb.toString() + ":Calls Per Interval");
                statElem.setTimeperiod(timeperiod);
                statElem.setValue(invocations);
                statElem.setUnitType(UnitType.N.value());
                statElem.setValueType(ValueType.AGGREGATE.value());
                statElem.setCount(invocations);
                statList.add(statElem);

                StoreIncomingStatisticsElement statElem2 = new StoreIncomingStatisticsElement();
                statElem2.setGuiPath(sb.toString() + ":Total Selftime");
                statElem2.setTimeperiod(timeperiod);
                statElem2.setValue(totalSelftime);
                statElem2.setUnitType(UnitType.NS.value());
                statElem2.setValueType(ValueType.AGGREGATE.value());
                statElem2.setCount(invocations);
                statList.add(statElem2);

                StoreIncomingStatisticsElement statElem3 = new StoreIncomingStatisticsElement();
                statElem3.setGuiPath(sb.toString() + ":Average Selftime");
                statElem3.setTimeperiod(timeperiod);
                statElem3.setValue(avgSelftime);
                statElem3.setUnitType(UnitType.NS.value());
                statElem3.setValueType(ValueType.AVERAGE.value());
                statElem3.setCount(invocations);
                statList.add(statElem3);

                StoreIncomingStatisticsElement statElem4 = new StoreIncomingStatisticsElement();
                statElem4.setGuiPath(sb.toString() + ":Max Selftime");
                statElem4.setTimeperiod(timeperiod);
                statElem4.setValue(maxSelftime);
                statElem4.setUnitType(UnitType.NS.value());
                statElem4.setValueType(ValueType.VALUE.value());
                statElem4.setCount(invocations);
                statList.add(statElem4);

                StoreIncomingStatisticsElement statElem5 = new StoreIncomingStatisticsElement();
                statElem5.setGuiPath(sb.toString() + ":Min Selftime");
                statElem5.setTimeperiod(timeperiod);
                statElem5.setValue(minSelftime);
                statElem5.setUnitType(UnitType.NS.value());
                statElem5.setValueType(ValueType.VALUE.value());
                statElem5.setCount(invocations);
                statList.add(statElem5);

                StoreIncomingStatisticsElement statElem6 = new StoreIncomingStatisticsElement();
                statElem6.setGuiPath(sb.toString() + ":Total Walltime");
                statElem6.setTimeperiod(timeperiod);
                statElem6.setValue(totalWalltime);
                statElem6.setUnitType(UnitType.NS.value());
                statElem6.setValueType(ValueType.AGGREGATE.value());
                statElem6.setCount(invocations);
                statList.add(statElem6);

                StoreIncomingStatisticsElement statElem7 = new StoreIncomingStatisticsElement();
                statElem7.setGuiPath(sb.toString() + ":Avgerage Walltime");
                statElem7.setTimeperiod(timeperiod);
                statElem7.setValue(avgWalltime);
                statElem7.setUnitType(UnitType.NS.value());
                statElem7.setValueType(ValueType.AVERAGE.value());
                statElem7.setCount(invocations);
                statList.add(statElem7);

                StoreIncomingStatisticsElement statElem8 = new StoreIncomingStatisticsElement();
                statElem8.setGuiPath(sb.toString() + ":Max Walltime");
                statElem8.setTimeperiod(timeperiod);
                statElem8.setValue(maxWalltime);
                statElem8.setUnitType(UnitType.NS.value());
                statElem8.setValueType(ValueType.VALUE.value());
                statElem8.setCount(invocations);
                statList.add(statElem8);

                StoreIncomingStatisticsElement statElem9 = new StoreIncomingStatisticsElement();
                statElem9.setGuiPath(sb.toString() + ":Min Walltime");
                statElem9.setTimeperiod(timeperiod);
                statElem9.setValue(minWalltime);
                statElem9.setUnitType(UnitType.NS.value());
                statElem9.setValueType(ValueType.VALUE.value());
                statElem9.setCount(invocations);
                statList.add(statElem9);
            }
        }
    return statList;
  }
View Full Code Here

      StringBuilder sb = new StringBuilder();
      sb.append(agentName)
        .append(":")
        .append(path);
     
      StoreIncomingStatisticsElement statElem = new StoreIncomingStatisticsElement();
      statElem.setGuiPath(sb.toString());
      statElem.setTimeperiod(timeperiod);
      statElem.setValue(value);
            statElem.setValueType(valueType.value());
            statElem.setUnitType((unitType.value()));
            statElem.setCount(count);
      statList.add(statElem);
    }
    return statList;
  }
View Full Code Here

        timeperiod = ((long)(timeperiod / 15000)); //Data is stored in 15-second intervals
      } catch (NumberFormatException nfe) {
        log.error("Unable to read in timestamp");
      }

      StoreIncomingStatisticsElement initElem = new StoreIncomingStatisticsElement();
      initElem.setGuiPath(agentName + ":" + path + ":Init");
      initElem.setTimeperiod(timeperiod);
      initElem.setValue(initMem);
            initElem.setUnitType(UnitType.N.value());
            initElem.setValueType(ValueType.VALUE.value());
            initElem.setCount("1");
      statList.add(initElem);
     
      StoreIncomingStatisticsElement maxElem = new StoreIncomingStatisticsElement();
      maxElem.setGuiPath(agentName + ":" + path + ":Max");
      maxElem.setTimeperiod(timeperiod);
      maxElem.setValue(maxMem);
            maxElem.setUnitType(UnitType.N.value());
            maxElem.setValueType(ValueType.VALUE.value());
            maxElem.setCount("1");
      statList.add(maxElem);
     
      StoreIncomingStatisticsElement usedElem = new StoreIncomingStatisticsElement();
      usedElem.setGuiPath(agentName + ":" + path + ":Used");
      usedElem.setTimeperiod(timeperiod);
      usedElem.setValue(usedMem);
            usedElem.setUnitType(UnitType.N.value());
            usedElem.setValueType(ValueType.VALUE.value());
            usedElem.setCount("1");           
      statList.add(usedElem);
     
      StoreIncomingStatisticsElement commitedElem = new StoreIncomingStatisticsElement();
      commitedElem.setGuiPath(agentName + ":" + path + ":Committed");
      commitedElem.setTimeperiod(timeperiod);
      commitedElem.setValue(commitedMem);
            commitedElem.setUnitType(UnitType.N.value());
            commitedElem.setValueType(ValueType.VALUE.value());
            commitedElem.setCount("1");
      statList.add(commitedElem);
     
    }
    return statList;
  }
View Full Code Here

    List<StoreIncomingStatisticsElement> statElemList = new ArrayList<StoreIncomingStatisticsElement>();
   
    String[] lines = ptpString.split("\n");
    if (lines != null) {
      for (String line : lines) {
        StoreIncomingStatisticsElement elem = parsePtpLine(line);
        if (elem != null) {
          statElemList.add(elem);
        }
      }
    }
View Full Code Here

   * Parsing a PlainTextProtocol PUTVAL line and returning a populated instance of {@link StoreIncomingStatisticsElement}
   * @param ptpLine
   * @return {@link StoreIncomingStatisticsElement}
   */
  private StoreIncomingStatisticsElement parsePtpLine(String ptpLine) {
    StoreIncomingStatisticsElement stat = null;
    String[] ptpParts = ptpLine.split(" ");
    if (ptpParts.length == 4) {
      stat = new StoreIncomingStatisticsElement();
      stat.setGuiPath(addPrependToGuiPath(ptpParts[1].replace("/", ":"), prepend));
      String[] timeVal = ptpParts[3].split(":");
      if (timeVal.length >= 2) {
        stat.setTimeperiod(parseDouble(timeVal[0]).longValue() / 15);
        stat.setValue(timeVal[1].trim());
      }
      stat.setValueType(ValueType.VALUE.value());
      stat.setUnitType(UnitType.N.value());
   
   
    return stat;
  }
View Full Code Here

        timeperiod = ((long)(timeperiod / 15000)); //Round down to nearest 15 second period 00, 15, 30, 45
      } catch (NumberFormatException nfe) {
        log.error("Unable to read in timestamp");
      }

      StoreIncomingStatisticsElement maxElem = new StoreIncomingStatisticsElement();
      maxElem.setGuiPath(agentName + ":" + path + ":ThreadCount");
      maxElem.setTimeperiod(timeperiod);
      maxElem.setValue(threadCount);
            maxElem.setUnitType(UnitType.N.value());
            maxElem.setValueType(ValueType.VALUE.value());
            maxElem.setCount("1");
      statList.add(maxElem);
     
      StoreIncomingStatisticsElement usedElem = new StoreIncomingStatisticsElement();
      usedElem.setGuiPath(agentName + ":" + path + ":PeakThreadCount");
      usedElem.setTimeperiod(timeperiod);
      usedElem.setValue(peakThreadCount);
            usedElem.setUnitType(UnitType.N.value());
            usedElem.setValueType(ValueType.VALUE.value());
            usedElem.setCount("1");
      statList.add(usedElem);
     
      StoreIncomingStatisticsElement commitedElem = new StoreIncomingStatisticsElement();
      commitedElem.setGuiPath(agentName + ":" + path + ":TotalStartedThreads");
      commitedElem.setTimeperiod(timeperiod);
      commitedElem.setValue(totatStartedThreads);
            commitedElem.setUnitType(UnitType.N.value());
            commitedElem.setValueType(ValueType.VALUE.value());
            commitedElem.setCount("1");
      statList.add(commitedElem);
    }
    return statList;
  }
View Full Code Here

TOP

Related Classes of org.eurekaj.proxy.StoreIncomingStatisticsElement

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.