本文整理汇总了Java中com.codahale.metrics.MetricFilter.ALL属性的典型用法代码示例。如果您正苦于以下问题:Java MetricFilter.ALL属性的具体用法?Java MetricFilter.ALL怎么用?Java MetricFilter.ALL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.codahale.metrics.MetricFilter
的用法示例。
在下文中一共展示了MetricFilter.ALL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
final ServletContext context = config.getServletContext();
if (null == registry) {
final Object registryAttr = context.getAttribute(METRICS_REGISTRY);
if (registryAttr instanceof MetricRegistry) {
this.registry = (MetricRegistry) registryAttr;
} else {
throw new ServletException("Couldn't find a MetricRegistry instance.");
}
}
filter = (MetricFilter) context.getAttribute(METRIC_FILTER);
if (filter == null) {
filter = MetricFilter.ALL;
}
this.allowedOrigin = context.getInitParameter(ALLOWED_ORIGIN);
}
示例2: Builder
private Builder(MetricRegistry registry) {
this.registry = registry;
this.clock = Clock.defaultClock();
this.prefix = null;
this.rateUnit = TimeUnit.SECONDS;
this.durationUnit = TimeUnit.MILLISECONDS;
this.filter = MetricFilter.ALL;
}
示例3: Builder
/** */
private Builder(MetricRegistry registry) {
this.registry = registry;
this.rateUnit = TimeUnit.SECONDS;
this.durationUnit = TimeUnit.MILLISECONDS;
this.filter = MetricFilter.ALL;
}
示例4: Builder
private Builder(MetricRegistry registry) {
this.registry = registry;
this.locale = Locale.getDefault();
this.rateUnit = TimeUnit.SECONDS;
this.durationUnit = TimeUnit.MILLISECONDS;
this.clock = Clock.defaultClock();
this.filter = MetricFilter.ALL;
}
示例5: Builder
private Builder(MetricRegistry registry) {
this.registry = registry;
this.prefix = null;
this.filter = MetricFilter.ALL;
this.executor = null;
this.shutdownExecutorOnStop = true;
}
示例6: getMetricByName
/**
* Gets stats information of a metric. Returns array of all information for the
* specified metric.
*
* @param metricName metric name
* @return 200 OK with metric information as array
* @onos.rsModel Metric
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("{metricName}")
public Response getMetricByName(@PathParam("metricName") String metricName) {
ObjectNode metricNode = root.putObject("metric");
MetricFilter filter = metricName != null ? (name, metric) -> name.equals(metricName) : MetricFilter.ALL;
TreeMultimap<String, Metric> matched = listMetrics(service, filter);
matched.asMap().get(metricName).forEach(m -> {
metricNode.set(metricName, codec(Metric.class).encode(m, this));
});
return ok(root).build();
}
示例7: execute
@Override
protected void execute() {
MetricsService metricsService = get(MetricsService.class);
MetricFilter filter = metricName != null ? (name, metric) -> name.equals(metricName) : MetricFilter.ALL;
TreeMultimap<String, Metric> matched = listMetrics(metricsService, filter);
matched.asMap().forEach((name, metrics) -> {
if (outputJson()) {
metrics.forEach(metric -> print("%s", json(metric)));
} else {
metrics.forEach(metric -> printMetric(name, metric));
}
});
}
示例8: Builder
private Builder(final MetricRegistry metricRegistry, final AmazonCloudWatchAsync cloudWatchAsyncClient, final String namespace) {
this.metricRegistry = metricRegistry;
this.cloudWatchAsyncClient = cloudWatchAsyncClient;
this.namespace = namespace;
this.percentiles = new Percentile[]{Percentile.P75, Percentile.P95, Percentile.P999};
this.metricFilter = MetricFilter.ALL;
this.rateUnit = TimeUnit.SECONDS;
this.durationUnit = TimeUnit.MILLISECONDS;
this.globalDimensions = new LinkedHashSet<>();
this.cwRateUnit = toStandardUnit(rateUnit);
this.cwDurationUnit = toStandardUnit(durationUnit);
this.clock = Clock.defaultClock();
}
开发者ID:azagniotov,项目名称:codahale-aggregated-metrics-cloudwatch-reporter,代码行数:13,代码来源:CloudWatchReporter.java
示例9: SystemController
public SystemController(Service spark, GraknConfig config, SystemKeyspace systemKeyspace,
GraknEngineStatus graknEngineStatus, MetricRegistry metricRegistry) {
this.systemKeyspace = systemKeyspace;
this.config = config;
this.graknEngineStatus = graknEngineStatus;
this.metricRegistry = metricRegistry;
DropwizardExports prometheusMetricWrapper = new DropwizardExports(metricRegistry);
this.prometheusRegistry = new CollectorRegistry();
prometheusRegistry.register(prometheusMetricWrapper);
spark.get(REST.WebPath.ROOT, this::getRoot);
spark.get(REST.WebPath.KB, (req, res) -> getKeyspaces(res));
spark.get(REST.WebPath.KB_KEYSPACE, this::getKeyspace);
spark.put(REST.WebPath.KB_KEYSPACE, this::putKeyspace);
spark.delete(REST.WebPath.KB_KEYSPACE, this::deleteKeyspace);
spark.get(REST.WebPath.METRICS, this::getMetrics);
spark.get(REST.WebPath.STATUS, (req, res) -> getStatus());
spark.get(REST.WebPath.VERSION, (req, res) -> getVersion());
final TimeUnit rateUnit = TimeUnit.SECONDS;
final TimeUnit durationUnit = TimeUnit.SECONDS;
final boolean showSamples = false;
MetricFilter filter = MetricFilter.ALL;
this.mapper = new ObjectMapper().registerModule(
new MetricsModule(rateUnit,
durationUnit,
showSamples,
filter));
}
示例10: Builder
private Builder(MetricRegistry registry) {
this.registry = registry;
this.prefix = null;
this.rateUnit = TimeUnit.SECONDS;
this.durationUnit = TimeUnit.MILLISECONDS;
this.filter = MetricFilter.ALL;
}
示例11: Builder
public Builder(MetricRegistry registry) {
this.registry = registry;
this.expansions = Expansion.ALL;
this.clock = Clock.defaultClock();
this.rateUnit = TimeUnit.SECONDS;
this.durationUnit = TimeUnit.MILLISECONDS;
this.filter = MetricFilter.ALL;
this.metricNameFormatter = new DefaultMetricNameFormatter();
this.tags = new ArrayList<String>();
this.suppress_bad_analytics = true;
}
示例12: Builder
/**
* Set up the builder.
* @param registry which registry to report from.
* @param client a client to use to push the metrics to CloudWatch.
*/
public Builder(MetricRegistry registry, AmazonCloudWatchClient client) {
this.registry = registry;
this.client = client;
this.rateUnit = TimeUnit.SECONDS;
this.durationUnit = TimeUnit.MILLISECONDS;
this.filter = MetricFilter.ALL;
this.dimensions = new HashMap<>();
}
示例13: Builder
public Builder(MetricRegistry registry) {
this.registry = registry;
this.rateUnit = TimeUnit.SECONDS;
this.durationUnit = TimeUnit.MILLISECONDS;
this.filter = MetricFilter.ALL;
}
示例14: Builder
private Builder(MetricRegistry registry) {
this.registry = registry;
this.tags = null;
this.rateUnit = TimeUnit.SECONDS;
this.durationUnit = TimeUnit.MILLISECONDS;
this.filter = MetricFilter.ALL;
}
示例15: execute
@Override
protected void execute() {
MetricsService metricsService = get(MetricsService.class);
MetricFilter filter = MetricFilter.ALL;
TreeMultimap<String, Metric> matched = listMetrics(metricsService, filter);
matched.asMap().forEach((name, metrics) -> {
for (Metric metric : metrics) {
printMetric(name, metric);
}
});
}