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

How to use
getName
method
in
org.opennms.newts.api.Sample

Best Java code snippets using org.opennms.newts.api.Sample.getName (Showing top 11 results out of 315)

origin: stackoverflow.com

 @Override
public void onBindViewHolder(CustomAdapter.ViewHolder holder, int position) {
  Sample sample = mySamples.get(position);

  holder.name.setText(sample.getName());
  LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context
      .LAYOUT_INFLATER_SERVICE);

  for (int i = 0; i < 20; i++) {
    View v = inflater.inflate(R.layout.item_list, holder.linearLayout, false);
    TextView textView = (TextView) v.findViewById(R.id.textView);
    textView.setText("hello" + i);
    holder.linearLayout.addView(v);
  }
}
origin: OpenNMS/newts

private void addSample(Results.Row<Sample> row, Sample sample) {
  if (m_metrics.isEmpty() || m_metrics.contains(sample.getName())) {
    row.addElement(sample);
  }
}
origin: stackoverflow.com

 Sample sample = new Sample();

  /*call the setter from Sample class and pass value
  to its parameter*/
  sample.setName("Andrew");

  /*
  access the name "Andrew" by calling getter
  */
  System.out.println("Welcome " + sample.getName());
}
origin: OpenNMS/newts

@Override
public String toString() {
  return String.format(
      "%s[timestamp=%s, context=%s, resource=%s, name=%s, type=%s, value=%s]",
      getClass().getSimpleName(),
      getTimestamp(),
      getContext(),
      getResource(),
      getName(),
      getType(),
      getValue());
}
origin: OpenNMS/newts

@Override
public Row<Sample> next() {
  if (!hasNext()) throw new NoSuchElementException();
  Row<Sample> working = m_input.next();
  Row<Sample> result = new Row<>(working.getTimestamp(), working.getResource());
  for (String metricName : m_metrics) {
    Sample sample = working.getElement(metricName);
    if (sample == null) {
      continue;
    }
    // Use rate as result if one of counter types, else pass through as-is.
    result.addElement(COUNTERS.contains(sample.getType()) ? getRate(sample) : sample);
    m_prevSamples.put(sample.getName(), sample);
  }
  return result;
}
origin: OpenNMS/newts

maybeIndexResource(cacheQueue, generators, sample.getContext(), sample.getResource());
maybeIndexResourceAttributes(cacheQueue, generators, sample.getContext(), sample.getResource());
maybeAddMetricName(cacheQueue, generators, sample.getContext(), sample.getResource(), sample.getName());
origin: org.opennms.newts/newts-cassandra-search

maybeIndexResource(cacheQueue, generators, sample.getContext(), sample.getResource());
maybeIndexResourceAttributes(cacheQueue, generators, sample.getContext(), sample.getResource());
maybeAddMetricName(cacheQueue, generators, sample.getContext(), sample.getResource(), sample.getName());
origin: OpenNMS/newts

@Override
public Sample call(Sample s) {
  Timestamp oldTs = s.getTimestamp();
  Timestamp newTs = Timestamp.fromEpochMillis(m_timeoffset + Math.round(oldTs.asMillis()/m_timescaleFactor));
  return new Sample(newTs, s.getResource(), s.getName(), s.getType(), s.getValue());
}

origin: OpenNMS/newts

private Sample getRate(Sample sample) {
  ValueType<?> value = NAN;
  Sample previous = m_prevSamples.get(sample.getName());
  if (previous != null) {
    long elapsed = sample.getTimestamp().asSeconds() - previous.getTimestamp().asSeconds();
    try {
      value = new Gauge(sample.getValue().delta(previous.getValue()).doubleValue() / elapsed);
    } catch (ArithmeticException e) {
      value = NAN;
    }
  }
  return new Sample(sample.getTimestamp(), sample.getResource(), sample.getName(), GAUGE, value, sample.getAttributes());
}
origin: OpenNMS/newts

.value(SchemaConstants.F_RESOURCE, m.getResource().getId())
.value(SchemaConstants.F_COLLECTED, m.getTimestamp().asMillis())
.value(SchemaConstants.F_METRIC_NAME, m.getName())
.value(SchemaConstants.F_VALUE, ValueType.decompose(m.getValue()));
origin: OpenNMS/newts

  @Override
  public String call(List<Sample> samples) {
    JSONBuilder bldr = new JSONBuilder();
    for(Sample sample : samples) {
      if (isNaN(sample)) continue;
      //System.err.println("Importing: " + sample);
      bldr.newObject();
      bldr.attr("timestamp", sample.getTimestamp().asMillis());
      bldr.attr("resource", sample.getResource().getId());
      bldr.attr("name", sample.getName());
      bldr.attr("type", sample.getType().name());
      if (sample.getType() == MetricType.GAUGE) {
        bldr.attr("value", sample.getValue().doubleValue());
      } else {
        bldr.attr("value", sample.getValue().longValue());
      }
    }
    return bldr.toString();
  }
};
org.opennms.newts.apiSamplegetName

Popular methods of Sample

  • <init>
  • getResource
  • getTimestamp
  • getValue
  • getContext
  • getType
  • getAttributes
  • compareSample
  • display
  • getData
  • getFirst
  • getId
  • getFirst,
  • getId,
  • getLabel,
  • getMatrix,
  • getSecond,
  • getStringList,
  • getUserName,
  • intmethod,
  • isALive

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Notification (javax.management)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top Vim plugins
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