/** * Input data from a producer thread. * * @param x * the data to insert */ public void update(SAMPLE x) { update(x, getOrCreateLocal()); }
/** * Update a metric. This API is not intended for clients for the * simplemetrics API, declare a Counter or a Gauge using * {@link #declareCounter(String)}, {@link #declareCounter(String, Point)}, * {@link #declareGauge(String)}, or {@link #declareGauge(String, Point)} * instead. * * @param s * a single simple containing all meta data necessary to update a * metric */ public void update(Sample s) { // pass around the receiver instead of histogram settings to avoid reading any volatile if unnecessary s.setReceiver(this); metricsCollection.update(s); }
@Override public Result search(Query query, Execution execution) { Result r; long when = query.getStartTime() / 1000L; Hit meta = null; directory.update(when); if (useMetaHit) { if (query.properties().getBoolean(propertyName, false)) { List<QueryRatePerSecond> l = merge(directory.fetch()); Tuple2<Integer, Double> maxAndMean = maxAndMean(l); meta = new QpsHit(maxAndMean.first, maxAndMean.second); } } r = execution.search(query); if (meta != null) { r.hits().add(meta); } return r; }