Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteCanaryJob(id string)
- func ScanCanaryConfigs(_db *gorm.DB)
- func ScheduleFunc(schedule string, fn func()) (interface{}, error)
- func StartScanCanaryConfigs(ctx context.Context, dataFile string, configFiles []string)
- func StartUpstreamEventQueueConsumer(ctx context.Context) error
- func SyncCanaryJob(ctx context.Context, dbCanary pkg.Canary, options ...SyncCanaryJobOption) error
- func SyncCanaryJobs(ctx dutyjob.JobRuntime) error
- type CanaryJob
- type CanaryPullResponse
- type CanaryStatusPayload
- type RelatableCheck
- type SyncCanaryJobConfig
- type SyncCanaryJobOption
Constants ¶
View Source
const ( EventPushQueueCreate = "push_queue.create" ResourceTypeUpstream = "upstream" )
Variables ¶
View Source
var ( ReconcilePageSize int // Only sync data created/updated in the last ReconcileMaxAge duration ReconcileMaxAge time.Duration // UpstreamConf is the global configuration for upstream UpstreamConf upstream.UpstreamConfig )
View Source
var CanaryConfigFiles []string
View Source
var CanaryScheduler = cron.New()
View Source
var CanaryStatusChannel chan CanaryStatusPayload
View Source
var DataFile string
View Source
var Executor bool
View Source
var FuncScheduler = cron.New()
View Source
var Kommons *kommons.Client
View Source
var Kubernetes kubernetes.Interface
View Source
var LogPass, LogFail bool
View Source
var MinimumTimeBetweenCanaryRuns = 10 * time.Second
View Source
var PullUpstreamCanaries = job.Job{ Name: "PullUpstreamCanaries", JobHistory: true, Singleton: true, Schedule: "@every 10m", Retention: job.RetentionHour, Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = ResourceTypeUpstream ctx.History.ResourceID = UpstreamConf.Host count, err := pull(ctx.Context, UpstreamConf) ctx.History.SuccessCount = count return err }, }
View Source
var ReconcileChecks = job.Job{ Name: "PushChecksToUpstream", JobHistory: true, Singleton: true, Retention: job.RetentionDay, RunNow: true, Schedule: "@every 30m", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = ResourceTypeUpstream ctx.History.ResourceID = UpstreamConf.Host if count, err := upstream.NewUpstreamReconciler(UpstreamConf, ReconcilePageSize). Sync(ctx.Context, "canaries"); err != nil { ctx.History.AddError(err.Error()) } else { ctx.History.SuccessCount += count } if count, err := upstream.NewUpstreamReconciler(UpstreamConf, ReconcilePageSize). Sync(ctx.Context, "checks"); err != nil { ctx.History.AddError(err.Error()) } else { ctx.History.SuccessCount += count } return nil }, }
View Source
var SyncCheckStatuses = job.Job{ Name: "SyncCheckStatusesWithUpstream", JobHistory: true, Singleton: true, Retention: job.RetentionHour, RunNow: true, Schedule: "@every 30s", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = ResourceTypeUpstream ctx.History.ResourceID = UpstreamConf.Host err, count := upstream.SyncCheckStatuses(ctx.Context, UpstreamConf, ReconcilePageSize) ctx.History.SuccessCount = count return err }, }
View Source
var UpstreamJobs = []job.Job{ SyncCheckStatuses, PullUpstreamCanaries, ReconcileChecks, }
Functions ¶
func DeleteCanaryJob ¶
func DeleteCanaryJob(id string)
func ScanCanaryConfigs ¶
func ScheduleFunc ¶
func StartScanCanaryConfigs ¶
func StartUpstreamEventQueueConsumer ¶ added in v1.0.69
func SyncCanaryJob ¶
TODO: Refactor to use database object instead of kubernetes
func SyncCanaryJobs ¶
func SyncCanaryJobs(ctx dutyjob.JobRuntime) error
Types ¶
type CanaryJob ¶
func (CanaryJob) GetNamespacedName ¶
func (j CanaryJob) GetNamespacedName() types.NamespacedName
type CanaryPullResponse ¶ added in v1.0.36
type CanaryStatusPayload ¶ added in v0.38.213
type RelatableCheck ¶ added in v1.0.129
type RelatableCheck interface {
GetRelationship() *v1.CheckRelationship
}
type SyncCanaryJobConfig ¶ added in v1.0.125
type SyncCanaryJobOption ¶ added in v1.0.125
type SyncCanaryJobOption func(*SyncCanaryJobConfig)
func WithRunNow ¶ added in v1.0.125
func WithRunNow(value bool) SyncCanaryJobOption
func WithSchedule ¶ added in v1.0.125
func WithSchedule(schedule string) SyncCanaryJobOption
Click to show internal directories.
Click to hide internal directories.