Documentation
¶
Index ¶
- Constants
- func AddDBDurationVec(sql string, duration time.Duration)
- func AddHTTPRequestsDuration(duration time.Duration)
- func DecHTTPActiveRequestsCount()
- func DecWPAddTaskWaitCountVec(wpType string)
- func DecWPTaskQueueBufferLenVec(wpType string)
- func DecWPWorkerProcessCountVec(wpType string)
- func IncCalcCountVec(label string)
- func IncCalcDurationVec(label string, duration time.Duration)
- func IncDBCountVec(sql string)
- func IncHTTPActiveRequestsCount()
- func IncHTTPClientCallCountVec(resource string, method string)
- func IncHTTPClientCallDurationVec(resource string, method string, duration time.Duration)
- func IncHTTPErrorRequestsCountVec(resource string, method string)
- func IncHTTPRequestsCountVec(resource string, method string)
- func IncHTTPRequestsDurationVec(resource string, method string, state string, duration time.Duration)
- func IncMarshalingDurationVec(label string, duration time.Duration)
- func IncUnMarshalingDurationVec(label string, duration time.Duration)
- func IncWPAddTaskWaitCountVec(wpType string)
- func IncWPTaskProcessDurationVec(wpType string, name string, duration time.Duration)
- func IncWPTaskQueueBufferLenVec(wpType string)
- func IncWPWorkerProcessCountVec(wpType string)
- func InitGlobalMetrics(cfg *Config)
- func PrintGlobalMetricsToLog()
- func SetWPTaskQueueBufferLenVec(wpType string, len float64)
- type Config
- type Metrics
Constants ¶
View Source
const ( DEF_METRICS_NAMESPACE = "com" DEF_METRICS_SUBSYSTEM = "api" )
Variables ¶
This section is empty.
Functions ¶
func AddDBDurationVec ¶
func AddHTTPRequestsDuration ¶
func DecHTTPActiveRequestsCount ¶
func DecHTTPActiveRequestsCount()
func DecWPAddTaskWaitCountVec ¶
func DecWPAddTaskWaitCountVec(wpType string)
func DecWPTaskQueueBufferLenVec ¶
func DecWPTaskQueueBufferLenVec(wpType string)
func DecWPWorkerProcessCountVec ¶
func DecWPWorkerProcessCountVec(wpType string)
func IncCalcDurationVec ¶
func IncHTTPActiveRequestsCount ¶
func IncHTTPActiveRequestsCount()
func IncHTTPClientCallCountVec ¶
Метрики HTTP client call
func IncHTTPRequestsCountVec ¶
Метрики HTTP
func IncMarshalingDurationVec ¶
Метрики JSON
func IncWPAddTaskWaitCountVec ¶
func IncWPAddTaskWaitCountVec(wpType string)
func IncWPTaskQueueBufferLenVec ¶
func IncWPTaskQueueBufferLenVec(wpType string)
Метрики WorkerPoolVec
func IncWPWorkerProcessCountVec ¶
func IncWPWorkerProcessCountVec(wpType string)
func InitGlobalMetrics ¶
func InitGlobalMetrics(cfg *Config)
func PrintGlobalMetricsToLog ¶
func PrintGlobalMetricsToLog()
Types ¶
type Config ¶
type Config struct { MetricsNamespace string `yaml:"metrics_namespace"` MetricsSubsystem string `yaml:"metrics_subsystem"` // Метрики DB CollectDBCountVec bool `yaml:"collect_db_count_vec"` CollectDBDurationVec bool `yaml:"collect_db_duration_vec"` // Метрики HTTP request CollectHTTPRequestsCountVec bool `yaml:"collect_http_requests_count_vec"` CollectHTTPErrorRequestsCountVec bool `yaml:"collect_http_error_requests_count_vec"` CollectHTTPRequestsDurationVec bool `yaml:"collect_http_requests_duration_vec"` CollectHTTPActiveRequestsCount bool `yaml:"collect_http_active_requests_count"` CollectHTTPRequestsDuration bool `yaml:"collect_http_requests_duration"` // Метрики HTTP client call CollectHTTPClientCallCountVec bool `yaml:"collect_http_client_call_count_vec"` CollectHTTPClientCallDurationVec bool `yaml:"collect_http_client_call_duration_vec"` // Метрики вычислений CollectCalcCountVec bool `yaml:"collect_calc_count_vec"` CollectCalcDurationVec bool `yaml:"collect_calc_duration_vec"` // Метрики JSON CollectMarshalingDurationVec bool `yaml:"collect_marshaling_duration_vec"` CollectUnMarshalingDurationVec bool `yaml:"collect_un_marshaling_duration_vec"` // Метрики WorkerPool CollectWPTaskQueueBufferLenVec bool `yaml:"collect_wp_task_queue_buffer_len_vec"` CollectWPAddTaskWaitCountVec bool `yaml:"collect_wp_add_task_wait_count_vec"` CollectWPWorkerProcessCountVec bool `yaml:"collect_wp_worker_process_count_vec"` CollectWPTaskProcessDurationVec bool `yaml:"collect_wp_task_process_duration_ms_by_name"` }
Config конфигурационные настройки
type Metrics ¶
type Metrics struct { Cfg *Config Registry *prometheus.Registry // Метрики DB DBCountVec *prometheus.CounterVec DBDurationVec *prometheus.HistogramVec // Метрики HTTP request HTTPRequestsCountVec *prometheus.CounterVec HTTPErrorRequestsCountVec *prometheus.CounterVec HTTPRequestsDurationVec *prometheus.HistogramVec HTTPActiveRequestsCount prometheus.Gauge HTTPRequestsDuration prometheus.Histogram // Метрики HTTP client call HTTPClientCallCountVec *prometheus.CounterVec HTTPClientCallDurationVec *prometheus.HistogramVec // Метрики вычислений CalcCountVec *prometheus.CounterVec CalcDurationVec *prometheus.HistogramVec // Метрики JSON MarshalingDurationVec *prometheus.HistogramVec UnMarshalingDurationVec *prometheus.HistogramVec // Метрики WorkerPoolVec WPTaskQueueBufferLenVec *prometheus.GaugeVec WPAddTaskWaitCountVec *prometheus.GaugeVec WPWorkerProcessCountVec *prometheus.GaugeVec WPTaskProcessDurationVec *prometheus.HistogramVec }
func GlobalMetrics ¶
func GlobalMetrics() *Metrics
func (*Metrics) PrintMetricsToLog ¶
func (mt *Metrics) PrintMetricsToLog()
Click to show internal directories.
Click to hide internal directories.