Add measurements from the given Preview to the overall sum.

@param measurementsSum
@param preview
@param numEntriesPerPreview
436168
private void addPreviewMeasurementsToSum(
            List<double[]> measurementsSum, 
            Preview        preview, 
            int            numEntriesPerPreview) 
    {
        List<double[]> previewMeasurements = preview.getData();
        
        // add values for each measurement in each entry
        for (int entryIdx = 0; entryIdx < numEntriesPerPreview; entryIdx++) {
            double[] previewEntry = previewMeasurements.get(entryIdx);
            double[] sumEntry;
            
            if (measurementsSum.size() > entryIdx) {
                sumEntry = measurementsSum.get(entryIdx);
            }
            else {
                // initialize sum entry
                sumEntry = new double[previewEntry.length];
                measurementsSum.add(sumEntry);
            }
            
            // first measurement is used for indexing
            // -> simply copy from first preview
            if (sumEntry[0] == 0.0) {
                sumEntry[0] = previewEntry[0];
            }
            
            // add measurements of current entry
            for (int measure = 1; measure < sumEntry.length; measure++) {
                sumEntry[measure] += previewEntry[measure];
            }
        }
    }
757416
public void addMeasurement(long durationInMillis) {
    count.addAndGet(1);
    timerSum.addAndGet(durationInMillis);
    timerSumOfSquares.addAndGet(durationInMillis * durationInMillis);
  }
77465
def append(self, measurement):
        
        assert isinstance(measurement, Measurement)
        assert measurement.station_id == self.station_id
        self.measurements.append(measurement)
258357
private void calculateCollectionPartDescriptions() {
		collectionPartIds = new CollectionPartDescription[this.getNrofParts()];

		int displayOffset = 0;
		int count = 0;
		for (count = 0; count < getNrofParts() - 1; count++) {
			displayOffset = count * maxPartSize;
			if (displayOffset != offset) {
				collectionPartIds[count] = new CollectionPartDescription(displayOffset, maxPartSize, false);
			}
			else {
				collectionPartIds[count] = new CollectionPartDescription(displayOffset, maxPartSize, true);
				currentCollectionPartIdIndex = count;
			}
		}
		displayOffset = count * maxPartSize;
		if (displayOffset != offset) {
			collectionPartIds[count] = new CollectionPartDescription(displayOffset, getLastPartSize(), false);
		}
		else {
			collectionPartIds[count] = new CollectionPartDescription(displayOffset, getLastPartSize(), true);
			currentCollectionPartIdIndex = count;
		}
	}
157325
public function addMeasure($label, $start, $end, $params = array(), $collector = null)
    {
        $this->measures[] = array(
            'label' => $label,
            'start' => $start,
            'relative_start' => $start - $this->requestStartTime,
            'end' => $end,
            'relative_end' => $end - $this->requestEndTime,
            'duration' => $end - $start,
            'duration_str' => $this->getDataFormatter()->formatDuration($end - $start),
            'params' => $params,
            'collector' => $collector
        );
    }
1097376
void measure(Registry registry, JmxData data, List<Measurement> ms) {
    Map<String, String> tags = tagMappings.entrySet().stream().collect(Collectors.toMap(
        Map.Entry::getKey,
        e -> MappingExpr.substitute(e.getValue(), data.getStringAttrs())
    ));
    Id id = registry
        .createId(MappingExpr.substitute(nameMapping, data.getStringAttrs()))
        .withTags(tags);

    Map<String, Number> numberAttrs = new HashMap<>(data.getNumberAttrs());
    JmxData previous = previousData.put(data.getName(), data);
    if (previous != null) {
      previous.getNumberAttrs().forEach((key, value) -> numberAttrs.put("previous:" + key, value));
    }

    Double v = MappingExpr.eval(valueMapping, numberAttrs);

    if (v != null && !v.isNaN()) {
      if (counter) {
        updateCounter(registry, id, v.longValue());
      } else {
        ms.add(new Measurement(id, registry.clock().wallTime(), v));
      }
    }
  }
1148337
protected void setMeasures(boolean[] measures)
    {
    	this.generalEvalOption.setValue(measures[0]);
    	this.f1Option.setValue(measures[1]);
    	this.entropyOption.setValue(measures[2]);
    	this.cmmOption.setValue(measures[3]);
    	this.ssqOption.setValue(measures[4]);
    	this.separationOption.setValue(measures[5]);
    	this.silhouetteOption.setValue(measures[6]);
    	this.statisticalOption.setValue(measures[7]);
    }
1284061
private void obtainPreviewBorderWidth(@NonNull final TypedArray typedArray) {
        int defaultValue = getContext().getResources().getDimensionPixelSize(
                R.dimen.color_picker_preference_default_preview_border_width);
        setPreviewBorderWidth(typedArray
                .getDimensionPixelSize(R.styleable.AbstractColorPickerPreference_previewBorderWidth,
                        defaultValue));
    }
813752
private void addMetric(
      List<Metric> metrics,
      String name,
      TagList tags,
      Object value) {
    long now = System.currentTimeMillis();
    if (onlyNumericMetrics) {
      value = asNumber(value);
    }
    if (value != null) {

      TagList newTags = counters.matches(MonitorConfig.builder(name).withTags(tags).build())
          ? getTagListWithAdditionalTag(tags, DataSourceType.COUNTER)
          : getTagListWithAdditionalTag(tags, DataSourceType.GAUGE);
      Metric m = new Metric(name, newTags, now, value);
      metrics.add(m);
    }
  }
