-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Cody Littley <cody@swirldslabs.com>
- Loading branch information
1 parent
7c0ac63
commit 6913b72
Showing
58 changed files
with
8,753 additions
and
218 deletions.
There are no files selected for viewing
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
86 changes: 86 additions & 0 deletions
86
...irlds-common/src/main/java/com/swirlds/common/metrics/extensions/NoOpFractionalTimer.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,86 @@ | ||
/* | ||
* Copyright (C) 2023 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.swirlds.common.metrics.extensions; | ||
|
||
import com.swirlds.common.metrics.Metrics; | ||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
|
||
/** | ||
* A NoOp implementation of {@link FractionalTimer}. | ||
*/ | ||
public class NoOpFractionalTimer implements FractionalTimer { | ||
|
||
private static final NoOpFractionalTimer INSTANCE = new NoOpFractionalTimer(); | ||
|
||
private NoOpFractionalTimer() {} | ||
|
||
/** | ||
* Get the singleton instance. | ||
* | ||
* @return the singleton instance | ||
*/ | ||
public static FractionalTimer getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void registerMetric( | ||
@NonNull Metrics metrics, @NonNull String category, @NonNull String name, @NonNull String description) {} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void activate(final long now) {} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void activate() {} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void deactivate(final long now) {} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void deactivate() {} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public double getActiveFraction() { | ||
return 0; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public double getAndReset() { | ||
return 0; | ||
} | ||
} |
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
Oops, something went wrong.