Examples of MetricValue


Examples of com.metrictracker.model.MetricValue

      Iterator<MetricValue> metricValues = dao.listByProperty("metricKey", metric.getKey()).iterator();
      StringBuffer sb = new StringBuffer("");
    sb.append("Metric Name: " + metric.getName());
    sb.append(System.getProperty("line.separator"));
    while (metricValues.hasNext()) {
       MetricValue metricValue = metricValues.next();
       sb.append(metricValue.getTimeFrame());
       sb.append("\t");
       sb.append(metricValue.getValue());
       sb.append(System.getProperty("line.separator"));
    }
    
        return sb.toString();
    }
View Full Code Here

Examples of com.metrictracker.model.MetricValue

          String value = parameters.get("value");
          String timeFrame = parameters.get("timeFrame");
         
          Metric metric = getMetric();
         
          MetricValue metricValue = new MetricValue();
          metricValue.setMetric(metric);
          metricValue.setTimeFrame(Date.valueOf(timeFrame));
          metricValue.setMetricValue(Long.valueOf(value));
         
          ofy.put(metricValue);
        getResponse().setStatus(Status.SUCCESS_CREATED)
           
    } catch (IOException e) {
View Full Code Here

Examples of com.metrictracker.model.MetricValue

    MetricValueDao valueDao = new MetricValueDao();
    MetricGoalDao goalDao = new MetricGoalDao();
    List<MetricGoal> metricGoals = goalDao.listByProperty("metricKey", metric.getKey());
    Iterator<MetricValue> values =  valueDao.listByProperty("metricKey", metric.getKey()).iterator();
    while (values.hasNext()) {
      MetricValue value = values.next();
      for (int i=0; i< metricGoals.size(); i++) {
        String isGoalMet = "N";
        MetricGoal goal = metricGoals.get(i);
        if (value.getTimeFrame().after(goal.getEffectivityDate()) &&
            value.getTimeFrame().before(goal.getExpirationDate())) {
          if (goal.getGoalType().equals(MetricGoal.HIGHISBETTER) && goal.getGoal() <= value.getValue()) {
            isGoalMet = "Y";
          }
          else if (goal.getGoalType().equals(MetricGoal.LOWISBETTER) && goal.getGoal() >= value.getValue()) {
            isGoalMet = "Y";
          }
        }
        sb.append(value.getTimeFrame());
        sb.append("\t");
        sb.append(value.getValue());
        sb.append("\t\t");
        sb.append(goal.getName());
        sb.append("\t\t");
        sb.append(goal.getGoal());
        sb.append("\t\t");
        sb.append(isGoalMet);
        sb.append("\t\t");
        sb.append(MessageFormat.format("{0,number,#.##%}", value.getValue() / goal.getGoal()));
        sb.append(System.getProperty("line.separator"));
      }
    }
    return sb.toString();
  }
View Full Code Here

Examples of com.metrictracker.model.MetricValue

    while (values.hasNext()) {

      j++;
      log.log(Level.WARNING, "value #" + j);
     
      MetricValue value = values.next();
      for (int i=0; i< metricGoals.size(); i++) {
        String isGoalMet = "N";
        MetricGoal goal = metricGoals.get(i);
        if (value.getTimeFrame().after(goal.getEffectivityDate()) &&
            value.getTimeFrame().before(goal.getExpirationDate())) {
          if (goal.getGoalType().equals(MetricGoal.HIGHISBETTER) && goal.getGoal() <= value.getValue()) {
            isGoalMet = "Y";
          }
          else if (goal.getGoalType().equals(MetricGoal.LOWISBETTER) && goal.getGoal() >= value.getValue()) {
            isGoalMet = "Y";
          }
        }
       
       
        try {
         
          log.log(Level.WARNING, "timeframe: " + value.getTimeFrame());
          log.log(Level.WARNING, "value: " + value.getValue());
          log.log(Level.WARNING, "goal name: " + goal.getName());
          log.log(Level.WARNING, "isGoalMet: " + isGoalMet);
          log.log(Level.WARNING, "percent to goal: " + MessageFormat.format("{0,number,#.##%}", value.getValue() / goal.getGoal()));
         
          TableRow row = new TableRow();
          row.addCell(new TableCell(new TextValue(value.getTimeFrame().toString())));
          row.addCell(new TableCell(new NumberValue(value.getValue())));
          row.addCell(new TableCell(new TextValue(goal.getName())));
          row.addCell(new TableCell(new TextValue(isGoalMet)));
          row.addCell(new TableCell(new TextValue(MessageFormat.format("{0,number,#.##%}", value.getValue() / goal.getGoal()))));
         
          data.addRow(row);
          } catch (TypeMismatchException e) {
          ExceptionManager.logException(log, e);
          return null;
View Full Code Here

Examples of com.skymobi.monitor.model.MetricValue

        String[] patten=new String[]{"M"};
        long m7 = DateUtils.parseDate("7", patten).getTime();
        long m8 = DateUtils.parseDate("8", patten).getTime();
        long m9 = DateUtils.parseDate("9", patten).getTime();
        List<MetricValue> metricValues1= Lists.newArrayList(new MetricValue("pay",2, m8) );
        List<MetricValue> metricValues2= Lists.newArrayList(new MetricValue("request",10,m7),new MetricValue("request",12,m8),new MetricValue("request",13,m9) );
        List<MetricValue> metricValues3= Lists.newArrayList();
        List<List<MetricValue>> lists = Lists.newArrayList(metricValues1, metricValues2,metricValues3);
        List<List> chartRows = ChartUtil.format(lists);
         Assert.assertEquals(4,chartRows.size());
        //time ,pay,request
View Full Code Here

Examples of edu.pku.sei.metric.MetricValue

        String[] cols = new String[] { name, "", "", "",
            descriptors[i].getDescription(), "" };

        if (level <= ms.getLevel()) {
          rowNeeded = true;
          MetricValue m = ms.getValue(name);
          if (m != null) {
            cols[1] = format(m.getValue());
          }
        }

        AvgValue avg = ms.getAverageValue(name);
        MaxValue max = ms.getMaxValue(name);
View Full Code Here

Examples of edu.pku.sei.metric.MetricValue

      for (int i = 0; i < children.length; i++) {
        if (level <= children[i].getLevel()) {
          TreeItem child = createNewRow(row);
          child.setText(getElementName(children[i].getJavaElement()));
          child.setImage(getImage(children[i]));
          MetricValue val = children[i].getValue(metric);
          child.setText(1, (val != null) ? format(val.getValue())
              : "");
          AvgValue avg = children[i].getAverageValue(metric);
          MaxValue max = children[i].getMaxValue(metric);
          if ((avg != null) || (max != null)) {
            if (avg != null) {
View Full Code Here

Examples of edu.pku.sei.metric.MetricValue

    private Prefs prefs = new Prefs();

    public BasicMetric(AbstractMetricElement source) {
      super(source);
      values = new MetricValue[] { new MetricValue(NORM, 0) };
    }
View Full Code Here

Examples of edu.pku.sei.metric.MetricValue

  private class BasicMetric extends Metric {

    public BasicMetric(AbstractMetricElement source) {
      super(source);
      values = new MetricValue[] { new MetricValue(MLOC, 0) };
    }
View Full Code Here

Examples of edu.pku.sei.metric.MetricValue

  private class BasicMetric extends Metric {

    public BasicMetric(AbstractMetricElement source) {
      super(source);
      values = new MetricValue[] { new MetricValue(NOF, 0),
          new MetricValue(NUM_INST_FIELDS, 0),
          new MetricValue(NUM_STAT_FIELDS, 0) };
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.