Documentation
¶
Index ¶
- Variables
- func FinishReportAndFlushUserAction(action string, err error, start time.Time) func()
- func ReportUserAction(ctx context.Context, r *Reporter, action string) func(time.Time, error)
- func StartReportAndFlushUserAction(action string, value interface{}) func()
- type Metrics
- func (*Metrics) Descriptor() ([]byte, []int)deprecated
- func (x *Metrics) GetActivationCode() string
- func (x *Metrics) GetArchivedCommits() int64
- func (x *Metrics) GetBytes() uint64
- func (x *Metrics) GetCancelledCommits() int64
- func (x *Metrics) GetCfgEgress() int64
- func (x *Metrics) GetCfgErrcmd() int64
- func (x *Metrics) GetCfgS3Gateway() int64
- func (x *Metrics) GetCfgServices() int64
- func (x *Metrics) GetCfgStandby() int64
- func (x *Metrics) GetCfgTfjob() int64
- func (x *Metrics) GetClusterId() string
- func (x *Metrics) GetCommits() int64
- func (x *Metrics) GetEnterpriseFailures() int64
- func (x *Metrics) GetFiles() int64
- func (x *Metrics) GetInputCommit() int64
- func (x *Metrics) GetInputCron() int64
- func (x *Metrics) GetInputCross() int64
- func (x *Metrics) GetInputEmptyFiles() int64
- func (x *Metrics) GetInputGit() int64
- func (x *Metrics) GetInputGroup() int64
- func (x *Metrics) GetInputJoin() int64
- func (x *Metrics) GetInputJoinOn() int64
- func (x *Metrics) GetInputLazy() int64
- func (x *Metrics) GetInputOuterJoin() int64
- func (x *Metrics) GetInputPfs() int64
- func (x *Metrics) GetInputS3() int64
- func (x *Metrics) GetInputTrigger() int64
- func (x *Metrics) GetInputUnion() int64
- func (x *Metrics) GetJobs() int64
- func (x *Metrics) GetMaxBranches() uint64
- func (x *Metrics) GetMaxParallelism() uint64
- func (x *Metrics) GetMinParallelism() uint64
- func (x *Metrics) GetNodes() int64
- func (x *Metrics) GetNumParallelism() uint64
- func (x *Metrics) GetPipelineWithAlerts() bool
- func (x *Metrics) GetPipelines() int64
- func (x *Metrics) GetPodId() string
- func (x *Metrics) GetPpsSpout() int64
- func (x *Metrics) GetPpsSpoutService() int64
- func (x *Metrics) GetRepos() int64
- func (x *Metrics) GetResourceCpuLimit() float32
- func (x *Metrics) GetResourceCpuLimitMax() float32
- func (x *Metrics) GetResourceCpuReq() float32
- func (x *Metrics) GetResourceCpuReqMax() float32
- func (x *Metrics) GetResourceDiskLimit() string
- func (x *Metrics) GetResourceDiskReq() string
- func (x *Metrics) GetResourceGpuLimit() int64
- func (x *Metrics) GetResourceGpuLimitMax() int64
- func (x *Metrics) GetResourceGpuReq() int64
- func (x *Metrics) GetResourceGpuReqMax() int64
- func (x *Metrics) GetResourceMemLimit() string
- func (x *Metrics) GetResourceMemReq() string
- func (x *Metrics) GetVersion() string
- func (x *Metrics) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*Metrics) ProtoMessage()
- func (x *Metrics) ProtoReflect() protoreflect.Message
- func (x *Metrics) Reset()
- func (x *Metrics) String() string
- func (m *Metrics) Validate() error
- func (m *Metrics) ValidateAll() error
- type MetricsMultiError
- type MetricsValidationError
- type Reporter
Constants ¶
This section is empty.
Variables ¶
var File_internal_metrics_metrics_proto protoreflect.FileDescriptor
Functions ¶
func FinishReportAndFlushUserAction ¶
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 ¶
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) GetActivationCode ¶
func (*Metrics) GetArchivedCommits ¶
func (*Metrics) GetCancelledCommits ¶
func (*Metrics) GetCfgEgress ¶
func (*Metrics) GetCfgErrcmd ¶
func (*Metrics) GetCfgS3Gateway ¶
func (*Metrics) GetCfgServices ¶
func (*Metrics) GetCfgStandby ¶
func (*Metrics) GetCfgTfjob ¶
func (*Metrics) GetClusterId ¶ added in v2.7.0
func (*Metrics) GetCommits ¶
func (*Metrics) GetEnterpriseFailures ¶
func (*Metrics) GetInputCommit ¶
func (*Metrics) GetInputCron ¶
func (*Metrics) GetInputCross ¶
func (*Metrics) GetInputEmptyFiles ¶
func (*Metrics) GetInputGit ¶
func (*Metrics) GetInputGroup ¶
func (*Metrics) GetInputJoin ¶
func (*Metrics) GetInputJoinOn ¶
func (*Metrics) GetInputLazy ¶
func (*Metrics) GetInputOuterJoin ¶
func (*Metrics) GetInputPfs ¶
func (*Metrics) GetInputS3 ¶
func (*Metrics) GetInputTrigger ¶
func (*Metrics) GetInputUnion ¶
func (*Metrics) GetMaxBranches ¶
func (*Metrics) GetMaxParallelism ¶
func (*Metrics) GetMinParallelism ¶
func (*Metrics) GetNumParallelism ¶
func (*Metrics) GetPipelineWithAlerts ¶ added in v2.9.0
func (*Metrics) GetPipelines ¶
func (*Metrics) GetPpsSpout ¶
func (*Metrics) GetPpsSpoutService ¶
func (*Metrics) GetResourceCpuLimit ¶
func (*Metrics) GetResourceCpuLimitMax ¶
func (*Metrics) GetResourceCpuReq ¶
func (*Metrics) GetResourceCpuReqMax ¶
func (*Metrics) GetResourceDiskLimit ¶
func (*Metrics) GetResourceDiskReq ¶
func (*Metrics) GetResourceGpuLimit ¶
func (*Metrics) GetResourceGpuLimitMax ¶
func (*Metrics) GetResourceGpuReq ¶
func (*Metrics) GetResourceGpuReqMax ¶
func (*Metrics) GetResourceMemLimit ¶
func (*Metrics) GetResourceMemReq ¶
func (*Metrics) GetVersion ¶
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) Validate ¶ added in v2.8.0
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
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