1326093
protected void updatePreviewContent(CmsPreviewInfo previewInfo) {

        setCaption(generateCaption(previewInfo));
        initContent(previewInfo);
        initLocales(previewInfo);
        center();
    }
227973
public void setPreviewResults(java.util.Collection<LifecyclePolicyPreviewResult> previewResults) {
        if (previewResults == null) {
            this.previewResults = null;
            return;
        }

        this.previewResults = new java.util.ArrayList<LifecyclePolicyPreviewResult>(previewResults);
    }
155902
public final void setDialogPreviewShape(@NonNull final PreviewShape previewShape) {
        Condition.INSTANCE.ensureNotNull(previewShape, "The preview shape may not be null");
        this.dialogPreviewShape = previewShape;
    }
80478
private void initMeasures() {
    durationMeasure = new DurationMeasure() ;
    evaluations = new CountingMeasure(0) ;
    numberOfNonDominatedSolutionsInPopulation = new BasicMeasure<>() ;
    solutionListMeasure = new BasicMeasure<>() ;
    hypervolumeValue = new BasicMeasure<>() ;

    measureManager = new SimpleMeasureManager() ;
    measureManager.setPullMeasure("currentExecutionTime", durationMeasure);
    measureManager.setPullMeasure("currentEvaluation", evaluations);
    measureManager.setPullMeasure("numberOfNonDominatedSolutionsInPopulation",
        numberOfNonDominatedSolutionsInPopulation);

    measureManager.setPushMeasure("currentPopulation", solutionListMeasure);
    measureManager.setPushMeasure("currentEvaluation", evaluations);
    measureManager.setPushMeasure("hypervolume", hypervolumeValue);
  }
524715
@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		Drawable drawable = getDrawable();
		if (getDrawable() != null) {
			if (ratioType == RATIO_WIDTH) {
				int width = MeasureSpec.getSize(widthMeasureSpec);
				int height = Math.round(width * (((float) drawable.getIntrinsicHeight()) / ((float) drawable.getIntrinsicWidth())));
				setMeasuredDimension(width, height);
			} else if (ratioType == RATIO_HEIGHT) {
				int height = MeasureSpec.getSize(heightMeasureSpec);
				int width = Math.round(height * ((float) drawable.getIntrinsicWidth()) / ((float) drawable.getIntrinsicHeight()));
				setMeasuredDimension(width, height);
			}
		} else {
			super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		}
	}
1210074
function updateMetrics() {
		var dprM;

		isVwDirty = false;
		DPR = window.devicePixelRatio;
		cssCache = {};
		sizeLengthCache = {};

		dprM = (DPR || 1) * cfg.xQuant;

		if(!cfg.uT){
			cfg.maxX = Math.max(1.3, cfg.maxX);
			dprM = Math.min( dprM, cfg.maxX );

			ri.DPR = dprM;
		}

		units.width = Math.max(window.innerWidth || 0, docElem.clientWidth);
		units.height = Math.max(window.innerHeight || 0, docElem.clientHeight);

		units.vw = units.width / 100;
		units.vh = units.height / 100;

		units.em = ri.getEmValue();
		units.rem = units.em;

		lazyFactor = cfg.lazyFactor / 2;

		lazyFactor = (lazyFactor * dprM) + lazyFactor;

		substractCurRes = 0.4 + (0.1 * dprM);

		lowTreshHold = 0.5 + (0.2 * dprM);

		partialLowTreshHold = 0.5 + (0.25 * dprM);

		tMemory = dprM + 1.3;

		if(!(isLandscape = units.width > units.height)){
			lazyFactor *= 0.9;
		}
		if(supportAbort){
			lazyFactor *= 0.9;
		}

		evalID = [units.width, units.height, dprM].join('-');
	}
666137
private void init() {

        Measure currSonarMeasure = null;
        String currValue = null;

        setValues(new HashMap<HLAMeasure, String>());
        setValuesInt(new HashMap<HLAMeasure, Integer>());
        setValuesDouble(new HashMap<HLAMeasure, Double>());
        setMeasures(new ArrayList<HLAMeasure>());
        setVersion(getResource().getVersion());

        for (HLAMeasure currMeasure : HLAMeasure.values()) {

            LOG.debug("Analyzing measure " + currMeasure.getSonarName());
            currSonarMeasure = getResource().getMeasure(currMeasure.getSonarName());

            if (currSonarMeasure != null) {

                LOG.debug("Found measure for " + currMeasure.getSonarName());
                currValue = currSonarMeasure.getFormattedValue();
                LOG.debug("Value is: " + currValue);

                getValues().put(currMeasure, currValue != null ? currValue : VALUE_NOT_AVAILABLE);
                getValuesInt().put(currMeasure, currSonarMeasure.getIntValue());
                getValuesDouble().put(currMeasure, currSonarMeasure.getValue());
                getMeasures().add(currMeasure);
            }
        }
    }
312423
public void add(final ExpressionDataPoint dps) {
    metric_uids.addAll(dps.metric_uids);
    
    // TODO - tags intersection
    
    aggregated_tags.addAll(dps.aggregated_tags);
    
    tsuids.addAll(dps.tsuids);
    // TODO - this ain't right. We need to number of dps emitted from HERE. For
    // now we'll just take the first dps size. If it's downsampled then this
    // will be accurate.
    //size += dps.size();
    raw_size += dps.raw_size;
  }