NVIDIA GPU loadable plugin
Source
func (h *Handler) GetEncoderUtilization(_ context.Context, metricParams map[string]string, _ ...string) (any, error) {
/*
** Zabbix
** Copyright (C) 2001-2024 Zabbix SIA
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**/
package handlers //nolint:revive
import (
"context"
"encoding/json"
"sync"
"golang.org/x/sync/errgroup"
"golang.zabbix.com/plugin/nvidia/internal/plugin/params"
"golang.zabbix.com/plugin/nvidia/pkg/nvml"
"golang.zabbix.com/sdk/errs"
)
var (
_ HandlerFunc = WithJSONResponse(nil)
_ HandlerFunc = (*Handler)(nil).GetNVMLVersion
_ HandlerFunc = (*Handler)(nil).GetBAR1MemoryInfo
_ HandlerFunc = (*Handler)(nil).GetDecoderUtilization
_ HandlerFunc = (*Handler)(nil).GetDeviceCount
_ HandlerFunc = (*Handler)(nil).GetDeviceEnergyConsumption
_ HandlerFunc = (*Handler)(nil).GetDeviceFanSpeed
_ HandlerFunc = (*Handler)(nil).GetDevicePerfState
_ HandlerFunc = (*Handler)(nil).GetDevicePowerLimit
_ HandlerFunc = (*Handler)(nil).GetDevicePowerUsage
_ HandlerFunc = (*Handler)(nil).GetDeviceSerial
_ HandlerFunc = (*Handler)(nil).GetDeviceTemperature
_ HandlerFunc = (*Handler)(nil).GetDriverVersion
_ HandlerFunc = (*Handler)(nil).GetEncoderStats
_ HandlerFunc = (*Handler)(nil).GetEncoderUtilization
_ HandlerFunc = (*Handler)(nil).GetFBMemoryInfo
_ HandlerFunc = (*Handler)(nil).GetGraphicsFrequency
_ HandlerFunc = (*Handler)(nil).GetMemoryErrors
_ HandlerFunc = (*Handler)(nil).GetMemoryFrequency
_ HandlerFunc = (*Handler)(nil).GetPCIeThroughput
_ HandlerFunc = (*Handler)(nil).GetRegisterErrors
_ HandlerFunc = (*Handler)(nil).GetVideoFrequency
_ HandlerFunc = (*Handler)(nil).GetSMFrequency
)
// HandlerFunc describes the signature all metric handler functions must have.
type HandlerFunc func(
ctx context.Context,
metricParams map[string]string,
extraParams ...string,
) (any, error)