-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metrics for Cassandra Process Manager and Monitor. (#656)
- Loading branch information
1 parent
3990f8e
commit 8a60bb3
Showing
8 changed files
with
122 additions
and
6 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
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
62 changes: 62 additions & 0 deletions
62
priam/src/main/java/com/netflix/priam/merics/CassMonitorMetrics.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,62 @@ | ||
/** | ||
* Copyright 2018 Netflix, Inc. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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.netflix.priam.merics; | ||
|
||
import com.google.inject.Singleton; | ||
|
||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
/** | ||
* @author vchella | ||
*/ | ||
@Singleton | ||
public class CassMonitorMetrics implements ICassMonitorMetrics { | ||
|
||
AtomicInteger cassStop = new AtomicInteger(), | ||
cassAutoStart = new AtomicInteger(), | ||
cassStart = new AtomicInteger(); | ||
|
||
|
||
@Override | ||
public void incCassStop() { | ||
cassStop.getAndIncrement(); | ||
} | ||
|
||
@Override | ||
public void incCassAutoStart() { | ||
cassAutoStart.getAndIncrement(); | ||
} | ||
|
||
@Override | ||
public void incCassStart() { | ||
cassStart.getAndIncrement(); | ||
} | ||
|
||
@Override | ||
public int getCassStop() { | ||
return cassStop.get(); | ||
} | ||
|
||
@Override | ||
public int getCassAutoStart() { | ||
return cassAutoStart.get(); | ||
} | ||
|
||
@Override | ||
public int getCassStart() { | ||
return cassStart.get(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
priam/src/main/java/com/netflix/priam/merics/ICassMonitorMetrics.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,33 @@ | ||
/** | ||
* Copyright 2018 Netflix, Inc. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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.netflix.priam.merics; | ||
|
||
import com.google.inject.ImplementedBy; | ||
|
||
/** | ||
* A means to keep track of events with Cassandra Monitor (Start, restart, stop etc.,) | ||
* Created by vchella on 01/10/18. | ||
*/ | ||
@ImplementedBy(CassMonitorMetrics.class) | ||
public interface ICassMonitorMetrics { | ||
void incCassStop(); | ||
void incCassAutoStart(); | ||
void incCassStart(); | ||
|
||
int getCassStop(); | ||
int getCassAutoStart(); | ||
int getCassStart(); | ||
} |
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
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