Package com.google.gdata.data.analytics

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


        }
        entry.addDimension(dimension);
      }
      // Add all metrics.
      for (int metricIndex = 0; metricIndex < metrics.length; metricIndex++) {
        Metric metric = new Metric();
        metric.setValue(metrics[metricIndex][entryIndex]);
        metric.setConfidenceInterval(confidenceInterval);
        entry.addMetric(metric);
      }
      entryList.add(entry);
    }
View Full Code Here

   *     object.
   */
  @Override
  public void addRows(DataFeed feed) {
    List<Double> row = new ArrayList<Double>(results.getNumRows());
    Metric metric;
    boolean isSampled = false;

    for (DataEntry entry : feed.getEntries()) {
      metric = entry.getMetrics().get(0);
      if (!isSampled && 0 != metric.getConfidenceInterval()) {
        isSampled = true;
      }
      row.add(new Double(metric.getValue()));
    }
    results.addRow(row);
    results.setIsSampled(isSampled);
  }
View Full Code Here

      if (!foundDate.equals(expectedDate)) {
        backFillRow(expectedDate, foundDate, row);
      }

      // Handle the data.
      Metric metric = entry.getMetrics().get(0);
      if (!isSampled && 0 != metric.getConfidenceInterval()) {
        isSampled = true;
      }
      row.add(new Double(metric.getValue()));
      expectedDate = getNextDate(foundDate);
    }

    // Add the last row.
    if (row != null) {
View Full Code Here

      if (!foundDate.equals(expectedDate)) {
        backFillRow(expectedDate, foundDate, row);
      }

      // Handle the data.
      Metric metric = entry.getMetrics().get(0);
      row.add(new Integer(metric.getValue()));
      expectedDate = getNextDate(foundDate);
    }

    // Add the last row.
    if (row != null) {
View Full Code Here

TOP

Related Classes of com.google.gdata.data.analytics.Metric

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.