Documentation
¶
Overview ¶
Package elastic provides an Elasticsearch client for bulk indexing.
Index ¶
- func IndexAll(ctx context.Context, client *Client, store *storage.Store, workflowID int64) error
- type BulkResult
- func IndexJobs(ctx context.Context, client *Client, store *storage.Store, workflowID int64) (*BulkResult, error)
- func IndexRuns(ctx context.Context, client *Client, store *storage.Store, workflowID int64) (*BulkResult, error)
- func IndexSteps(ctx context.Context, client *Client, store *storage.Store, workflowID int64) (*BulkResult, error)
- type Client
- type Document
- type Job
- type JobsResponse
- type RunDuration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BulkResult ¶
BulkResult contains statistics from a bulk indexing operation.
func IndexJobs ¶
func IndexJobs(ctx context.Context, client *Client, store *storage.Store, workflowID int64) (*BulkResult, error)
IndexJobs indexes workflow jobs into Elasticsearch.
func IndexRuns ¶
func IndexRuns(ctx context.Context, client *Client, store *storage.Store, workflowID int64) (*BulkResult, error)
IndexRuns indexes workflow runs into Elasticsearch.
func IndexSteps ¶
func IndexSteps(ctx context.Context, client *Client, store *storage.Store, workflowID int64) (*BulkResult, error)
IndexSteps indexes workflow steps into Elasticsearch.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an Elasticsearch client for bulk indexing operations.
type Job ¶
type Job struct {
ID int64 `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
StartedAt string `json:"started_at"`
CompletedAt string `json:"completed_at"`
}
Job represents a workflow job with timing information.
type JobsResponse ¶
JobsResponse represents the response from GitHub's jobs API.
type RunDuration ¶
type RunDuration struct {
JobsStartedAt string `json:"jobs_started_at"`
JobsStartedAtID int64 `json:"jobs_started_at_id"`
JobsStartedAtName string `json:"jobs_started_at_name"`
JobsStartedAtURL string `json:"jobs_started_at_url"`
JobsStartedAtHTMLURL string `json:"jobs_started_at_html_url"`
JobsCompletedAt string `json:"jobs_completed_at"`
JobsCompletedAtID int64 `json:"jobs_completed_at_id"`
JobsCompletedAtName string `json:"jobs_completed_at_name"`
JobsCompletedAtURL string `json:"jobs_completed_at_url"`
JobsCompletedAtHTMLURL string `json:"jobs_completed_at_html_url"`
}
RunDuration contains timing information about the first and last jobs in a run.
func ComputeRunDuration ¶
func ComputeRunDuration(jobs *JobsResponse) *RunDuration
ComputeRunDuration calculates the earliest start time and latest completion time across all jobs in a run. Returns nil if there are no jobs.