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

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

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

origin: dCache/dcache

/**
 * Performs update of the rrd with the current value of the gauge
 * @throws IOException
 */
public void update() throws IOException {
  logger.debug("RRDRequestExecutionTimeGauge.update() rrdFileName is {}", rrdFileName);
  RrdDb rrdDb = new RrdDb(rrdFileName);
  try {
    Sample sample = rrdDb.createSample();
    long currentTimeSecs =   Util.getTime();
    String update = Long.toString(currentTimeSecs) +':'+
            (long) gauge.resetAndGetAverageExecutionTime()+':';
    sample.setAndUpdate(update);
    logger.debug("RRDRequestExecutionTimeGauge.update() updated with : {}", update);
  } finally {
    rrdDb.close();
    logger.debug("RRDRequestExecutionTimeGauge.update() succeeded");
  }
}
origin: dCache/dcache

/**
 *
 * @throws IOException
 */
public void update() throws IOException {
  logger.debug("RRDRequestCounter.update() rrdFileName is {}", rrdFileName);
  RrdDb rrdDb = new RrdDb(rrdFileName);
  Sample sample = rrdDb.createSample();
  long currentTimeSecs =   Util.getTime();
  StringBuilder sb = new StringBuilder();
  sb.append(currentTimeSecs).append(':');
  sb.append(counter.getTotalRequests()).append(':');
  sb.append(counter.getFailed());
  sample.setAndUpdate(sb.toString());
  logger.debug("RRDRequestCounter.update() updated with : {}", sb);
  rrdDb.close();
  logger.debug("RRDRequestCounter.update() succeeded");
  logger.debug("RRDRequestCounter.update() let us try to fetch data");
  rrdDb = new RrdDb(rrdFileName);
  if(dumpstart == null) {
       dumpstart = currentTimeSecs - 100;
  }
  FetchRequest fetchRequest = rrdDb.createFetchRequest(ConsolFun.AVERAGE, dumpstart, currentTimeSecs+1);
  FetchData fetchData = fetchRequest.fetchData();
  logger.debug("RRDRequestCounter.update() dump is: {}", fetchData.dump());
  rrdDb.close();
}
org.rrd4j.coreSamplesetAndUpdate

Javadoc

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:
 
set(timeAndValues); 
update(); 

Popular methods of Sample

  • update
    Stores sample in the corresponding RRD. If the update operation succeeds, all datasource values in t
  • 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
  • setValues
    Sets some (possibly all) data source values in bulk. Data source values are assigned in the order of

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JTextField (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • CodeWhisperer alternatives
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