Tabnine Logo
Sample.update
Code IndexAdd Tabnine to your IDE (free)

How to use
update
method
in
org.rrd4j.core.Sample

Best Java code snippets using org.rrd4j.core.Sample.update (Showing top 9 results out of 315)

origin: org.rrd4j/rrd4j

/**
 * Creates sample with the timestamp and data source values supplied
 * in the argument string and stores sample in the corresponding RRD.
 * This method is just a shortcut for:
 * <pre>
 *     set(timeAndValues);
 *     update();
 * </pre>
 *
 * @param timeAndValues String made by concatenating sample timestamp with corresponding
 *                      data source values delmited with colons. For example:<br>
 *                      <code>1005234132:12.2:35.6:U:24.5</code><br>
 *                      <code>NOW:12.2:35.6:U:24.5</code>
 * @throws java.io.IOException Thrown in case of I/O error.
 */
public void setAndUpdate(String timeAndValues) throws IOException {
  set(timeAndValues);
  update();
}
origin: org.fusesource.rrd4j/rrd4j

/**
 * <p>Creates sample with the timestamp and data source values supplied
 * in the argument string and stores sample in the corresponding RRD.
 * This method is just a shortcut for:</p>
 * <pre>
 *     set(timeAndValues);
 *     update();
 * </pre>
 *
 * @param timeAndValues String made by concatenating sample timestamp with corresponding
 *                      data source values delmited with colons. For example:<br>
 *                      <code>1005234132:12.2:35.6:U:24.5</code><br>
 *                      <code>NOW:12.2:35.6:U:24.5</code>
 * @throws IOException Thrown in case of I/O error.
 */
public void setAndUpdate(String timeAndValues) throws IOException {
  set(timeAndValues);
  update();
}
origin: org.apache.marmotta/marmotta-loader-core

  @Override
  public void run() {
    try {
      long time = System.currentTimeMillis() / 1000;
      synchronized (statSample) {
        statSample.setTime(time);
        statSample.setValues(handler.triples);
        statSample.update();
      }
    } catch (Exception e) {
      log.warn("could not update statistics database: {}", e.getMessage());
    }
  }
}
origin: apache/marmotta

  @Override
  public void run() {
    try {
      long time = System.currentTimeMillis() / 1000;
      synchronized (statSample) {
        statSample.setTime(time);
        statSample.setValues(handler.triples);
        statSample.update();
      }
    } catch (Exception e) {
      log.warn("could not update statistics database: {}", e.getMessage());
    }
  }
}
origin: codice/ddf

private void updateSample(long now, double val) throws IOException {
 LOGGER.debug(
   "Sample time is [{}], updating metric [{}] with value [{}]",
   MetricsUtil.getCalendarTime(now),
   mbeanName,
   val);
 sample.setTime(now);
 sample.setValue(rrdDataSourceName, val);
 sample.update();
}
origin: fbacchella/jrds

public void commit(JrdsSample sample) {
  RrdDb rrdDb = null;
  try {
    rrdDb = factory.getRrd(getPath());
    Sample onesample = rrdDb.createSample(sample.getTime().getTime() / 1000);
    for(Map.Entry<String, Number> e: sample.entrySet()) {
      onesample.setValue(e.getKey(), e.getValue().doubleValue());
    }
    if(p.getNamedLogger().isDebugEnabled())
      log(Level.DEBUG, "%s", onesample.dump());
    onesample.update();
  } catch (IOException e) {
    log(Level.ERROR, e, "Error while collecting: %s", e.getMessage());
  } finally {
    if(rrdDb != null)
      factory.releaseRrd(rrdDb);
  }
}
origin: frenchc/jetm

protected void flushStatus() {
 if (transactions > 0) {
  try {
   Sample sample = db.createSample(endInterval);
   if (transactionsEnabled) {
    sample.setValue("transactions!", transactions);
   }
   if (minEnabled) {
    sample.setValue("min", min);
   }
   if (maxEnabled) {
    sample.setValue("max", max);
   }
   if (averageEnabled) {
    double value = total / (double) transactions;
    sample.setValue("average", value);
   }
   sample.update();
  } catch (IOException e) {
   throw new EtmException(e);
  }
 }
}
origin: org.fusesource.rrd4j/rrd4j

Sample sample = rrdDb.createSample(t);
sample.setValue("a", Math.sin(t / 3000.0) * 50 + 50);
sample.update();
origin: org.fusesource.rrd4j/rrd4j

sample.setValue("shade", shadeSource.getValue());
log.println(sample.dump());
sample.update();
t += RANDOM.nextDouble() * MAX_STEP + 1;
if (((++n) % 1000) == 0) {
org.rrd4j.coreSampleupdate

Javadoc

Stores sample in the corresponding RRD. If the update operation succeeds, all datasource values in the sample will be set to Double.NaN (unknown) values.

Popular methods of Sample

  • setValue
    Sets single data source value in the sample.
  • dump
    Dumps sample content using the syntax of RRDTool's update command.
  • setTime
    Sets sample timestamp. Timestamp should be defined in seconds (without milliseconds).
  • <init>
  • clearValues
  • getTime
    Returns sample timestamp (in seconds, without milliseconds).
  • getValues
    Returns all current data source values in the sample.
  • set
    Sets sample timestamp and data source values in a fashion similar to RRDTool. Argument string should
  • setAndUpdate
    Creates sample with the timestamp and data source values supplied in the argument string and stores
  • setValues
    Sets some (possibly all) data source values in bulk. Data source values are assigned in the order of

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • String (java.lang)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JPanel (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now