Browse Source

GCCollector: add docstring and documentation.

pull/4/head
Fredrik Ekre 2 years ago
parent
commit
a4ea6a3b70
  1. 9
      docs/src/index.md
  2. 19
      src/gc_collector.jl

9
docs/src/index.md

@ -131,6 +131,15 @@ A collector that exports metrics about allocations and garbage collection (for e
number of allocations, number of bytes allocated, time spent in garbage collection, etc). number of allocations, number of bytes allocated, time spent in garbage collection, etc).
These metrics have the `gc_` prefix in their name. These metrics have the `gc_` prefix in their name.
A `GCCollector` is registered automatically with the default registry, see
[Default registry](@ref) for more details.
#### GCCollector API reference
```@docs
Prometheus.GCCollector(; kwargs...)
```
### ProcessCollector ### ProcessCollector
A collector that exports metrics about a running process, for example CPU seconds and A collector that exports metrics about a running process, for example CPU seconds and

19
src/gc_collector.jl

@ -12,6 +12,25 @@ mutable struct GCCollector <: Collector
end end
end end
"""
Prometheus.GCCollector(; registry=DEFAULT_REGISTRY)
Create a collector that exports metrics about allocations and garbage collection.
**Keyword arguments**
- `registry :: Prometheus.CollectorRegistry`: the registry in which to register the
collector. The default registry is used by default. Pass `registry = nothing` to skip
registration.
!!! note
A `GCCollector` is registered automatically with the default registry.
If necessary it can be removed by calling
```julia
Prometheus.unregister(Prometheus.DEFAULT_REGISTRY, Prometheus.GC_COLLECTOR)
```
"""
GCCollector(; kwargs...)
function metric_names(::GCCollector) function metric_names(::GCCollector)
return ( return (
"gc_alloc_total", "gc_free_total", "gc_alloc_bytes_total", "gc_alloc_total", "gc_free_total", "gc_alloc_bytes_total",

Loading…
Cancel
Save