mirror of
https://github.com/OpenLiberty/liberty-bikes.git
synced 2024-11-21 00:51:27 +08:00
Adding new gameMetric
This commit is contained in:
parent
2e6152d6c8
commit
6ef2d2b182
@ -92,13 +92,13 @@ public class GameMetrics {
|
||||
return currentPartiesCounter;
|
||||
}
|
||||
|
||||
// @Timed(unit = MetricUnits.SECONDS,
|
||||
// name = "timer",
|
||||
// absolute = true,
|
||||
// description = "The time an app has been running")
|
||||
// public Context startTimer() {
|
||||
// return timerContext;
|
||||
// }
|
||||
@Timed(unit = MetricUnits.SECONDS,
|
||||
name = "timer",
|
||||
absolute = true,
|
||||
description = "The time an app has been running")
|
||||
public Context startTimer() {
|
||||
return timerContext;
|
||||
}
|
||||
|
||||
public void incTotalPlayerCount() {
|
||||
System.out.println("Increasing player count");
|
||||
|
@ -22,8 +22,8 @@ import jakarta.websocket.server.PathParam;
|
||||
import jakarta.websocket.server.ServerEndpoint;
|
||||
|
||||
import org.eclipse.microprofile.faulttolerance.Retry;
|
||||
import org.eclipse.microprofile.metrics.annotation.Counted;
|
||||
//import org.eclipse.microprofile.metrics.Timer.Context;
|
||||
//import org.eclipse.microprofile.metrics.annotation.Metered;
|
||||
import org.eclipse.microprofile.rest.client.inject.RestClient;
|
||||
import org.libertybikes.game.core.GameRound;
|
||||
import org.libertybikes.game.core.GameRound.State;
|
||||
@ -83,12 +83,9 @@ public class GameRoundWebsocket {
|
||||
}
|
||||
|
||||
@OnMessage
|
||||
/*
|
||||
* @Metered(name = "rate_of_websocket_calls",
|
||||
* displayName = "Rate of GameRound Websocket Calls",
|
||||
* description = "Rate of incoming messages to the game round websocket",
|
||||
* absolute = true)
|
||||
*/
|
||||
@Counted(name = "rate_of_websocket_calls",
|
||||
description = "Rate of incoming messages to the game round websocket",
|
||||
absolute = true)
|
||||
public void onMessage(@PathParam("roundId") final String roundId, String message, Session session) {
|
||||
try {
|
||||
final InboundMessage msg = jsonb.fromJson(message, InboundMessage.class);
|
||||
|
Loading…
Reference in New Issue
Block a user