http

package
v0.0.0-...-ec5001f Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregation

type Aggregation struct {
	Types          []AggregationType `json:"types,omitempty"`
	Type           AggregationType   `json:"type,omitempty"`
	Period         Period            `json:"period,omitempty"`
	Interpolate    InterpolationType `json:"interpolate,omitempty"`
	Threshold      *Threshold        `json:"threshold,omitempty"`
	Calendar       *Calendar         `json:"calendar,omitempty"`
	WorkingMinutes *WorkingMinutes   `json:"workingMinutes,omitempty"`
	Counter        bool              `json:"counter,omitempty"`
	Order          uint              `json:"order,omitempty"`
}

type AggregationType

type AggregationType string
const (
	AgDetail            AggregationType = "DETAIL"
	AgCount             AggregationType = "COUNT"
	AgMin               AggregationType = "MIN"
	AgMax               AggregationType = "MAX"
	AgAvg               AggregationType = "AVG"
	AgSum               AggregationType = "SUM"
	AgPercentile999     AggregationType = "PERCENTILE_999"
	AgPercentile995     AggregationType = "PERCENTILE_995"
	AgPercentile99      AggregationType = "PERCENTILE_99"
	AgPercentile95      AggregationType = "PERCENTILE_95"
	AgPercentile90      AggregationType = "PERCENTILE_90"
	AgPercentile75      AggregationType = "PERCENTILE_75"
	AgPercentile50      AggregationType = "PERCENTILE_50"
	AgMedian            AggregationType = "MEDIAN"
	AgStandardDeviation AggregationType = "STANDARD_DEVIATION"
	AgFirst             AggregationType = "FIRST"
	AgLast              AggregationType = "LAST"
	AgDelta             AggregationType = "DELTA"
	AgWavg              AggregationType = "WAVG"
	AgWtavg             AggregationType = "WTAVG"
	AgThresholdCount    AggregationType = "THRESHOLD_COUNT"
	AgThresholdDuration AggregationType = "THRESHOLD_DURATION"
	AgThreshold_Percent AggregationType = "THRESHOLD_PERCENT"
	AgMinValueTime      AggregationType = "MIN_VALUE_TIME"
	AgMaxValueTime      AggregationType = "MAX_VALUE_TIME"
)

type Calendar

type Calendar struct {
	Name string `json:"name"`
}

type Client

type Client struct {
	Series       *seriesApi
	Properties   *propertiesApi
	Entities     *entitiesApi
	EntityGroups *entityGroupsApi
	Messages     *messagesApi

	Metric *metricApi

	SQL *sqlApi
	// contains filtered or unexported fields
}

func New

func New(mUrl url.URL, username, password string) *Client

func (*Client) Url

func (self *Client) Url() url.URL

type DataType

type DataType int
const (
	SHORT DataType = iota
	INTEGER
	LONG
	FLOAT
	DOUBLE
)

func (DataType) String

func (self DataType) String() string

type Days

type Days uint

type Entity

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

func NewEntity

func NewEntity(name string) *Entity

func (*Entity) Enabled

func (self *Entity) Enabled() *bool

func (*Entity) LastIsertTime

func (self *Entity) LastIsertTime() *time.Time

func (*Entity) Name

func (self *Entity) Name() string

func (*Entity) SetEnabled

func (self *Entity) SetEnabled(isEnabled bool) *Entity

func (*Entity) SetTag

func (self *Entity) SetTag(key, val string) *Entity

func (*Entity) Tags

func (self *Entity) Tags() map[string]string

func (*Entity) UnmarshalJSON

func (self *Entity) UnmarshalJSON(data []byte) error

type EntityGroup

type EntityGroup struct {
	Name       string            `json:"name"`
	Expression string            `json:"expression"`
	Tags       map[string]string `json:"tags"`
}

type ForecastMeta

type ForecastMeta struct {
	Timestamp         net.Millis    `json:"timestamp"`
	AveragingInterval time.Duration `json:"averagingInterval"`
	Alpha             float64       `json:"alpha"`
	Beta              float64       `json:"beta"`
	Gamma             float64       `json:"gamma"`
	Period            string        `json:"period"`
	// contains filtered or unexported fields
}

type Group

