Skip to content

Commit

Permalink
Some more name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-osborn committed Oct 12, 2023
1 parent 9bf4fc4 commit 0674758
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/mode/static/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/nginxinc/nginx-gateway-fabric/internal/mode/static/state/resolver"
)

type controllerMetricsCollector interface {
type handlerMetricsCollector interface {
ObserveLastEventBatchProcessTime(time.Duration)
}

Expand All @@ -51,7 +51,7 @@ type eventHandlerConfig struct {
// controlConfigNSName is the NamespacedName of the NginxGateway config for this controller.
controlConfigNSName types.NamespacedName
// metricsCollector collects metrics for this controller.
metricsCollector controllerMetricsCollector
metricsCollector handlerMetricsCollector
// logger is the logger to be used by the EventHandler.
logger logr.Logger
// version is the current version number of the nginx config.
Expand Down
16 changes: 8 additions & 8 deletions internal/mode/static/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ func StartManager(cfg config.Config) error {
}

var (
mgrCollector ngxruntime.MetricsCollector = collectors.NewManagerNoopCollector()
ngxruntimeCollector ngxruntime.MetricsCollector = collectors.NewManagerNoopCollector()
// nolint:ineffassign // not an ineffectual assignment. Will be used if metrics are disabled.
ctlrCollector controllerMetricsCollector = collectors.NewControllerNoopCollector()
handlerCollector handlerMetricsCollector = collectors.NewControllerNoopCollector()
)

if cfg.MetricsConfig.Enabled {
Expand All @@ -144,12 +144,12 @@ func StartManager(cfg config.Config) error {
return fmt.Errorf("cannot create nginx metrics collector: %w", err)
}

mgrCollector = collectors.NewManagerMetricsCollector(constLabels)
ctlrCollector = collectors.NewControllerCollector(constLabels)
ngxruntimeCollector = collectors.NewManagerMetricsCollector(constLabels)
handlerCollector = collectors.NewControllerCollector(constLabels)
metrics.Registry.MustRegister(
ngxCollector,
mgrCollector.(prometheus.Collector),
ctlrCollector.(prometheus.Collector),
ngxruntimeCollector.(prometheus.Collector),
handlerCollector.(prometheus.Collector),
)
}

Expand All @@ -174,12 +174,12 @@ func StartManager(cfg config.Config) error {
cfg.Logger.WithName("nginxFileManager"),
file.NewStdLibOSFileManager(),
),
nginxRuntimeMgr: ngxruntime.NewManagerImpl(mgrCollector),
nginxRuntimeMgr: ngxruntime.NewManagerImpl(ngxruntimeCollector),
statusUpdater: statusUpdater,
eventRecorder: recorder,
healthChecker: hc,
controlConfigNSName: controlConfigNSName,
metricsCollector: ctlrCollector,
metricsCollector: handlerCollector,
})

objects, objectLists := prepareFirstEventBatchPreparerArgs(cfg.GatewayClassName, cfg.GatewayNsName)
Expand Down

0 comments on commit 0674758

Please sign in to comment.