Documentation ¶
Index ¶
- Variables
- func BackfillOption(count int) func(*Options)
- func DryRunOption(dryRun bool) func(*Options)
- type Alert
- type AlertObjective
- type AlertObjectiveConfig
- type Alerts
- type App
- type Config
- type Dashboard
- type Definition
- type DefinitionConfig
- func (c *DefinitionConfig) DurationCalculate() time.Duration
- func (c *DefinitionConfig) DurationTimeFrame() time.Duration
- func (c *DefinitionConfig) ErrorBudgetSizeParcentage() float64
- func (c *DefinitionConfig) MergeInto(o *DefinitionConfig)
- func (c *DefinitionConfig) Restrict() error
- func (c *DefinitionConfig) StartAt(now time.Time, backfill int) time.Time
- type DefinitionConfigs
- func (c DefinitionConfigs) MarshalYAML() (interface{}, error)
- func (c DefinitionConfigs) Restrict() error
- func (c DefinitionConfigs) StartAt(now time.Time, backfill int) time.Time
- func (c DefinitionConfigs) String() string
- func (c DefinitionConfigs) ToSlice() []*DefinitionConfig
- func (c *DefinitionConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Destination
- func (d *Destination) ErrorBudgetConsumptionMetricName() string
- func (d *Destination) ErrorBudgetConsumptionPercentageMetricName() string
- func (d *Destination) ErrorBudgetMetricName() string
- func (d *Destination) ErrorBudgetPercentageMetricName() string
- func (d *Destination) FailureMetricName() string
- func (d *Destination) UpTimeMetricName() string
- type DryRunMackerelClient
- func (c DryRunMackerelClient) CreateDashboard(param *mackerel.Dashboard) (*mackerel.Dashboard, error)
- func (c DryRunMackerelClient) PostServiceMetricValues(serviceName string, metricValues []*mackerel.MetricValue) error
- func (c DryRunMackerelClient) UpdateDashboard(dashboardID string, param *mackerel.Dashboard) (*mackerel.Dashboard, error)
- type ExprObjective
- type IsNoViolationCollection
- type MackerelClient
- type Metric
- func (m *Metric) AggregationInterval() time.Duration
- func (m *Metric) AppendValue(t time.Time, v interface{}) error
- func (m *Metric) EndAt() time.Time
- func (m *Metric) GetValue(t time.Time) (float64, bool)
- func (m *Metric) GetValues(startAt time.Time, endAt time.Time) map[time.Time]float64
- func (m *Metric) ID() string
- func (m *Metric) Reaggregation(aggregateInterval time.Duration) *Metric
- func (m *Metric) StartAt() time.Time
- func (m *Metric) String() string
- type MetricConfig
- type MetricConfigs
- type MetricType
- type Metrics
- func (ms Metrics) AggregationInterval() time.Duration
- func (ms Metrics) EndAt() time.Time
- func (ms Metrics) Get(id string) (*Metric, bool)
- func (ms Metrics) GetVariables(startAt time.Time, endAt time.Time) map[time.Time]evaluator.Variables
- func (ms Metrics) Set(m *Metric)
- func (ms Metrics) StartAt() time.Time
- func (ms Metrics) String() string
- func (ms Metrics) ToSlice() []*Metric
- type Monitor
- type ObjectiveConfig
- type Options
- type Reliability
- func (r *Reliability) Clone() *Reliability
- func (r *Reliability) CursorAt() time.Time
- func (r *Reliability) FailureTime() time.Duration
- func (r *Reliability) Merge(other *Reliability) (*Reliability, error)
- func (r *Reliability) TimeFrame() time.Duration
- func (r *Reliability) TimeFrameEndAt() time.Time
- func (r *Reliability) TimeFrameStartAt() time.Time
- func (r *Reliability) UpTime() time.Duration
- type ReliabilityCollection
- func (c ReliabilityCollection) CalcTime(cursor, n int) (upTime, failureTime, deltaFailureTime time.Duration)
- func (c ReliabilityCollection) Clone() ReliabilityCollection
- func (c ReliabilityCollection) CursorAt(i int) time.Time
- func (c ReliabilityCollection) Len() int
- func (c ReliabilityCollection) Less(i, j int) bool
- func (c ReliabilityCollection) Merge(other ReliabilityCollection) (ReliabilityCollection, error)
- func (c ReliabilityCollection) Swap(i, j int)
- func (c ReliabilityCollection) TimeFrame() time.Duration
- type Report
- type Repository
- func (repo *Repository) FetchAlerts(ctx context.Context, startAt time.Time, endAt time.Time) (Alerts, error)
- func (repo *Repository) FetchMetric(ctx context.Context, cfg *MetricConfig, startAt time.Time, endAt time.Time) (*Metric, error)
- func (repo *Repository) FetchMetrics(ctx context.Context, cfgs MetricConfigs, startAt time.Time, endAt time.Time) (Metrics, error)
- func (repo *Repository) FindDashboard(dashboardIDOrURL string) (*Dashboard, error)
- func (repo *Repository) FindDashboardID(dashboardIDOrURL string) (string, error)
- func (repo *Repository) FindMonitors() ([]*Monitor, error)
- func (repo *Repository) SaveDashboard(ctx context.Context, dashboard *Dashboard) error
- func (repo *Repository) SaveReports(ctx context.Context, reports []*Report) error
- func (repo *Repository) WithDryRun() *Repository
Constants ¶
This section is empty.
Variables ¶
var ErrDashboardNotFound = errors.New("dashboard not found")
Functions ¶
func BackfillOption ¶
BackfillOption specifies how many points of data to calculate retroactively from the current time.
func DryRunOption ¶
DryRunOption is an option to output the calculated error budget as standard without posting it to Mackerel.
Types ¶
type AlertObjective ¶ added in v0.6.0
type AlertObjective struct {
// contains filtered or unexported fields
}
func NewAlertObjective ¶ added in v0.6.0
func NewAlertObjective(cfg *AlertObjectiveConfig) *AlertObjective
func (AlertObjective) MatchMonitor ¶ added in v0.6.0
func (o AlertObjective) MatchMonitor(monitor *Monitor) bool
func (AlertObjective) NewReliabilityCollection ¶ added in v0.6.0
func (o AlertObjective) NewReliabilityCollection(timeFrame time.Duration, alerts Alerts, startAt, endAt time.Time) (ReliabilityCollection, error)
type AlertObjectiveConfig ¶ added in v0.6.0
type AlertObjectiveConfig struct { MonitorID string `json:"monitor_id,omitempty" yaml:"monitor_id,omitempty"` MonitorNamePrefix string `json:"monitor_name_prefix,omitempty" yaml:"monitor_name_prefix,omitempty"` MonitorNameSuffix string `json:"monitor_name_suffix,omitempty" yaml:"monitor_name_suffix,omitempty"` MonitorType string `json:"monitor_type,omitempty" yaml:"monitor_type,omitempty"` }
func (*AlertObjectiveConfig) Restrict ¶ added in v0.6.0
func (c *AlertObjectiveConfig) Restrict() error
Restrict restricts a configuration.
type App ¶
type App struct {
// contains filtered or unexported fields
}
App manages life cycle
func NewWithMackerelClient ¶
func NewWithMackerelClient(client MackerelClient, cfg *Config) (*App, error)
NewWithMackerelClient is there to accept mock clients.
func (*App) DashboardBuild ¶ added in v0.3.0
func (*App) DashboardInit ¶ added in v0.3.0
type Config ¶
type Config struct { RequiredVersion string `yaml:"required_version" json:"required_version"` Metrics MetricConfigs `yaml:"metrics" json:"metrics"` Definitions DefinitionConfigs `yaml:"definitions" json:"definitions"` //Common definition parameter TimeFrame string `yaml:"time_frame" json:"time_frame"` ServiceName string `json:"service_name" yaml:"service_name"` MetricPrefix string `json:"metric_prefix" yaml:"metric_prefix"` ErrorBudgetSize interface{} `yaml:"error_budget_size" json:"error_budget_size"` CalculateInterval string `yaml:"calculate_interval" json:"calculate_interval"` Dashboard string `json:"dashboard,omitempty" yaml:"dashboard,omitempty"` // contains filtered or unexported fields }
Config for App
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig creates a default configuration.
func (*Config) ValidateVersion ¶
ValidateVersion validates a version satisfies required_version.
type Definition ¶
type Definition struct {
// contains filtered or unexported fields
}
Definition is SLI/SLO Definition
func NewDefinition ¶
func NewDefinition(cfg *DefinitionConfig) (*Definition, error)
NewDefinition creates Definition from DefinitionConfig
func (*Definition) AlertObjectives ¶ added in v0.6.0
func (d *Definition) AlertObjectives(monitors []*Monitor) []*Monitor
func (*Definition) CreateReports ¶ added in v0.5.0
func (d *Definition) CreateReports(ctx context.Context, metrics Metrics, alerts Alerts, startAt, endAt time.Time) ([]*Report, error)
CreateReports returns Report with Metrics
func (*Definition) ExprObjectives ¶ added in v0.6.0
func (d *Definition) ExprObjectives() []string
type DefinitionConfig ¶
type DefinitionConfig struct { ID string `json:"id" yaml:"id"` TimeFrame string `yaml:"time_frame" json:"time_frame"` ServiceName string `json:"service_name" yaml:"service_name"` MetricPrefix string `json:"metric_prefix" yaml:"metric_prefix"` MetricSuffix string `json:"metric_suffix" yaml:"metric_suffix"` ErrorBudgetSize interface{} `yaml:"error_budget_size" json:"error_budget_size"` CalculateInterval string `yaml:"calculate_interval" json:"calculate_interval"` Objectives []*ObjectiveConfig `json:"objectives" yaml:"objectives"` // contains filtered or unexported fields }
DefinitionConfig is a setting related to SLI/SLO
func (*DefinitionConfig) DurationCalculate ¶
func (c *DefinitionConfig) DurationCalculate() time.Duration
DurationCalculate converts CalculateInterval as time.Duration
func (*DefinitionConfig) DurationTimeFrame ¶
func (c *DefinitionConfig) DurationTimeFrame() time.Duration
DurationTimeFrame converts TimeFrame as time.Duration
func (*DefinitionConfig) ErrorBudgetSizeParcentage ¶ added in v0.6.0
func (c *DefinitionConfig) ErrorBudgetSizeParcentage() float64
func (*DefinitionConfig) MergeInto ¶
func (c *DefinitionConfig) MergeInto(o *DefinitionConfig)
MergeInto merges DefinitionConfig together
func (*DefinitionConfig) Restrict ¶
func (c *DefinitionConfig) Restrict() error
Restrict restricts a definition configuration.
type DefinitionConfigs ¶
type DefinitionConfigs map[string]*DefinitionConfig
DefinitionConfigs is a collection of DefinitionConfigs that corrects the uniqueness of IDs.
func (DefinitionConfigs) MarshalYAML ¶
func (c DefinitionConfigs) MarshalYAML() (interface{}, error)
MarshalYAML implements yaml.Marshaller
func (DefinitionConfigs) Restrict ¶
func (c DefinitionConfigs) Restrict() error
Restrict restricts a definition configuration.
func (DefinitionConfigs) String ¶
func (c DefinitionConfigs) String() string
String implements fmt.Stringer
func (DefinitionConfigs) ToSlice ¶
func (c DefinitionConfigs) ToSlice() []*DefinitionConfig
func (*DefinitionConfigs) UnmarshalYAML ¶
func (c *DefinitionConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error
MarshalYAML implements yaml.Unmarshaler
type Destination ¶ added in v0.6.0
func (*Destination) ErrorBudgetConsumptionMetricName ¶ added in v0.6.0
func (d *Destination) ErrorBudgetConsumptionMetricName() string
func (*Destination) ErrorBudgetConsumptionPercentageMetricName ¶ added in v0.6.0
func (d *Destination) ErrorBudgetConsumptionPercentageMetricName() string
func (*Destination) ErrorBudgetMetricName ¶ added in v0.6.0
func (d *Destination) ErrorBudgetMetricName() string
func (*Destination) ErrorBudgetPercentageMetricName ¶ added in v0.6.0
func (d *Destination) ErrorBudgetPercentageMetricName() string
func (*Destination) FailureMetricName ¶ added in v0.6.0
func (d *Destination) FailureMetricName() string
func (*Destination) UpTimeMetricName ¶ added in v0.6.0
func (d *Destination) UpTimeMetricName() string
type DryRunMackerelClient ¶ added in v0.6.1
type DryRunMackerelClient struct {
MackerelClient
}
func (DryRunMackerelClient) CreateDashboard ¶ added in v0.6.1
func (DryRunMackerelClient) PostServiceMetricValues ¶ added in v0.6.1
func (c DryRunMackerelClient) PostServiceMetricValues(serviceName string, metricValues []*mackerel.MetricValue) error
func (DryRunMackerelClient) UpdateDashboard ¶ added in v0.6.1
type ExprObjective ¶ added in v0.6.0
type ExprObjective struct {
// contains filtered or unexported fields
}
func NewExprObjective ¶ added in v0.6.0
func NewExprObjective(expr evaluator.Comparator) *ExprObjective
func (*ExprObjective) NewReliabilityCollection ¶ added in v0.6.0
func (o *ExprObjective) NewReliabilityCollection(timeFrame time.Duration, metrics Metrics, startAt, endAt time.Time) (ReliabilityCollection, error)
func (*ExprObjective) String ¶ added in v0.6.0
func (o *ExprObjective) String() string
type IsNoViolationCollection ¶ added in v0.6.0
type MackerelClient ¶
type MackerelClient interface { FindHosts(param *mackerel.FindHostsParam) ([]*mackerel.Host, error) FetchHostMetricValues(hostID string, metricName string, from int64, to int64) ([]mackerel.MetricValue, error) FetchServiceMetricValues(serviceName string, metricName string, from int64, to int64) ([]mackerel.MetricValue, error) PostServiceMetricValues(serviceName string, metricValues []*mackerel.MetricValue) error FindDashboards() ([]*mackerel.Dashboard, error) FindDashboard(dashboardID string) (*mackerel.Dashboard, error) CreateDashboard(param *mackerel.Dashboard) (*mackerel.Dashboard, error) UpdateDashboard(dashboardID string, param *mackerel.Dashboard) (*mackerel.Dashboard, error) FindWithClosedAlerts() (*mackerel.AlertsResp, error) FindWithClosedAlertsByNextID(nextID string) (*mackerel.AlertsResp, error) GetMonitor(monitorID string) (mackerel.Monitor, error) FindMonitors() ([]mackerel.Monitor, error) }
MackerelClient is an abstraction interface for mackerel-client-go.Client
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
Metric handles aggregated Mackerel metrics
func NewMetric ¶
func NewMetric(cfg *MetricConfig) *Metric
func (*Metric) AggregationInterval ¶
AggregationInterval returns the aggregation interval for metrics
func (*Metric) AppendValue ¶
AppendValue adds a value to the metric
func (*Metric) Reaggregation ¶ added in v0.5.0
Reaggregation
type MetricConfig ¶
type MetricConfig struct { ID string `yaml:"id,omitempty" json:"id,omitempty"` Type MetricType `yaml:"type,omitempty" json:"type,omitempty"` Name string `yaml:"name,omitempty" json:"name,omitempty"` ServiceName string `yaml:"service_name,omitempty" json:"service_name,omitempty"` Roles []string `yaml:"roles,omitempty" json:"roles,omitempty"` HostName string `yaml:"host_name,omitempty" json:"host_name,omitempty"` AggregationInterval string `yaml:"aggregation_interval,omitempty" json:"aggregation_interval,omitempty"` AggregationMethod string `yaml:"aggregation_method,omitempty" json:"aggregation_method,omitempty"` InterpolatedValue *float64 `yaml:"interpolated_value,omitempty" json:"interpolated_value,omitempty"` // contains filtered or unexported fields }
MetricConfig handles metric information obtained from Mackerel
func (*MetricConfig) DurationAggregation ¶ added in v0.1.0
func (c *MetricConfig) DurationAggregation() time.Duration
DurationAggregation converts CalculateInterval as time.Duration
func (*MetricConfig) MergeInto ¶
func (c *MetricConfig) MergeInto(o *MetricConfig)
MergeInto merges MetricConfigs together
func (*MetricConfig) Restrict ¶
func (c *MetricConfig) Restrict() error
Restrict restricts a configuration.
type MetricConfigs ¶
type MetricConfigs map[string]*MetricConfig
MetricConfigs is a collection of MetricConfig
func (MetricConfigs) MarshalYAML ¶
func (c MetricConfigs) MarshalYAML() (interface{}, error)
MarshalYAML controls Yamlization
func (MetricConfigs) Restrict ¶
func (c MetricConfigs) Restrict() error
Restrict restricts a metric configuration.
func (MetricConfigs) ToSlice ¶
func (c MetricConfigs) ToSlice() []*MetricConfig
ToSlice converts the collection to Slice
func (*MetricConfigs) UnmarshalYAML ¶
func (c *MetricConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML merges duplicate ID MetricConfig
type MetricType ¶
type MetricType int
MetricType is the type of metric in Mackerel
const ( HostMetric MetricType = iota + 1 //host ServiceMetric //service )
Reserved value
func MetricTypeString ¶
func MetricTypeString(s string) (MetricType, error)
MetricTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func MetricTypeValues ¶
func MetricTypeValues() []MetricType
MetricTypeValues returns all values of the enum
func (MetricType) IsAMetricType ¶
func (i MetricType) IsAMetricType() bool
IsAMetricType returns "true" if the value is listed in the enum definition. "false" otherwise
func (MetricType) MarshalJSON ¶
func (i MetricType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for MetricType
func (MetricType) MarshalText ¶
func (i MetricType) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for MetricType
func (MetricType) String ¶
func (i MetricType) String() string
func (*MetricType) UnmarshalJSON ¶
func (i *MetricType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for MetricType
func (*MetricType) UnmarshalText ¶
func (i *MetricType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for MetricType
type Metrics ¶
Metrics is a collection of metrics
func (Metrics) AggregationInterval ¶
AggregationInterval returns the longest aggregation period for the metric in the collection
func (Metrics) GetVariables ¶ added in v0.5.0
func (ms Metrics) GetVariables(startAt time.Time, endAt time.Time) map[time.Time]evaluator.Variables
GetVariables gets the Variables for the specified time period
type ObjectiveConfig ¶
type ObjectiveConfig struct { Expr string `yaml:"expr" json:"expr"` Alert *AlertObjectiveConfig `yaml:"alert" json:"alert"` // contains filtered or unexported fields }
Objective Config is a SLO setting
func (*ObjectiveConfig) GetComparator ¶ added in v0.2.3
func (c *ObjectiveConfig) GetComparator() evaluator.Comparator
GetComparator returns a Comparator generated from ObjectiveConfig
func (*ObjectiveConfig) Restrict ¶
func (c *ObjectiveConfig) Restrict() error
Restrict restricts a configuration.
func (*ObjectiveConfig) Type ¶ added in v0.6.0
func (c *ObjectiveConfig) Type() string
Type returns objective type string
type Reliability ¶ added in v0.6.0
type Reliability struct {
// contains filtered or unexported fields
}
Reliability represents a group of values related to reliability per tumbling window.
func NewReliability ¶ added in v0.6.0
func NewReliability(cursorAt time.Time, timeFrame time.Duration, isNoViolation IsNoViolationCollection) *Reliability
func (*Reliability) Clone ¶ added in v0.6.0
func (r *Reliability) Clone() *Reliability
func (*Reliability) CursorAt ¶ added in v0.6.0
func (r *Reliability) CursorAt() time.Time
CursorAt is a representative value of the time shown by the tumbling window
func (*Reliability) FailureTime ¶ added in v0.6.0
func (r *Reliability) FailureTime() time.Duration
FailureTime is the time when reliability could not be ensured, i.e. SLO was violated
func (*Reliability) Merge ¶ added in v0.6.0
func (r *Reliability) Merge(other *Reliability) (*Reliability, error)
Merge must be the same tumbling window
func (*Reliability) TimeFrame ¶ added in v0.6.0
func (r *Reliability) TimeFrame() time.Duration
TimeFrame is the size of the tumbling window
func (*Reliability) TimeFrameEndAt ¶ added in v0.6.0
func (r *Reliability) TimeFrameEndAt() time.Time
TimeFrameEndAt is the end time of the tumbling window
func (*Reliability) TimeFrameStartAt ¶ added in v0.6.0
func (r *Reliability) TimeFrameStartAt() time.Time
TimeFrameStartAt is the start time of the tumbling window
func (*Reliability) UpTime ¶ added in v0.6.0
func (r *Reliability) UpTime() time.Duration
UpTime is the uptime that can guarantee reliability.
type ReliabilityCollection ¶ added in v0.6.0
type ReliabilityCollection []*Reliability
ReliabilityCollection is sortable
func NewReliabilityCollection ¶ added in v0.6.0
func NewReliabilityCollection(s []*Reliability) (ReliabilityCollection, error)
func (ReliabilityCollection) CalcTime ¶ added in v0.6.0
func (c ReliabilityCollection) CalcTime(cursor, n int) (upTime, failureTime, deltaFailureTime time.Duration)
func (ReliabilityCollection) Clone ¶ added in v0.6.0
func (c ReliabilityCollection) Clone() ReliabilityCollection
func (ReliabilityCollection) CursorAt ¶ added in v0.6.0
func (c ReliabilityCollection) CursorAt(i int) time.Time
CursorAt is a representative value of the time shown by the tumbling window
func (ReliabilityCollection) Len ¶ added in v0.6.0
func (c ReliabilityCollection) Len() int
func (ReliabilityCollection) Less ¶ added in v0.6.0
func (c ReliabilityCollection) Less(i, j int) bool
func (ReliabilityCollection) Merge ¶ added in v0.6.0
func (c ReliabilityCollection) Merge(other ReliabilityCollection) (ReliabilityCollection, error)
Merge two collection
func (ReliabilityCollection) Swap ¶ added in v0.6.0
func (c ReliabilityCollection) Swap(i, j int)
func (ReliabilityCollection) TimeFrame ¶ added in v0.6.0
func (c ReliabilityCollection) TimeFrame() time.Duration
TimeFrame is the size of the tumbling window
type Report ¶
type Report struct { DefinitionID string Destination *Destination DataPoint time.Time TimeFrameStartAt time.Time TimeFrameEndAt time.Time UpTime time.Duration FailureTime time.Duration ErrorBudgetSize time.Duration ErrorBudget time.Duration ErrorBudgetConsumption time.Duration }
Report has SLI/SLO/ErrorBudget numbers in one rolling window
func NewReports ¶ added in v0.6.0
func NewReports(definitionID string, destination *Destination, errorBudgetSize float64, timeFrame time.Duration, reliability ReliabilityCollection) []*Report
func (*Report) ErrorBudgetConsumptionRate ¶
ErrorBudgetConsumptionRate returns ErrorBudgetConsumption/ErrorBudgetSize
func (*Report) ErrorBudgetUsageRate ¶
ErrorBudgetUsageRate returns (1.0 - ErrorBudget/ErrorBudgetSize)
func (*Report) MarshalJSON ¶
MarshalJSON implements json.Marshaler
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository handles reading and writing data
func NewRepository ¶
func NewRepository(client MackerelClient) *Repository
NewRepository creates Repository
func (*Repository) FetchAlerts ¶ added in v0.6.0
func (repo *Repository) FetchAlerts(ctx context.Context, startAt time.Time, endAt time.Time) (Alerts, error)
FetchAlerts retrieves alerts for a specified period of time
func (*Repository) FetchMetric ¶
func (repo *Repository) FetchMetric(ctx context.Context, cfg *MetricConfig, startAt time.Time, endAt time.Time) (*Metric, error)
FetchMetric gets Metric using MetricConfig
func (*Repository) FetchMetrics ¶
func (repo *Repository) FetchMetrics(ctx context.Context, cfgs MetricConfigs, startAt time.Time, endAt time.Time) (Metrics, error)
FetchMetrics gets metrics togethers
func (*Repository) FindDashboard ¶ added in v0.3.0
func (repo *Repository) FindDashboard(dashboardIDOrURL string) (*Dashboard, error)
FindDashboard get Mackerel Dashboard
func (*Repository) FindDashboardID ¶ added in v0.3.0
func (repo *Repository) FindDashboardID(dashboardIDOrURL string) (string, error)
FindDashboardID get Mackerel Dashboard ID from url or id
func (*Repository) FindMonitors ¶ added in v0.6.0
func (repo *Repository) FindMonitors() ([]*Monitor, error)
func (*Repository) SaveDashboard ¶ added in v0.3.0
func (repo *Repository) SaveDashboard(ctx context.Context, dashboard *Dashboard) error
SaveDashboard post Mackerel Dashboard
func (*Repository) SaveReports ¶
func (repo *Repository) SaveReports(ctx context.Context, reports []*Report) error
SaveReports posts Reports to Mackerel
func (*Repository) WithDryRun ¶ added in v0.6.1
func (repo *Repository) WithDryRun() *Repository