forked from linkedin/venice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[router] Add router current version metric (linkedin#793)
* [router] Add store current version metric This PR adds current version metric in router which gives us visibility of in-memory vcurrent version being served for a store in the route --------- Co-authored-by: Sourav Maji <[email protected]>
- Loading branch information
1 parent
9a3d18c
commit a91cabe
Showing
5 changed files
with
69 additions
and
12 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
21 changes: 21 additions & 0 deletions
21
...nice-router/src/main/java/com/linkedin/venice/router/stats/RouterCurrentVersionStats.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,21 @@ | ||
package com.linkedin.venice.router.stats; | ||
|
||
import com.linkedin.venice.stats.AbstractVeniceStats; | ||
import com.linkedin.venice.stats.Gauge; | ||
import io.tehuti.metrics.MetricsRepository; | ||
import io.tehuti.metrics.Sensor; | ||
|
||
|
||
public class RouterCurrentVersionStats extends AbstractVeniceStats { | ||
private final Sensor currentVersionNumberSensor; | ||
private int currentVersion = -1; | ||
|
||
public RouterCurrentVersionStats(MetricsRepository metricsRepository, String name) { | ||
super(metricsRepository, name); | ||
this.currentVersionNumberSensor = registerSensor("current_version", new Gauge(() -> this.currentVersion)); | ||
} | ||
|
||
public void updateCurrentVersion(int currentVersion) { | ||
this.currentVersion = currentVersion; | ||
} | ||
} |
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