Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Sep 23, 2024
1 parent 16c9842 commit ef9108e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.microsoft.applicationinsights.agent.internal.keytransaction;

import static java.util.Collections.emptyList;
import static java.util.stream.Collectors.toList;

import com.azure.json.JsonProviders;
Expand All @@ -28,7 +29,7 @@ public static KeyTransactionConfigSupplier getInstance() {
return instance;
}

private volatile List<KeyTransactionConfig> configs;
private volatile List<KeyTransactionConfig> configs = emptyList();

@Override
public List<KeyTransactionConfig> get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class KeyTransactionSpanProcessor implements SpanProcessor {

// TODO remove global state
public static volatile DoubleHistogram keyTransactionHistogram;
private static volatile DoubleHistogram keyTransactionHistogram;

public static void initMeterProvider(MeterProvider meterProvider) {
keyTransactionHistogram =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ void test() throws Exception {
assertThat(earthOrbitKeyTransactionConfig.getStartCriteria()).hasSize(1);
KeyTransactionConfig.Criterion earthOrbitStartCriteria =
earthOrbitKeyTransactionConfig.getStartCriteria().get(0);
assertThat(earthOrbitStartCriteria.getField().getKey()).isEqualTo("http.path");
assertThat(earthOrbitStartCriteria.getField().getKey()).isEqualTo("url.path");
assertThat(earthOrbitStartCriteria.getOperator()).isEqualTo(EQUALS);
assertThat(earthOrbitStartCriteria.getValue()).isEqualTo("earth");
assertThat(earthOrbitStartCriteria.getValue()).isEqualTo("/earth");

assertThat(earthOrbitKeyTransactionConfig.getEndCriteria()).isEmpty();

Expand All @@ -43,9 +43,9 @@ void test() throws Exception {
assertThat(marsMissionKeyTransactionConfig.getStartCriteria()).hasSize(1);
KeyTransactionConfig.Criterion marsMissionStartCriteria =
marsMissionKeyTransactionConfig.getStartCriteria().get(0);
assertThat(marsMissionStartCriteria.getField().getKey()).isEqualTo("http.path");
assertThat(marsMissionStartCriteria.getField().getKey()).isEqualTo("url.path");
assertThat(marsMissionStartCriteria.getOperator()).isEqualTo(EQUALS);
assertThat(marsMissionStartCriteria.getValue()).isEqualTo("mars");
assertThat(marsMissionStartCriteria.getValue()).isEqualTo("/mars");

assertThat(marsMissionKeyTransactionConfig.getEndCriteria()).hasSize(2);

Expand All @@ -56,7 +56,7 @@ void test() throws Exception {
assertThat(marsMissionEndCriteria1.getValue()).isEqualTo("process");

KeyTransactionConfig.Criterion marsMissionEndCriteria2 =
marsMissionKeyTransactionConfig.getEndCriteria().get(0);
marsMissionKeyTransactionConfig.getEndCriteria().get(1);
assertThat(marsMissionEndCriteria2.getField().getKey()).isEqualTo("messaging.destination.name");
assertThat(marsMissionEndCriteria2.getOperator()).isEqualTo(EQUALS);
assertThat(marsMissionEndCriteria2.getValue()).isEqualTo("space");
Expand Down

0 comments on commit ef9108e

Please sign in to comment.