type Group struct {
	Type        GroupType         `json:"type"`
	Interpolate InterpolationType `json:"interpolate,omitempty"`
	Truncate    bool              `json:"truncate,omitempty"`
	Period      *Period           `json:"period,omitempty"`
	Order       uint              `json:"order,omitempty"`
}

type GroupType

type GroupType string
const (
	StatCount             GroupType = "COUNT"
	StatMin               GroupType = "MIN"
	StatMax               GroupType = "MAX"
	StatAvg               GroupType = "AVG"
	StatSum               GroupType = "SUM"
	StatPercentile999     GroupType = "PERCENTILE_999"
	StatPercentile995     GroupType = "PERCENTILE_995"
	StatPercentile99      GroupType = "PERCENTILE_99"
	StatPercentile95      GroupType = "PERCENTILE_95"
	StatPercentile90      GroupType = "PERCENTILE_90"
	StatPercentile75      GroupType = "PERCENTILE_75"
	StatPercentile50      GroupType = "PERCENTILE_50"
	StatMedian            GroupType = "MEDIAN"
	StatStandardDeviation GroupType = "STANDARD_DEVIATION"
	StatMinValueTime      GroupType = "MIN_VALUE_TIME"
	StatMaxValueTime      GroupType = "MAX_VALUE_TIME"
)

type InterpolationType

type InterpolationType string
const (
	None   InterpolationType = "NONE"
	Step   InterpolationType = "STEP"
	Linear InterpolationType = "LINEAR"
)

type InvalidAction

type InvalidAction int
const (
	NONE InvalidAction = iota
	DISCARD
	TRANSFORM
	RAISE_ERROR
)

func (InvalidAction) String

func (self InvalidAction) String() string

type Message

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

func NewMessage

func NewMessage(entity string) *Message

func (*Message) Entity

func (self *Message) Entity() string

func (*Message) MarshalJSON

func (self *Message) MarshalJSON() ([]byte, error)

func (*Message) Message

func (self *Message) Message() string

func (*Message) SetEntity

func (self *Message) SetEntity(entity string) *Message

func (*Message) SetMessage

func (self *Message) SetMessage(message string) *Message

func (*Message) SetSeverity

func (self *Message) SetSeverity(severity Severity) *Message

func (*Message) SetSource

func (self *Message) SetSource(source string) *Message

func (*Message) SetTag

func (self *Message) SetTag(name, value string) *Message

func (*Message) SetTimestamp

func (self *Message) SetTimestamp(timestamp net.Millis) *Message

func (*Message) SetType

func (self *Message) SetType(mType string) *Message

func (*Message) Severity

func (self *Message) Severity() *Severity

func (*Message) Source

func (self *Message) Source() *string

func (*Message) String

func (self *Message) String() string

func (*Message) TagValue

func (self *Message) TagValue(name string) (string, bool)

func (*Message) Timestamp

func (self *Message) Timestamp() *net.Millis

func (*Message) Type

func (self *Message) Type() *string

func (*Message) UnmarshalJSON

func (self *Message) UnmarshalJSON(data []byte) error

type MessagesQuery

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

func NewMessagesQuery

func NewMessagesQuery(entity string) *MessagesQuery

func (*MessagesQuery) EndDateTime

func (self *MessagesQuery) EndDateTime() *time.Time

func (*MessagesQuery) Entity

func (self *MessagesQuery) Entity() string

func (*MessagesQuery) Limit

func (self *MessagesQuery) Limit() *uint64

func (*MessagesQuery) MarshalJSON

func (self *MessagesQuery) MarshalJSON() ([]byte, error)

func (*MessagesQuery) SetEndDateTime

func (self *MessagesQuery) SetEndDateTime(endDateTime time.Time) *MessagesQuery

func (*MessagesQuery) SetEntity

func (self *MessagesQuery) SetEntity(entity string) *MessagesQuery

func (*MessagesQuery) SetLimit

func (self *MessagesQuery) SetLimit(limit uint64) *MessagesQuery

func (*MessagesQuery) SetSeverity

func (self *MessagesQuery) SetSeverity(severity Severity) *MessagesQuery

func (*MessagesQuery) SetSource

func (self *MessagesQuery) SetSource(source string) *MessagesQuery

func (*MessagesQuery) SetStartDateTime

