Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ConsolidateAverage represents an average consolidation type. ConsolidateAverage // ConsolidateFirst represents a first value consolidation type. ConsolidateFirst // ConsolidateLast represents a last value consolidation type. ConsolidateLast // ConsolidateMax represents a maximal value consolidation type. ConsolidateMax // ConsolidateMin represents a minimal value consolidation type. ConsolidateMin // ConsolidateSum represents a sum consolidation type. ConsolidateSum )
View Source
const ( // OperatorNone represents a null operation type. OperatorNone = iota // OperatorAverage represents an average operation type. OperatorAverage // OperatorSum represents a sum operation type. OperatorSum )
View Source
const (
// DefaultSample represents the default sample value.
DefaultSample = 400
)
Variables ¶
View Source
var ( // ErrInvalidSample represents an invalid series sample value error. ErrInvalidSample = errors.New("invalid sample value") // ErrEmptySeries represents a empty series list error. ErrEmptySeries = errors.New("no series provided") // ErrUnnormalizedSeries represents an unnormalized series list error. ErrUnnormalizedSeries = errors.New("unnormalized series") )
Functions ¶
This section is empty.
Types ¶
type Point ¶
type Point struct { Time time.Time `json:"time"` Value Value `json:"value"` // contains filtered or unexported fields }
Point represents a time series point instance.
func (Point) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Point) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Request ¶
type Request struct { StartTime time.Time `json:"start_time,omitempty"` EndTime time.Time `json:"end_time,omitempty"` Time time.Time `json:"time,omitempty"` Range string `json:"range,omitempty"` Sample int `json:"sample"` ID string `json:"id"` Graph *storage.Graph `json:"graph"` Attributes maputil.Map `json:"attributes,omitempty"` Normalize bool `json:"normalize"` }
Request represents a point request instance.
type Response ¶
type Response struct { Start string `json:"start"` End string `json:"end"` Series []ResponseSeries `json:"series"` Options map[string]interface{} `json:"options"` }
Response represents a point response instance.
type ResponseSeries ¶
type ResponseSeries struct { Series Name string `json:"name"` Options map[string]interface{} `json:"options"` }
ResponseSeries represents a point response series instance.
type Series ¶
Series represents a time series instance.
func Normalize ¶
func Normalize(series []Series, startTime, endTime time.Time, sample int, consolidation int) ([]Series, error)
Normalize aligns multiple point series on a common time step, consolidates points samples if necessary.
func (*Series) Percentiles ¶
Percentiles calculates the percentile values for a time series.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.