0

I'm wondering what's the update ratio of gauge meter in micrometer:

List<String> list = registry.gauge("listGauge", Collections.emptyList(), new ArrayList<>(), List::size);

now let's say that list is changing sometimes often, sometimes stays without a change for a long time. How often aList.size() will be called?

More general question:

Is gauge a good pick for reporting DB table state every x seconds? I've a table with date column and want to configure alert when date is older than t seconds. That requires DB query each time, so I don't want to be called too often. Appreciate any advice.

raduy
  • 482
  • 5
  • 11

1 Answers1

2

I've found the answer:

There is configuration property polling-frequency, so configure it like this:

management.metrics.export.statsd.polling-frequency: 30s

and gauge seems to be a good match for reporting DB table state.

Seldon
  • 388
  • 2
  • 12
raduy
  • 482
  • 5
  • 11