func (self *MessagesQuery) SetStartDateTime(startDateTime time.Time) *MessagesQuery

func (*MessagesQuery) SetTag

func (self *MessagesQuery) SetTag(name string, values []string) *MessagesQuery

func (*MessagesQuery) SetType

func (self *MessagesQuery) SetType(mType string) *MessagesQuery

func (*MessagesQuery) Severity

func (self *MessagesQuery) Severity() *Severity

func (*MessagesQuery) Source

func (self *MessagesQuery) Source() *string

func (*MessagesQuery) StartDateTime

func (self *MessagesQuery) StartDateTime() *time.Time

func (*MessagesQuery) String

func (self *MessagesQuery) String() string

func (*MessagesQuery) TagValue

func (self *MessagesQuery) TagValue(name string) ([]string, bool)

func (*MessagesQuery) Type

func (self *MessagesQuery) Type() *string

type Metric

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

func NewMetric

func NewMetric(name string) *Metric

func (*Metric) Counter

func (self *Metric) Counter() bool

func (*Metric) DataType

func (self *Metric) DataType() DataType

func (*Metric) Description

func (self *Metric) Description() *string

func (*Metric) Enabled

func (self *Metric) Enabled() bool

func (*Metric) Filter

func (self *Metric) Filter() *string

func (*Metric) GetLastInsertTime

func (self *Metric) GetLastInsertTime() *time.Time

func (*Metric) InvalidAction

func (self *Metric) InvalidAction() InvalidAction

func (*Metric) Label

func (self *Metric) Label() *string

func (*Metric) MarshalJSON

func (self *Metric) MarshalJSON() ([]byte, error)

func (*Metric) MaxValue

func (self *Metric) MaxValue() *net.Number

func (*Metric) MinValue

func (self *Metric) MinValue() *net.Number

func (*Metric) Name

func (self *Metric) Name() string

func (*Metric) Persistent

func (self *Metric) Persistent() bool

func (*Metric) RetentionInterval

func (self *Metric) RetentionInterval() Days

func (*Metric) SetCounter

func (self *Metric) SetCounter(isCounter bool) *Metric

func (*Metric) SetDataType

func (self *Metric) SetDataType(dataType DataType) *Metric

func (*Metric) SetDescription

func (self *Metric) SetDescription(description string) *Metric

func (*Metric) SetEnabled

func (self *Metric) SetEnabled(isEnabled bool) *Metric

func (*Metric) SetFilter

func (self *Metric) SetFilter(filter string) *Metric

func (*Metric) SetInvalidAction

func (self *Metric) SetInvalidAction(invalidAction InvalidAction) *Metric

func (*Metric) SetLabel

func (self *Metric) SetLabel(label string) *Metric

func (*Metric) SetMaxValue

func (self *Metric) SetMaxValue(maxValue net.Number) *Metric

func (*Metric) SetMinValue

func (self *Metric) SetMinValue(minValue net.Number) *Metric

func (*Metric) SetName

func (self *Metric) SetName(name string) *Metric

func (*Metric) SetPersistent

func (self *Metric) SetPersistent(isPersistent bool) *Metric

func (*Metric) SetRetentionInterval

func (self *Metric) SetRetentionInterval(retentionInterval Days) *Metric

func (*Metric) SetTag

func (self *Metric) SetTag(name, value string) *Metric

func (*Metric) SetTimePrecision

func (self *Metric) SetTimePrecision(timePrecision TimePrecision) *Metric

func (*Metric) TagValue

func (self *Metric) TagValue(name string) (string, bool)

func (*Metric) TimePrecision

func (self *Metric) TimePrecision() TimePrecision

type Period

type Period struct {
	Count uint `json:"count"`
	Unit  Unit `json:"unit"`
}

type Property

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

func NewProperty

func NewProperty(propType, entity string) *Property

func (*Property) Entity

func (self *Property) Entity() string

func (*Property) Key

func (self *Property) Key() map[string]string

func (*Property) MarshalJSON

func (self *Property) MarshalJSON() ([]byte, error)

func (*Property) PropType

func (self *Property) PropType() string

func (*Property) SetAllTags

func (self *Property) SetAllTags(tags map[string]string) *Property

func (*Property) SetKey

