/** * Provides an access interface for inspecting given metric type. * * @param metricType the metric type to steer to. * @return the access interface to the metric type */ default MetricTypes.Single inspect(MetricType metricType) throws EntityNotFoundException { return inspect(metricType.getPath(), MetricTypes.Single.class); }
@Override public B visitMetric(Metric metric, Void parameter) { //we don't want to have tenant ID and all that jazz influencing the hash, so always use //a relative path RelativePath metricTypePath = metric.getType().getPath().relativeTo(metric.getPath()); return (B) fillCommon(metric, Metric.Blueprint.builder()) .withInterval(metric.getCollectionInterval()) .withMetricTypePath(metricTypePath.toString()).build(); }
@Override public Updater<Update, MetricType> update() { return new Updater<>((u) -> new MetricType(u.getName(), getPath(), getIdentityHash(), getContentHash(), getSyncHash(), valueOrDefault(u.unit, this.unit), metricDataType, u.getProperties(), valueOrDefault(u.getCollectionInterval(), collectionInterval))); }