Codota Logo
Point
Code IndexAdd Codota to your IDE (free)

How to use
Point
in
com.yahoo.metrics.simple

Best Java code snippets using com.yahoo.metrics.simple.Point (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: com.yahoo.vespa/simplemetrics

@Override
public Context createContext(Map<String, ?> properties) {
  if (properties == null)
    properties = new HashMap<>();
  return new Point(properties);
}
origin: com.yahoo.vespa/simplemetrics

public Point(Map<String, ?> properties) {
  this(buildParameters(properties));
}
origin: com.yahoo.vespa/simplemetrics

/**
 * Create a new Point instance using the settings stored in this
 * PointBuilder. PointBuilder instances cannot be re-used after build() has
 * been invoked.
 *
 * @return a Point instance reflecting this builder
 */
public Point build() {
  Point p = Point.emptyPoint();
  int size = dimensions.size();
  if (size != 0) {
    p = new Point(dimensions.toArray(new String[size]), location.toArray(new Value[size]));
  }
  // deny builder re-use
  dimensions = null;
  location = null;
  return p;
}
origin: com.yahoo.vespa/simplemetrics

PointBuilder(Point p) {
  dimensions = new ArrayList<>();
  location = new ArrayList<>();
  if (p != null) {
    int size = p.dimensionality();
    dimensions = new ArrayList<>(size+2);
    location = new ArrayList<>(size+2);
    for (String dimensionName : p.getDimensions()) {
      dimensions.add(dimensionName);
    }
    for (Value dimensionValue : p.getLocation()) {
      location.add(dimensionValue);
    }
  } else {
    dimensions = new ArrayList<>(4);
    location = new ArrayList<>(4);
  }
}
origin: com.yahoo.vespa/simplemetrics

static MetricDimensions convert(Point p) {
  if (p == null) {
    return StateMetricContext.newInstance(null);
  }
  List<String> dimensions = p.dimensions();
  List<Value> location = p.location();
  Map<String, Object> pointWrapper = new HashMap<>(dimensions.size());
  for (int i = 0; i < dimensions.size(); ++i) {
    pointWrapper.put(dimensions.get(i), valueAsString(location.get(i)));
  }
  return StateMetricContext.newInstance(pointWrapper);
}
origin: com.yahoo.vespa/simplemetrics

public Identifier(String name, Point location) {
  this.name = (name == null ? "" : name);
  this.location = (location == null ? Point.emptyPoint() : location);
}
origin: com.yahoo.vespa/simplemetrics

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + location.hashCode();
  result = prime * result + name.hashCode();
  return result;
}
origin: com.yahoo.vespa/simplemetrics

@Override
public boolean equals(Object obj) {
  if (this == obj) return true;
  if (obj == null) return false;
  if (getClass() != obj.getClass()) return false;
  Identifier other = (Identifier) obj;
  if (!location.equals(other.location)) {
    return false;
  }
  if (!name.equals(other.name)) {
    return false;
  }
  return true;
}
origin: com.yahoo.vespa/simplemetrics

private String getIdentifierString(Identifier id) {
  StringBuilder buffer = new StringBuilder();
  Point location = id.getLocation();
  buffer.append(id.getName());
  if (location != null) {
    buffer.append(", dimensions: { ");
    Iterator<String> dimensions = location.dimensions().iterator();
    Iterator<Value> values = location.location().iterator();
    boolean firstDimension = true;
    while (dimensions.hasNext() && values.hasNext()) {
      if (firstDimension) {
        firstDimension = false;
      } else {
        buffer.append(", ");
      }
      serializeSingleDimension(buffer, dimensions.next(), values.next());
    }
    buffer.append(" }");
  }
  return buffer.toString();
}
origin: com.yahoo.vespa/simplemetrics

private Map<String, MetricValue> getMap(Point point) {
  if (point == null) {
    point = Point.emptyPoint();
  }
  if (! perPointData.containsKey(point)) {
    perPointData.put(point, new HashMap<>());
  }
  return perPointData.get(point);
}
origin: com.yahoo.vespa/docker-api

public GaugeWrapper declareGauge(String application, Dimensions dimensions, String name, DimensionType type) {
  synchronized (monitor) {
    Map<Dimensions, Map<String, MetricValue>> metricsByDimensions = getOrCreateApplicationMetrics(application, type);
    if (!metricsByDimensions.containsKey(dimensions))
      metricsByDimensions.put(dimensions, new HashMap<>());
    if (!metricsByDimensions.get(dimensions).containsKey(name)) {
      GaugeWrapper gauge = new GaugeWrapper(metricReceiver.declareGauge(name, new Point(dimensions.dimensionsMap)));
      metricsByDimensions.get(dimensions).put(name, gauge);
    }
    return (GaugeWrapper) metricsByDimensions.get(dimensions).get(name);
  }
}
origin: com.yahoo.vespa/docker-api

public CounterWrapper declareCounter(String application, Dimensions dimensions, String name, DimensionType type) {
  synchronized (monitor) {
    Map<Dimensions, Map<String, MetricValue>> metricsByDimensions = getOrCreateApplicationMetrics(application, type);
    if (!metricsByDimensions.containsKey(dimensions)) metricsByDimensions.put(dimensions, new HashMap<>());
    if (!metricsByDimensions.get(dimensions).containsKey(name)) {
      CounterWrapper counter = new CounterWrapper(metricReceiver.declareCounter(name, new Point(dimensions.dimensionsMap)));
      metricsByDimensions.get(dimensions).put(name, counter);
    }
    return (CounterWrapper) metricsByDimensions.get(dimensions).get(name);
  }
}
origin: com.yahoo.vespa/vespaclient-container-plugin

public void reportHttpRequest(String clientVersion) {
  if (clientVersion != null) {
    try {
      Point point = versionPointCache.get(clientVersion, () -> new Point(Map.of("client-version", clientVersion)));
      feedRequests.add(point);
    } catch (ExecutionException e) { // When Point constructor throws an exception
      throw new RuntimeException(e);
    }
  } else {
    feedRequests.add();
  }
}
origin: com.yahoo.vespa/vespaclient-container-plugin

public DocumentApiMetrics(MetricReceiver metricReceiver, String apiName) {
  Map<String, String> dimensions = new HashMap<>();
  dimensions.put("api", apiName);
  for (DocumentOperationStatus status : DocumentOperationStatus.values()) {
    points.put(status, new HashMap<>());
    dimensions.put("status", status.name());
    for (DocumentOperationType operation : DocumentOperationType.values()) {
      dimensions.put("operation", operation.name());
      points.get(status).put(operation, new Point(dimensions));
    }
  }
  feeds = metricReceiver.declareCounter("feed.operations");
  feedLatency = metricReceiver.declareGauge("feed.latency");
  feedRequests = metricReceiver.declareCounter("feed.http-requests");
}
com.yahoo.metrics.simplePoint

Javadoc

An efficiently comparable point in a sparse vector space.

Most used methods

  • <init>
    Only to be used by simplemetrics itself.
  • buildParameters
  • dimensionality
    Get the number of dimensions defined for this Point, i.e. the size of the collection returned by #di
  • dimensions
    Get an immutable list view of the names of each dimension.
  • emptyPoint
    the canonical 0-dimensional Point.
  • equals
  • getDimensions
    package private accessor only for simplemetrics itself
  • getLocation
    package private accessor only for simplemetrics itself
  • hashCode
  • location
    Get an immutable list view of the values for each dimension.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now