All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.intergral.deep.agent.api.plugin.MetricDefinition Maven / Gradle / Ivy

/*
 *     Copyright (C) 2023  Intergral GmbH
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Affero General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Affero General Public License for more details.
 *
 *     You should have received a copy of the GNU Affero General Public License
 *     along with this program.  If not, see .
 */

package com.intergral.deep.agent.api.plugin;

import java.util.List;
import java.util.Objects;

/**
 * This type defines a metric that is attached to a tracepoint.
 */
public class MetricDefinition {

  private final String name;
  private final List

* Labels can have either a static value or an expression. If the value is an expression then this is evaluated as a watcher and the * result is used as the label value. */ public static class Label { final String key; final Object value; final String expression; /** * Create a new label for a metric. * * @param key the label key * @param value the label value if a fixed value * @param expression the label expression if we should evaluate the label value */ public Label(final String key, final Object value, final String expression) { this.key = key; this.value = value; this.expression = expression; } public String getKey() { return key; } public Object getValue() { return value; } public String getExpression() { return expression; } @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final Label label = (Label) o; return Objects.equals(key, label.key) && Objects.equals(value, label.value) && Objects.equals(expression, label.expression); } @Override public int hashCode() { return Objects.hash(key, value, expression); } @Override public String toString() { return "Label{" + "key='" + key + '\'' + ", value=" + value + ", expression='" + expression + '\'' + '}'; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy