|
| 1 | +/* |
| 2 | + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. |
| 3 | + * This product includes software developed at Datadog (https://www.datadoghq.com/). |
| 4 | + * Copyright 2019-Present Datadog, Inc. |
| 5 | + */ |
| 6 | + |
| 7 | +package com.datadog.api.client.v1.model; |
| 8 | + |
| 9 | +import com.datadog.api.client.ModelEnum; |
| 10 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 11 | +import com.fasterxml.jackson.core.JsonGenerator; |
| 12 | +import com.fasterxml.jackson.core.JsonProcessingException; |
| 13 | +import com.fasterxml.jackson.databind.SerializerProvider; |
| 14 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| 15 | +import com.fasterxml.jackson.databind.ser.std.StdSerializer; |
| 16 | +import java.io.IOException; |
| 17 | +import java.util.Arrays; |
| 18 | +import java.util.HashSet; |
| 19 | +import java.util.Set; |
| 20 | + |
| 21 | +/** APM metric stat name. */ |
| 22 | +@JsonSerialize( |
| 23 | + using = FormulaAndFunctionApmMetricStatName.FormulaAndFunctionApmMetricStatNameSerializer.class) |
| 24 | +public class FormulaAndFunctionApmMetricStatName extends ModelEnum<String> { |
| 25 | + |
| 26 | + private static final Set<String> allowedValues = |
| 27 | + new HashSet<String>( |
| 28 | + Arrays.asList( |
| 29 | + "errors", |
| 30 | + "error_rate", |
| 31 | + "errors_per_second", |
| 32 | + "latency_avg", |
| 33 | + "latency_max", |
| 34 | + "latency_p50", |
| 35 | + "latency_p75", |
| 36 | + "latency_p90", |
| 37 | + "latency_p95", |
| 38 | + "latency_p99", |
| 39 | + "latency_p999", |
| 40 | + "latency_distribution", |
| 41 | + "hits", |
| 42 | + "hits_per_second", |
| 43 | + "total_time", |
| 44 | + "apdex")); |
| 45 | + |
| 46 | + public static final FormulaAndFunctionApmMetricStatName ERRORS = |
| 47 | + new FormulaAndFunctionApmMetricStatName("errors"); |
| 48 | + public static final FormulaAndFunctionApmMetricStatName ERROR_RATE = |
| 49 | + new FormulaAndFunctionApmMetricStatName("error_rate"); |
| 50 | + public static final FormulaAndFunctionApmMetricStatName ERRORS_PER_SECOND = |
| 51 | + new FormulaAndFunctionApmMetricStatName("errors_per_second"); |
| 52 | + public static final FormulaAndFunctionApmMetricStatName LATENCY_AVG = |
| 53 | + new FormulaAndFunctionApmMetricStatName("latency_avg"); |
| 54 | + public static final FormulaAndFunctionApmMetricStatName LATENCY_MAX = |
| 55 | + new FormulaAndFunctionApmMetricStatName("latency_max"); |
| 56 | + public static final FormulaAndFunctionApmMetricStatName LATENCY_P50 = |
| 57 | + new FormulaAndFunctionApmMetricStatName("latency_p50"); |
| 58 | + public static final FormulaAndFunctionApmMetricStatName LATENCY_P75 = |
| 59 | + new FormulaAndFunctionApmMetricStatName("latency_p75"); |
| 60 | + public static final FormulaAndFunctionApmMetricStatName LATENCY_P90 = |
| 61 | + new FormulaAndFunctionApmMetricStatName("latency_p90"); |
| 62 | + public static final FormulaAndFunctionApmMetricStatName LATENCY_P95 = |
| 63 | + new FormulaAndFunctionApmMetricStatName("latency_p95"); |
| 64 | + public static final FormulaAndFunctionApmMetricStatName LATENCY_P99 = |
| 65 | + new FormulaAndFunctionApmMetricStatName("latency_p99"); |
| 66 | + public static final FormulaAndFunctionApmMetricStatName LATENCY_P999 = |
| 67 | + new FormulaAndFunctionApmMetricStatName("latency_p999"); |
| 68 | + public static final FormulaAndFunctionApmMetricStatName LATENCY_DISTRIBUTION = |
| 69 | + new FormulaAndFunctionApmMetricStatName("latency_distribution"); |
| 70 | + public static final FormulaAndFunctionApmMetricStatName HITS = |
| 71 | + new FormulaAndFunctionApmMetricStatName("hits"); |
| 72 | + public static final FormulaAndFunctionApmMetricStatName HITS_PER_SECOND = |
| 73 | + new FormulaAndFunctionApmMetricStatName("hits_per_second"); |
| 74 | + public static final FormulaAndFunctionApmMetricStatName TOTAL_TIME = |
| 75 | + new FormulaAndFunctionApmMetricStatName("total_time"); |
| 76 | + public static final FormulaAndFunctionApmMetricStatName APDEX = |
| 77 | + new FormulaAndFunctionApmMetricStatName("apdex"); |
| 78 | + |
| 79 | + FormulaAndFunctionApmMetricStatName(String value) { |
| 80 | + super(value, allowedValues); |
| 81 | + } |
| 82 | + |
| 83 | + public static class FormulaAndFunctionApmMetricStatNameSerializer |
| 84 | + extends StdSerializer<FormulaAndFunctionApmMetricStatName> { |
| 85 | + public FormulaAndFunctionApmMetricStatNameSerializer( |
| 86 | + Class<FormulaAndFunctionApmMetricStatName> t) { |
| 87 | + super(t); |
| 88 | + } |
| 89 | + |
| 90 | + public FormulaAndFunctionApmMetricStatNameSerializer() { |
| 91 | + this(null); |
| 92 | + } |
| 93 | + |
| 94 | + @Override |
| 95 | + public void serialize( |
| 96 | + FormulaAndFunctionApmMetricStatName value, JsonGenerator jgen, SerializerProvider provider) |
| 97 | + throws IOException, JsonProcessingException { |
| 98 | + jgen.writeObject(value.value); |
| 99 | + } |
| 100 | + } |
| 101 | + |
| 102 | + @JsonCreator |
| 103 | + public static FormulaAndFunctionApmMetricStatName fromValue(String value) { |
| 104 | + return new FormulaAndFunctionApmMetricStatName(value); |
| 105 | + } |
| 106 | +} |
0 commit comments