io.micrometer.core.lang.Nullable.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中io.micrometer.core.lang.Nullable.<init>()方法的一些代码示例,展示了Nullable.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Nullable.<init>()方法的具体详情如下:
包路径:io.micrometer.core.lang.Nullable
类名称:Nullable
方法名:<init>

Nullable.<init>介绍

暂无

代码示例

代码示例来源:origin: io.micrometer/micrometer-spring-legacy

/**
 * Provides the tags to be associated with metrics that are recorded for the given
 * {@code request} and {@code response} exchange.
 *
 * @param urlTemplate the source URl template, if available
 * @param request     the request
 * @param response    the response (may be {@code null} if the exchange failed)
 * @return the tags
 */
Iterable<Tag> getTags(@Nullable String urlTemplate, HttpRequest request,
           @Nullable ClientHttpResponse response);

代码示例来源:origin: io.micrometer/micrometer-registry-ganglia

/**
 * Get the value associated with a key.
 *
 * @param key Key to lookup in the config.
 * @return Value for the key or null if no key is present.
 */
@Nullable
String get(String key);

代码示例来源:origin: io.annot8/annot8-components-monitor

/**
 * Register a gauge that reports the value of the {@link Number}.
 *
 * @param name Name of the gauge being registered.
 * @param number Thread-safe implementation of {@link Number} used to access the value.
 * @param <T> The type of the state object from which the gauge value is extracted.
 * @return The number that was passed in so the registration can be done as part of an assignment
 *     statement.
 */
@Nullable
<T extends Number> T gauge(String name, T number);

代码示例来源:origin: io.micrometer/micrometer-spring-legacy

/**
 * Provides tags to be used by {@link LongTaskTimer long task timers}.
 *
 * @param request the HTTP request
 * @param handler the handler for the request
 * @return tags to associate with metrics recorded for the request
 */
@NonNull
Iterable<Tag> httpLongRequestTags(@Nullable HttpServletRequest request, @Nullable Object handler);

代码示例来源:origin: io.micrometer/micrometer-registry-statsd

protected String tags(@Nullable Statistic stat, @Nullable String otherTags, String keyValueSeparator, String preamble) {
    String tags = of(stat == null ? null : "statistic" + keyValueSeparator + stat.getTagValueRepresentation(), otherTags)
        .filter(Objects::nonNull)
        .collect(Collectors.joining(","));

    if (!tags.isEmpty())
      tags = preamble + tags;
    return tags;
  }
}

代码示例来源:origin: io.micrometer/micrometer-spring-legacy

@Nullable
private ValueWrapper countGet(Object key) {
  ValueWrapper valueWrapper = delegate.get(key);
  if (valueWrapper != null)
    hitCount.incrementAndGet();
  else
    missCount.incrementAndGet();
  return valueWrapper;
}

代码示例来源:origin: io.micrometer/micrometer-spring-legacy

/**
 * Creates a {@code method} tag based on the {@link HttpServletRequest#getMethod()
 * method} of the given {@code request}.
 *
 * @param request the request
 * @return the method tag whose value is a capitalized method (e.g. GET).
 */
public static Tag method(@Nullable HttpServletRequest request) {
  return request == null ? METHOD_UNKNOWN : Tag.of("method", request.getMethod());
}

代码示例来源:origin: io.micrometer/micrometer-spring-legacy

/**
 * Creates a {@code method} tag based on the status of the given {@code response}.
 *
 * @param response the HTTP response
 * @return the status tag derived from the status of the response
 */
public static Tag status(@Nullable HttpServletResponse response) {
  return response == null ? STATUS_UNKNOWN : Tag.of("status", Integer.toString(response.getStatus()));
}

代码示例来源:origin: io.micrometer/micrometer-registry-atlas

@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
@Override
public boolean equals(@Nullable Object o) {
  return MeterEquivalence.equals(this, o);
}

代码示例来源:origin: io.micrometer/micrometer-spring-legacy

private static String getStatusMessage(@Nullable ClientHttpResponse response) {
  try {
    if (response == null) {
      return "CLIENT_ERROR";
    }
    return String.valueOf(response.getRawStatusCode());
  } catch (IOException ex) {
    return "IO_ERROR";
  }
}

代码示例来源:origin: io.micrometer/micrometer-registry-wavefront

/**
 * Required when publishing directly to the Wavefront API host, otherwise does nothing.
 *
 * @return The Wavefront API token.
 */
@Nullable
default String apiToken() {
  String v = get(prefix() + ".apiToken");
  return v == null ? null : v.trim().length() > 0 ? v : null;
}

代码示例来源:origin: io.micrometer/micrometer-registry-datadog

/**
 * @return The Datadog application key. This is only required if you care for metadata like base units, description,
 * and meter type to be published to Datadog.
 */
@Nullable
default String applicationKey() {
  return get(prefix() + ".applicationKey");
}

代码示例来源:origin: io.micrometer/micrometer-registry-datadog

/**
 * @return The tag that will be mapped to "host" when shipping metrics to datadog, or {@code null} if
 * host should be omitted on publishing.
 */
@Nullable
default String hostTag() {
  String v = get(prefix() + ".hostTag");
  return v == null ? "instance" : v;
}

代码示例来源:origin: io.micrometer/micrometer-registry-statsd

@Override
String line(String amount, @Nullable Statistic stat, String type) {
  updateIfNamingConventionChanged();
  return name + tagsByStatistic(stat) + ":" + amount + "|" + type;
}

代码示例来源:origin: io.micrometer/micrometer-registry-statsd

@Override
String line(String amount, @Nullable Statistic stat, String type) {
  updateIfNamingConventionChanged();
  return name + amount + "|" + type + tagsByStatistic(stat);
}

代码示例来源:origin: io.micrometer/micrometer-registry-kairos

/**
 * @return Authenticate requests with this user. By default is {@code null}, and the registry will not
 * attempt to present credentials to KairosDB.
 */
@Nullable
default String userName() {
  return get(prefix() + ".userName");
}

代码示例来源:origin: io.micrometer/micrometer-spring-legacy

public DataSourcePoolMetrics(DataSource dataSource, @Nullable Collection<DataSourcePoolMetadataProvider> metadataProviders, String name, Iterable<Tag> tags) {
  this.name = name;
  this.tags = tags;
  this.dataSource = dataSource;
  DataSourcePoolMetadataProvider provider = new DataSourcePoolMetadataProviders(metadataProviders);
  this.poolMetadata = provider.getDataSourcePoolMetadata(dataSource);
}

代码示例来源:origin: io.micrometer/micrometer-registry-statsd

private String etsyName(@Nullable Statistic stat) {
    return nameMapper.toHierarchicalName(stat != null ? id.withTag(stat) : id, config.namingConvention())
        .replace(':', '_');
  }
}

代码示例来源:origin: io.micrometer/micrometer-registry-wavefront

void addMetric(Stream.Builder<String> metrics, Meter.Id id, @Nullable String suffix, long wallTime, double value) {
  if (Double.isFinite(value)) {
    metrics.add(writeMetric(id, suffix, wallTime, value));
  }
}

代码示例来源:origin: io.micrometer/micrometer-registry-atlas

@Override
protected <T> io.micrometer.core.instrument.Gauge newGauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction) {
  com.netflix.spectator.api.Gauge gauge = new SpectatorToDoubleGauge<>(registry.clock(), spectatorId(id), obj, valueFunction);
  registry.register(gauge);
  return new SpectatorGauge(id, gauge);
}

相关文章