• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ExpediaGroup / beekeeper / #814

07 Apr 2026 07:33PM UTC coverage: 87.706% (-0.07%) from 87.774%
#814

Pull #201

ninhomilton
Clean up
Pull Request #201: Upgrade to Java 21 and Spring Boot 3.2.12

10 of 12 new or added lines in 3 files covered. (83.33%)

115 existing lines in 33 files now uncovered.

1541 of 1757 relevant lines covered (87.71%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.19
/beekeeper-core/src/main/java/com/expediagroup/beekeeper/core/config/GraphiteConfigFactory.java
1
/**
2
 * Copyright (C) 2019 Expedia, Inc.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package com.expediagroup.beekeeper.core.config;
17

18
import org.springframework.boot.context.properties.ConfigurationProperties;
19
import org.springframework.stereotype.Component;
20

21
import io.micrometer.graphite.GraphiteConfig;
22
import io.micrometer.graphite.GraphiteProtocol;
23

24
import com.expediagroup.beekeeper.core.error.BeekeeperException;
25

26
@Component
1✔
27
@ConfigurationProperties(prefix = "graphite")
28
public class GraphiteConfigFactory {
1✔
29

1✔
30
  private static int DEFAULT_GRAPHITE_PORT = 2003;
31
  private static String DEFAULT_GRAPHITE_HOST = "localhost";
32

33
  private boolean enabled;
34
  private String host;
1✔
35
  private String prefix;
36
  private int port = DEFAULT_GRAPHITE_PORT;
UNCOV
37

×
38
  public boolean isEnabled() {
39
    return enabled;
40
  }
41

1✔
42
  public void setEnabled(boolean enabled) {
1✔
43
    this.enabled = enabled;
44
  }
UNCOV
45

×
46
  public String getHost() {
47
    return host;
48
  }
49

1✔
50
  public void setHost(String host) {
1✔
51
    this.host = host;
52
  }
UNCOV
53

×
54
  public String getPrefix() {
55
    return prefix;
56
  }
57

1✔
58
  public void setPrefix(String prefix) {
1✔
59
    this.prefix = prefix;
60
  }
UNCOV
61

×
62
  public int getPort() {
63
    return port;
64
  }
65

1✔
66
  public void setPort(int port) {
1✔
67
    this.port = port;
68
  }
69

1✔
70
  public GraphiteConfig newInstance() {
1✔
71
    if (!enabled) {
72
      return new DefaultGraphiteConfig();
1✔
73
    }
1✔
74
    if (host == null) {
75
      throw new BeekeeperException("If Graphite is enabled, graphite.host must be set.");
1✔
76
    }
1✔
77
    if (prefix == null) {
78
      throw new BeekeeperException("If Graphite is enabled, graphite.prefix must be set.");
1✔
79
    }
80
    return new DefaultGraphiteConfig(true, host, prefix, port);
81
  }
82

83
  private static class DefaultGraphiteConfig implements GraphiteConfig {
84

85
    private boolean enabled;
86
    private String host;
87
    private String prefix;
88
    private int port;
89

1✔
90
    public DefaultGraphiteConfig() {
1✔
91
      this(false, DEFAULT_GRAPHITE_HOST, null, DEFAULT_GRAPHITE_PORT);
92
    }
1✔
93

1✔
94
    public DefaultGraphiteConfig(boolean enabled, String host, String prefix, int port) {
1✔
95
      this.enabled = enabled;
1✔
96
      this.host = host;
1✔
97
      this.prefix = prefix;
1✔
98
      this.port = port;
99
    }
100

101
    @Override
1✔
102
    public String host() {
103
      return host;
104
    }
105

106
    @Override
1✔
107
    public int port() {
108
      return port;
109
    }
110

111
    @Override
1✔
112
    public String prefix() {
113
      return prefix;
114
    }
115

116
    @Override
1✔
117
    public boolean enabled() {
118
      return enabled;
119
    }
120

121
    @Override
1✔
122
    public GraphiteProtocol protocol() {
123
      return GraphiteProtocol.PLAINTEXT;
124
    }
125

126
    @Override
1✔
127
    public String get(String key) {
128
      return null;
129
    }
130
  }
131
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc