register function

void register([
  1. CollectorRegistry? registry
])

Register default metrics for the Dart runtime. If no registry is provided, the CollectorRegistry.defaultRegistry is used.

Implementation

void register([CollectorRegistry? registry]) {
  registry ??= CollectorRegistry.defaultRegistry;

  registry.register(RuntimeCollector());
}