-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is useful for test code where we don't care about the metrics gathered.
- Loading branch information
Showing
4 changed files
with
36 additions
and
22 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
projects/core/src/main/java/dan200/computercraft/core/metrics/DiscardingMetricsObserver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-FileCopyrightText: 2023 The CC: Tweaked Developers | ||
// | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package dan200.computercraft.core.metrics; | ||
|
||
/** | ||
* A {@link MetricsObserver} implementation which discards all metrics it receives. | ||
*/ | ||
final class DiscardingMetricsObserver implements MetricsObserver { | ||
static final MetricsObserver INSTANCE = new DiscardingMetricsObserver(); | ||
|
||
private DiscardingMetricsObserver() { | ||
} | ||
|
||
@Override | ||
public void observe(Metric.Counter counter) { | ||
} | ||
|
||
@Override | ||
public void observe(Metric.Event event, long value) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters