Examples of Metric


Examples of Package.Entities.Metric

        sum = sumarizeMetrics(metrics, sum);
        return sum;
    }

    private Metric[] initializeMetrics(ReaderMethod reader) {
         Metric metrics[] = {new NumberOfFor(reader),new NumberOfIf(reader),new NumberOfWhile(reader),
             new NumberOfTry(reader),new NumberOfForeach(reader),new NumberOfCase(reader),
             new NumberOfDefault(reader),new NumberOfContinue(reader),new NumberOfAnd(reader),
             new NumberOfOr(reader),new NumberOfDoubleCondition(reader)};
        return metrics;
    }
View Full Code Here

Examples of ch.hortis.sonar.model.Metric

public abstract class RciCalculator extends AbstractMetricCalculator {
  protected abstract Metrics getCountMetric();

  public void execute(Module module, List<Module> directSubmodules) {
    Metric countMetric = getMetric(getCountMetric());

    for (MeasureKey key : module.getMeasureKeys()) {
      if (key.getMetric().equals(countMetric)) {
        MeasureKey linesKey = new MeasureKey(getMetric(Metrics.NCSS_NCSS), null, null, key.getFile());
        Double lines = module.getMeasureValue(linesKey);
View Full Code Here

Examples of com.bluesoft.util.metrics.core.Metric

  @Test
  public void testGetChildMeteringWrappingMetric() {
    TimingMetric mock = createMock( TimingMetric.class );
    UnitRoundingMeteringMetric rounder = new UnitRoundingMeteringMetric( TimeUnit.MINUTES, mock );
    final Metric child = new AbstractMetric( "test" ) {
    };
    expect( mock.getChild( eq( "test" ) ) ).andStubReturn( child );
    replay( mock );
    assertSame( rounder.getChild( "test" ), child );
    verify( mock );
View Full Code Here

Examples of com.codahale.metrics.Metric

    }

    @Test
    public void aMethodAnnotatedWithBothAMeteredAndAnExceptionCounter() throws Exception {

        final Metric meteredMetric = registry.getMeters().get(name(InstrumentedWithExceptionMetered.class,
            "meteredAndException", MeteredInterceptor.METERED_SUFFIX));

        final Metric errorMetric = registry.getMeters().get(name(InstrumentedWithExceptionMetered.class,
            "meteredAndException", DEFAULT_NAME_SUFFIX));

        assertThat("Guice creates a metric",
            meteredMetric,
            is(notNullValue()));
View Full Code Here

Examples of com.dianping.cat.message.Metric

  }

  @Test
  public void testMetric() {
    long timestamp = 1325489621987L;
    Metric metric = newMetric("type", "name", timestamp, "0", "here is the data.");

    check(metric, "M2012-01-02 15:33:41.987\ttype\tname\t0\there is the data.\t\n");
  }
View Full Code Here

Examples of com.etao.adhoc.metric.Metric

    String day = fmt.format(new Date());
 
    String store = (String) conf.get("higo.download.offline.store")
        + "/" + day + "/" + java.util.UUID.randomUUID().toString();
   
    Metric metric = null;
    String sql = String.format(sqlFormat, thedate);
   
    HiveExecute hivexec=new HiveExecute();
    hivexec.setConfdir(hdpConf);
    hivexec.setStoreDir(store);
    hivexec.setHql("INSERT OVERWRITE DIRECTORY '" + store +"' "+sql+"");
    hivexec.setCallback(this);
    hivexec.init();
    hivexec.run();
   
   
    Configuration hconf=new Configuration();
     HadoopBaseUtils.grabConfiguration(hdpConf, hconf);
    FileSystem fs = FileSystem.get(hconf);
    Path dir = new Path(store);
    if (!fs.exists(dir)) {
      throw new IOException("can not found path:" + store);
    }
    FileStatus[] filelist = fs.listStatus(dir);
 
    Long bytesRead = 0l;
    long maxsize = 1024l * 1024 * 1024 * 10;
 
    String[] result=null;
   
    boolean isbreak=false;
    for (FileStatus f : filelist) {
      System.out.println(f.getPath().toString());
      if(isbreak)
      {
        break;
      }
      if (!f.isDir() && !f.getPath().getName().startsWith("_")) {
        FSDataInputStream in = fs.open(f.getPath());
        BufferedReader bf=new BufferedReader(new InputStreamReader(in));
        String line;
        while ((line = bf.readLine()) != null) {
          bytesRead += line.getBytes().length;
          String towrite=line.replaceAll("\001", ",").replaceAll("\t", ",");
          System.out.println(towrite);
          if(!towrite.isEmpty())
          {
            result=towrite.split(",");
            if(result.length<8)
            {
              isbreak=true;
              result=null;
            }
          }
          if (bytesRead >= maxsize) {
            bf.close();
            in.close();
            isbreak=true;
          }
         
          if(isbreak)
          {
            break;
          }
        }
        bf.close();
        in.close();
      }
    }
   
    System.out.println(Arrays.toString(result));
    if(result!=null&&result.length>=8)
    {
      metric = new Metric();
      metric.setThedate(thedate);
      metric.setType(0);
      metric.setTablename(tablename);
      metric.setLineCnt((long)Float.parseFloat(result[0]));
      metric.setImpression((long)Float.parseFloat(result[1]));
      metric.setFinClick((long)Float.parseFloat(result[2]));
      metric.setFinPrice(Float.parseFloat(result[3]));
      metric.setAlipayDirectNum((long)Float.parseFloat(result[4]));
      metric.setAlipayDirectAmt(Float.parseFloat(result[5]));
      metric.setAlipayIndirectNum((long)Float.parseFloat(result[6]));
      metric.setAlipayIndirectAmt(Float.parseFloat(result[7]));
      System.out.println(metric.toString());
    }
    return metric;
 
  }
View Full Code Here

Examples of com.etao.adhoc.metric.Metric

    } else {
      System.out.println("UpdateService: unknown query type " + queryFrom);
    }
  }
  public void load(String tablename, String thedate) throws IOException {
    Metric metric = queryServer.getMetric(tablename, thedate);
    String queryServiceName = queryServer.getName();
 
    if(metric == null){
      System.out.println(queryServiceName + " RETURN NULL");
    } else {
View Full Code Here

Examples of com.etao.adhoc.metric.Metric

    }
   
  }
  public Metric getMetric(String tablename, String thedate) throws IOException{
    String sqlFormat=(String) conf.get("adhoc.metric.mdrill.sql."+tablename);
    Metric metric = null;
    String sql = String.format(sqlFormat, thedate);
    System.out.println("Higo SQL:" + sql);
    MdrillQueryResultSet rs;
    try {
      rs = (MdrillQueryResultSet) stmt.executeQuery(sql);
      if(rs.next()){
        metric = new Metric();
        metric.setThedate(thedate);
        metric.setType(1);
        metric.setTablename(tablename);
        metric.setLineCnt((long)Float.parseFloat(rs.getString(1)));
        metric.setImpression((long)Float.parseFloat(rs.getString(2)));
        metric.setFinClick((long)Float.parseFloat(rs.getString(3)));
        metric.setFinPrice(Float.parseFloat(rs.getString(4)));
        metric.setAlipayDirectNum((long)Float.parseFloat(rs.getString(5)));
        metric.setAlipayDirectAmt(Float.parseFloat(rs.getString(6)));
        metric.setAlipayIndirectNum((long)Float.parseFloat(rs.getString(7)));
        metric.setAlipayIndirectAmt(Float.parseFloat(rs.getString(8)));
      }
    } catch (SQLException e) {
      System.err.println("[" + sdf.format(new Date(System.currentTimeMillis())) + "] "
          + "Error when execute Higo SQL: "
          + sql);
View Full Code Here

Examples of com.gitblit.models.Metric

    if (user == null) {
      user = UserModel.ANONYMOUS;
    }

    List<Metric> metrics = null;
    Metric metricsTotal = null;
    if (!model.skipSummaryMetrics && app().settings().getBoolean(Keys.web.generateActivityGraph, true)) {
      metrics = app().repositories().getRepositoryDefaultMetrics(model, r);
      metricsTotal = metrics.remove(0);
    }
View Full Code Here

Examples of com.google.gdata.data.analytics.Metric

      // Put the results in a list of String arrays.
      for (DataEntry entry : dataFeed.getEntries()) {
        // Calculate bounce rate.
        bounceRate = entry.doubleValueOf("ga:bounces") / entry.doubleValueOf("ga:entrances") * 100;
        eComRate = entry.doubleValueOf("ga:transactions") / entry.doubleValueOf("ga:visits") * 100;
        Metric myVisits = entry.getMetric("ga:visits");
       
        myVisitsCI =String.valueOf(f.format(myVisits.getConfidenceInterval()));
        dataList.add(new String[] {
          entry.stringValueOf("ga:year"),
          entry.stringValueOf("ga:month"),
          entry.stringValueOf("ga:visits"),
          entry.stringValueOf("ga:transactions"),
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.