func (self *Property) SetKey(key map[string]string) *Property

func (*Property) SetKeyPart

func (self *Property) SetKeyPart(name, value string) *Property

func (*Property) SetTag

func (self *Property) SetTag(name, value string) *Property

func (*Property) SetTimestamp

func (self *Property) SetTimestamp(timestamp net.Millis) *Property

func (*Property) String

func (self *Property) String() string

func (*Property) TagValue

func (self *Property) TagValue(name string) (string, bool)

func (*Property) Tags

func (self *Property) Tags() map[string]string

func (*Property) Timestamp

func (self *Property) Timestamp() *net.Millis

type Rate

type Rate struct {
	Period  *Period `json:"period,omitempty"`
	Counter bool    `json:"counter"`
}

type Sample

type Sample struct {
	T net.Millis `json:"t"`
	V net.Number `json:"v"`
}

func (*Sample) UnmarshalJSON

func (self *Sample) UnmarshalJSON(data []byte) error

type Series

type Series struct {
	Entity  string            `json:"entity"`
	Metric  string            `json:"metric"`
	Tags    map[string]string `json:"tags,omitempty"`
	Warning string            `json:"warning,omitempty"`
	Data    []*Sample         `json:"data"`

	Type         SeriesType    `json:"type"`
	ForecastName string        `json:"forecastName,omitempty"`
	RequestId    string        `json:"requestId,omitempty"`
	Meta         *ForecastMeta `json:"meta,omitempty"`
	Aggregate    *Aggregation  `json:"aggregate,omitempty"`
}

type SeriesQuery

type SeriesQuery struct {
	StartTime    net.Millis          `json:"startTime,omitempty"`
	EndTime      net.Millis          `json:"endTime,omitempty"`
	StartDate    string              `json:"startDate,omitempty"`
	EndDate      string              `json:"endDate,omitempty"`
	Interval     string              `json:"interval,omitempty"`
	Limit        uint64              `json:"limit,omitempty"`
	Entity       string              `json:"entity"`
	Metric       string              `json:"metric"`
	Last         bool                `json:"last,omitempty"`
	Cache        bool                `json:"cache,omitempty"`
	Type         SeriesType          `json:"type,omitempty"`
	ForecastName string              `json:"forecastName,omitempty"`
	Group        *Group              `json:"group,omitempty"`
	Rate         *Rate               `json:"rate,omitempty"`
	Aggregate    *Aggregation        `json:"aggregate,omitempty"`
	RequestId    *string             `json:"requestId,omitempty"`
	Tags         map[string][]string `json:"tags,omitempty"`
}

type SeriesType

type SeriesType string
const (
	History           SeriesType = "HISTORY"
	Forecast          SeriesType = "FORECAST"
	ForecastDeviation SeriesType = "FORECAST_DEVIATION"
)

type Severity

type Severity string
const (
	UNDEFINED Severity = "UNDEFINED"
	UNKNOWN   Severity = "UNKNOWN"
	NORMAL    Severity = "NORMAL"
	WARNING   Severity = "WARNING"
	MINOR     Severity = "MINOR"
	MAJOR     Severity = "MAJOR"
	CRITICAL  Severity = "CRITICAL"
	FATAL     Severity = "FATAL"
)

type Table

type Table struct {
	Metadata interface{}     `json:"metadata"`
	Data     [][]interface{} `json:"data"`
}

type Threshold

type Threshold struct {
	Min *float64 `json:"min,omitempty"`
	Max *float64 `json:"max,omitempty"`
}

type TimePrecision

type TimePrecision int
const (
	SECONDS TimePrecision = iota
	MILLISECONDS
)

func (TimePrecision) String

func (self TimePrecision) String() string

type Unit

type Unit string
const (
	Millisecond Unit = "MILLISECOND"
	Second      Unit = "SECOND"
	Minute      Unit = "MINUTE"
	Hour        Unit = "HOUR"
	Day         Unit = "DAY"
	Week        Unit = "WEEK"
	Month       Unit = "MONTH"
	Quarter     Unit = "QUARTER"
	Year        Unit = "YEAR"
)

type WorkingMinutes

type WorkingMinutes struct {
	Start uint `json:"start"`
	End   uint `json:"end"`
}

Jump to

Keyboard shortcuts

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