metrics

package
v2.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_internal_metrics_metrics_proto protoreflect.FileDescriptor

Functions

func FinishReportAndFlushUserAction

func FinishReportAndFlushUserAction(action string, err error, start time.Time) func()

FinishReportAndFlushUserAction immediately reports the metric but does not block execution. It returns a wait function which waits or times out after 5s. It is used by the pachctl binary and runs on users' machines

func ReportUserAction

func ReportUserAction(ctx context.Context, r *Reporter, action string) func(time.Time, error)

ReportUserAction pushes the action into a queue for reporting, and reports the start, finish, and error conditions

func StartReportAndFlushUserAction

func StartReportAndFlushUserAction(action string, value interface{}) func()

StartReportAndFlushUserAction immediately reports the metric but does not block execution. It returns a wait function which waits or times out after 5s. It is used by the pachctl binary and runs on users' machines

Types

type Metrics

type Metrics struct {
	ClusterId           string  `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"`
	PodId               string  `protobuf:"bytes,2,opt,name=pod_id,json=podId,proto3" json:"pod_id,omitempty"`
	Nodes               int64   `protobuf:"varint,3,opt,name=nodes,proto3" json:"nodes,omitempty"`
	Version             string  `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	Repos               int64   `protobuf:"varint,5,opt,name=repos,proto3" json:"repos,omitempty"`                                                              // Number of repos
	Commits             int64   `protobuf:"varint,6,opt,name=commits,proto3" json:"commits,omitempty"`                                                          // Number of commits -- not used
	Files               int64   `protobuf:"varint,7,opt,name=files,proto3" json:"files,omitempty"`                                                              // Number of files -- not used
	Bytes               uint64  `protobuf:"varint,8,opt,name=bytes,proto3" json:"bytes,omitempty"`                                                              // Number of bytes in all repos
	Jobs                int64   `protobuf:"varint,9,opt,name=jobs,proto3" json:"jobs,omitempty"`                                                                // Number of jobs
	Pipelines           int64   `protobuf:"varint,10,opt,name=pipelines,proto3" json:"pipelines,omitempty"`                                                     // Number of pipelines in the cluster -- not the same as DAG
	ArchivedCommits     int64   `protobuf:"varint,11,opt,name=archived_commits,json=archivedCommits,proto3" json:"archived_commits,omitempty"`                  // Number of archived commit -- not used
	CancelledCommits    int64   `protobuf:"varint,12,opt,name=cancelled_commits,json=cancelledCommits,proto3" json:"cancelled_commits,omitempty"`               // Number of cancelled commits -- not used
	ActivationCode      string  `protobuf:"bytes,13,opt,name=activation_code,json=activationCode,proto3" json:"activation_code,omitempty"`                      // Activation code
	MaxBranches         uint64  `protobuf:"varint,14,opt,name=max_branches,json=maxBranches,proto3" json:"max_branches,omitempty"`                              // Max branches in across all the repos
	PpsSpout            int64   `protobuf:"varint,15,opt,name=pps_spout,json=ppsSpout,proto3" json:"pps_spout,omitempty"`                                       // Number of spout pipelines
	PpsSpoutService     int64   `protobuf:"varint,16,opt,name=pps_spout_service,json=ppsSpoutService,proto3" json:"pps_spout_service,omitempty"`                // Number of spout services
	CfgEgress           int64   `protobuf:"varint,18,opt,name=cfg_egress,json=cfgEgress,proto3" json:"cfg_egress,omitempty"`                                    // Number of pipelines with Egress configured
	CfgStandby          int64   `protobuf:"varint,19,opt,name=cfg_standby,json=cfgStandby,proto3" json:"cfg_standby,omitempty"`                                 // Number of pipelines with Standby congigured
	CfgS3Gateway        int64   `protobuf:"varint,20,opt,name=cfg_s3gateway,json=cfgS3gateway,proto3" json:"cfg_s3gateway,omitempty"`                           // Number of pipelines with S3 Gateway configured
	CfgServices         int64   `protobuf:"varint,21,opt,name=cfg_services,json=cfgServices,proto3" json:"cfg_services,omitempty"`                              // Number of pipelines with services configured
	CfgErrcmd           int64   `protobuf:"varint,22,opt,name=cfg_errcmd,json=cfgErrcmd,proto3" json:"cfg_errcmd,omitempty"`                                    // Number of pipelines with error cmd set
	CfgTfjob            int64   `protobuf:"varint,24,opt,name=cfg_tfjob,json=cfgTfjob,proto3" json:"cfg_tfjob,omitempty"`                                       // Number of pipelines with TFJobs configured
	InputGroup          int64   `protobuf:"varint,25,opt,name=input_group,json=inputGroup,proto3" json:"input_group,omitempty"`                                 // Number of pipelines with group inputs
	InputJoin           int64   `protobuf:"varint,26,opt,name=input_join,json=inputJoin,proto3" json:"input_join,omitempty"`                                    // Number of pipelines with join inputs
	InputCross          int64   `protobuf:"varint,27,opt,name=input_cross,json=inputCross,proto3" json:"input_cross,omitempty"`                                 // Number of pipelines with cross inputs
	InputUnion          int64   `protobuf:"varint,28,opt,name=input_union,json=inputUnion,proto3" json:"input_union,omitempty"`                                 // Number of pipelines with union inputs
	InputCron           int64   `protobuf:"varint,29,opt,name=input_cron,json=inputCron,proto3" json:"input_cron,omitempty"`                                    // Number of pipelines with cron inputs
	InputGit            int64   `protobuf:"varint,30,opt,name=input_git,json=inputGit,proto3" json:"input_git,omitempty"`                                       // Number of pipelines with git inputs
	InputPfs            int64   `protobuf:"varint,31,opt,name=input_pfs,json=inputPfs,proto3" json:"input_pfs,omitempty"`                                       // Number of pfs inputs
	InputCommit         int64   `protobuf:"varint,32,opt,name=input_commit,json=inputCommit,proto3" json:"input_commit,omitempty"`                              // Number of pfs inputs with commits
	InputJoinOn         int64   `protobuf:"varint,33,opt,name=input_join_on,json=inputJoinOn,proto3" json:"input_join_on,omitempty"`                            // Number of pfs inputs with join_on
	InputOuterJoin      int64   `protobuf:"varint,34,opt,name=input_outer_join,json=inputOuterJoin,proto3" json:"input_outer_join,omitempty"`                   // Number of pipelines with outer joins
	InputLazy           int64   `protobuf:"varint,35,opt,name=input_lazy,json=inputLazy,proto3" json:"input_lazy,omitempty"`                                    // Number of pipelines with lazy set
	InputEmptyFiles     int64   `protobuf:"varint,36,opt,name=input_empty_files,json=inputEmptyFiles,proto3" json:"input_empty_files,omitempty"`                // Number of pipelines with empty files set
	InputS3             int64   `protobuf:"varint,37,opt,name=input_s3,json=inputS3,proto3" json:"input_s3,omitempty"`                                          // Number of pipelines with S3 input
	InputTrigger        int64   `protobuf:"varint,38,opt,name=input_trigger,json=inputTrigger,proto3" json:"input_trigger,omitempty"`                           // Number of pipelines with triggers set
	ResourceCpuReq      float32 `protobuf:"fixed32,39,opt,name=resource_cpu_req,json=resourceCpuReq,proto3" json:"resource_cpu_req,omitempty"`                  // Total CPU request across all pipelines
	ResourceCpuReqMax   float32 `protobuf:"fixed32,40,opt,name=resource_cpu_req_max,json=resourceCpuReqMax,proto3" json:"resource_cpu_req_max,omitempty"`       // Max CPU resource requests set
	ResourceMemReq      string  `protobuf:"bytes,41,opt,name=resource_mem_req,json=resourceMemReq,proto3" json:"resource_mem_req,omitempty"`                    // Sting of memory requests set across all pipelines
	ResourceGpuReq      int64   `protobuf:"varint,42,opt,name=resource_gpu_req,json=resourceGpuReq,proto3" json:"resource_gpu_req,omitempty"`                   // Total GPU requests across all pipelines
	ResourceGpuReqMax   int64   `protobuf:"varint,43,opt,name=resource_gpu_req_max,json=resourceGpuReqMax,proto3" json:"resource_gpu_req_max,omitempty"`        // Max GPU request across all pipelines
	ResourceDiskReq     string  `protobuf:"bytes,44,opt,name=resource_disk_req,json=resourceDiskReq,proto3" json:"resource_disk_req,omitempty"`                 // String of disk requests set across all pipelines
	ResourceCpuLimit    float32 `protobuf:"fixed32,45,opt,name=resource_cpu_limit,json=resourceCpuLimit,proto3" json:"resource_cpu_limit,omitempty"`            // Total CPU limits set across all pipelines
	ResourceCpuLimitMax float32 `protobuf:"fixed32,46,opt,name=resource_cpu_limit_max,json=resourceCpuLimitMax,proto3" json:"resource_cpu_limit_max,omitempty"` // Max CPU limit set
	ResourceMemLimit    string  `protobuf:"bytes,47,opt,name=resource_mem_limit,json=resourceMemLimit,proto3" json:"resource_mem_limit,omitempty"`              // String of memory limits set
	ResourceGpuLimit    int64   `protobuf:"varint,48,opt,name=resource_gpu_limit,json=resourceGpuLimit,proto3" json:"resource_gpu_limit,omitempty"`             // Number of pipelines with
	ResourceGpuLimitMax int64   `protobuf:"varint,49,opt,name=resource_gpu_limit_max,json=resourceGpuLimitMax,proto3" json:"resource_gpu_limit_max,omitempty"`  // Max GPU limit set
	ResourceDiskLimit   string  `protobuf:"bytes,50,opt,name=resource_disk_limit,json=resourceDiskLimit,proto3" json:"resource_disk_limit,omitempty"`           // String of disk limits set across all pipelines
	MaxParallelism      uint64  `protobuf:"varint,51,opt,name=max_parallelism,json=maxParallelism,proto3" json:"max_parallelism,omitempty"`                     // Max parallelism set
	MinParallelism      uint64  `protobuf:"varint,52,opt,name=min_parallelism,json=minParallelism,proto3" json:"min_parallelism,omitempty"`                     // Min parallelism set
	NumParallelism      uint64  `protobuf:"varint,53,opt,name=num_parallelism,json=numParallelism,proto3" json:"num_parallelism,omitempty"`                     // Number of pipelines with parallelism set
	EnterpriseFailures  int64   `protobuf:"varint,54,opt,name=enterprise_failures,json=enterpriseFailures,proto3" json:"enterprise_failures,omitempty"`         // Number of times a command has failed due to an enterprise check
	PipelineWithAlerts  bool    `protobuf:"varint,55,opt,name=pipeline_with_alerts,json=pipelineWithAlerts,proto3" json:"pipeline_with_alerts,omitempty"`       // pipelines with alerts indicator
	// contains filtered or unexported fields
}

func (*Metrics) Descriptor deprecated

func (*Metrics) Descriptor() ([]byte, []int)

Deprecated: Use Metrics.ProtoReflect.Descriptor instead.

func (*Metrics) GetActivationCode

func (x *Metrics) GetActivationCode() string

func (*Metrics) GetArchivedCommits

func (x *Metrics) GetArchivedCommits() int64

func (*Metrics) GetBytes

func (x *Metrics) GetBytes() uint64

func (*Metrics) GetCancelledCommits

func (x *Metrics) GetCancelledCommits() int64

func (*Metrics) GetCfgEgress

func (x *Metrics) GetCfgEgress() int64

func (*Metrics) GetCfgErrcmd

func (x *Metrics) GetCfgErrcmd() int64

func (*Metrics) GetCfgS3Gateway

func (x *Metrics) GetCfgS3Gateway() int64

func (*Metrics) GetCfgServices

func (x *Metrics) GetCfgServices() int64

func (*Metrics) GetCfgStandby

func (x *Metrics) GetCfgStandby() int64

func (*Metrics) GetCfgTfjob

func (x *Metrics) GetCfgTfjob() int64

func (*Metrics) GetClusterId added in v2.7.0

func (x *Metrics) GetClusterId() string

func (*Metrics) GetCommits

func (x *Metrics) GetCommits() int64

func (*Metrics) GetEnterpriseFailures

func (x *Metrics) GetEnterpriseFailures() int64

func (*Metrics) GetFiles

func (x *Metrics) GetFiles() int64

func (*Metrics) GetInputCommit

func (x *Metrics) GetInputCommit() int64

func (*Metrics) GetInputCron

func (x *Metrics) GetInputCron() int64

func (*Metrics) GetInputCross

func (x *Metrics) GetInputCross() int64

func (*Metrics) GetInputEmptyFiles

func (x *Metrics) GetInputEmptyFiles() int64

func (*Metrics) GetInputGit

func (x *Metrics) GetInputGit() int64

func (*Metrics) GetInputGroup

func (x *Metrics) GetInputGroup() int64

func (*Metrics) GetInputJoin

func (x *Metrics) GetInputJoin() int64

func (*Metrics) GetInputJoinOn

func (x *Metrics) GetInputJoinOn() int64

func (*Metrics) GetInputLazy

func (x *Metrics) GetInputLazy() int64

func (*Metrics) GetInputOuterJoin

func (x *Metrics) GetInputOuterJoin() int64

func (*Metrics) GetInputPfs

func (x *Metrics) GetInputPfs() int64

func (*Metrics) GetInputS3

func (x *Metrics) GetInputS3() int64

func (*Metrics) GetInputTrigger

func (x *Metrics) GetInputTrigger() int64

func (*Metrics) GetInputUnion

func (x *Metrics) GetInputUnion() int64

func (*Metrics) GetJobs

func (x *Metrics) GetJobs() int64

func (*Metrics) GetMaxBranches

func (x *Metrics) GetMaxBranches() uint64

func (*Metrics) GetMaxParallelism

func (x *Metrics) GetMaxParallelism() uint64

func (*Metrics) GetMinParallelism

func (x *Metrics) GetMinParallelism() uint64

func (*Metrics) GetNodes

func (x *Metrics) GetNodes() int64

func (*Metrics) GetNumParallelism

func (x *Metrics) GetNumParallelism() uint64

func (*Metrics) GetPipelineWithAlerts added in v2.9.0

func (x *Metrics) GetPipelineWithAlerts() bool

func (*Metrics) GetPipelines

func (x *Metrics) GetPipelines() int64

func (*Metrics) GetPodId added in v2.7.0

func (x *Metrics) GetPodId() string

func (*Metrics) GetPpsSpout

func (x *Metrics) GetPpsSpout() int64

func (*Metrics) GetPpsSpoutService

func (x *Metrics) GetPpsSpoutService() int64

func (*Metrics) GetRepos

func (x *Metrics) GetRepos() int64

func (*Metrics) GetResourceCpuLimit

func (x *Metrics) GetResourceCpuLimit() float32

func (*Metrics) GetResourceCpuLimitMax

func (x *Metrics) GetResourceCpuLimitMax() float32

func (*Metrics) GetResourceCpuReq

func (x *Metrics) GetResourceCpuReq() float32

func (*Metrics) GetResourceCpuReqMax

func (x *Metrics) GetResourceCpuReqMax() float32

func (*Metrics) GetResourceDiskLimit

func (x *Metrics) GetResourceDiskLimit() string

func (*Metrics) GetResourceDiskReq

func (x *Metrics) GetResourceDiskReq() string

func (*Metrics) GetResourceGpuLimit

func (x *Metrics) GetResourceGpuLimit() int64

func (*Metrics) GetResourceGpuLimitMax

func (x *Metrics) GetResourceGpuLimitMax() int64

func (*Metrics) GetResourceGpuReq

func (x *Metrics) GetResourceGpuReq() int64

func (*Metrics) GetResourceGpuReqMax

func (x *Metrics) GetResourceGpuReqMax() int64

func (*Metrics) GetResourceMemLimit

func (x *Metrics) GetResourceMemLimit() string

func (*Metrics) GetResourceMemReq

func (x *Metrics) GetResourceMemReq() string

func (*Metrics) GetVersion

func (x *Metrics) GetVersion() string

func (*Metrics) MarshalLogObject

func (x *Metrics) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*Metrics) ProtoMessage

func (*Metrics) ProtoMessage()

func (*Metrics) ProtoReflect added in v2.7.0

func (x *Metrics) ProtoReflect() protoreflect.Message

func (*Metrics) Reset

func (x *Metrics) Reset()

func (*Metrics) String

func (x *Metrics) String() string

func (*Metrics) Validate added in v2.8.0

func (m *Metrics) Validate() error

Validate checks the field values on Metrics with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Metrics) ValidateAll added in v2.8.0

func (m *Metrics) ValidateAll() error

ValidateAll checks the field values on Metrics with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in MetricsMultiError, or nil if none found.

type MetricsMultiError added in v2.8.0

type MetricsMultiError []error

MetricsMultiError is an error wrapping multiple validation errors returned by Metrics.ValidateAll() if the designated constraints aren't met.

func (MetricsMultiError) AllErrors added in v2.8.0

func (m MetricsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MetricsMultiError) Error added in v2.8.0

func (m MetricsMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type MetricsValidationError added in v2.8.0

type MetricsValidationError struct {
	// contains filtered or unexported fields
}

MetricsValidationError is the validation error returned by Metrics.Validate if the designated constraints aren't met.

func (MetricsValidationError) Cause added in v2.8.0

func (e MetricsValidationError) Cause() error

Cause function returns cause value.

func (MetricsValidationError) Error added in v2.8.0

func (e MetricsValidationError) Error() string

Error satisfies the builtin error interface

func (MetricsValidationError) ErrorName added in v2.8.0

func (e MetricsValidationError) ErrorName() string

ErrorName returns error name.

func (MetricsValidationError) Field added in v2.8.0

func (e MetricsValidationError) Field() string

Field function returns field value.

func (MetricsValidationError) Key added in v2.8.0

func (e MetricsValidationError) Key() bool

Key function returns key value.

func (MetricsValidationError) Reason added in v2.8.0

func (e MetricsValidationError) Reason() string

Reason function returns reason value.

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

Reporter is used to submit user & cluster metrics to segment

func NewReporter

func NewReporter(env serviceenv.ServiceEnv) *Reporter

NewReporter creates a new reporter and kicks off the loop to report cluster metrics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL