Skip to content

Commit cd13750

Browse files
authored
Restore Timer Stats (#484)
1 parent 9dc6225 commit cd13750

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## 34.0-SNAPSHOT - unreleased
44

5+
6+
### 🐞 Bug Fixes
7+
8+
* Restore display of Timers in Service AdminStats.
9+
510
## 33.0.0 - 2025-09-26
611

712
### 💥 Breaking Changes (upgrade difficulty: 🟢 LOW - exception handling syntax )

src/main/groovy/io/xh/hoist/util/Timer.groovy

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ package io.xh.hoist.util
1010
import com.hazelcast.replicatedmap.ReplicatedMap
1111
import groovy.transform.NamedParam
1212
import groovy.transform.NamedVariant
13+
import io.xh.hoist.AdminStats
1314
import io.xh.hoist.cluster.ClusterService
1415
import io.xh.hoist.log.LogSupport
1516
import org.slf4j.Logger
@@ -45,7 +46,7 @@ import static org.slf4j.LoggerFactory.getLogger
4546
* A common pattern would be to have the primary instance run a Timer-based job to load data into
4647
* a cache, with the cache then replicated across the cluster.
4748
*/
48-
class Timer implements LogSupport {
49+
class Timer implements LogSupport, AdminStats {
4950

5051
private static Long CONFIG_INTERVAL = 15 * SECONDS
5152
private static boolean shutdownInProgress = false
@@ -224,16 +225,19 @@ class Timer implements LogSupport {
224225
Map getAdminStats() {
225226
[
226227
name : name,
227-
type : 'Timer' + (primaryOnly ? ' (primary only)' : ''),
228+
type : 'Timer',
229+
primaryOnly: primaryOnly,
228230
intervalMs: intervalMs,
229231
isRunning : isRunning,
230232
startTime : isRunning ? _lastRunStarted : null,
231233
last : _lastRunStats
232234
].findAll { it.value != null }
233235
}
234236

235-
236-
//------------------------
237+
List<String> getComparableAdminStats() {
238+
return []
239+
}
240+
//------------------------
237241
// Implementation
238242
//------------------------
239243
private void doRun() {

0 commit comments

Comments
 (0)