Documentation ¶
Overview ¶
Copyright 2018 Iguazio Systems Ltd.
Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.
Copyright 2017 The Prometheus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 Iguazio Systems Ltd.
Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.
Copyright 2018 Iguazio Systems Ltd.
Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.
Index ¶
- Constants
- func AsInt64Array(val []byte) []uint64
- func Compare(a, b Labels) int
- func CreateContainer(logger logger.Logger, cfg *config.V3ioConfig, httpTimeout time.Duration) (v3io.Container, error)
- func CurrentTimeInMillis() int64
- func DeleteTable(logger logger.Logger, container v3io.Container, path, filter string, ...) error
- func Equal(ls, o Labels) bool
- func FloatToNormalizedScientificStr(val float64) string
- func GetTimeFromRange(from, to, last, step string) (f int64, t int64, s int64, err error)
- func IsDefined(value float64) bool
- func IsFalseConditionError(err error) bool
- func IsNotExistsError(err error) bool
- func IsNotExistsOrConflictError(err error) bool
- func IsUndefined(value float64) bool
- func IsValidLabelName(labelName string) error
- func IsValidMetricName(name string) error
- func NewLogger(level string) (logger.Logger, error)
- func Str2duration(duration string) (int64, error)
- func Str2unixTime(timeString string) (int64, error)
- type AsyncItemsCursor
- func (ic *AsyncItemsCursor) All() ([]v3io.Item, error)
- func (ic *AsyncItemsCursor) Err() error
- func (ic *AsyncItemsCursor) GetField(name string) interface{}
- func (ic *AsyncItemsCursor) GetFieldInt(name string) (int, error)
- func (ic *AsyncItemsCursor) GetFieldString(name string) (string, error)
- func (ic *AsyncItemsCursor) GetFields() map[string]interface{}
- func (ic *AsyncItemsCursor) GetItem() v3io.Item
- func (ic *AsyncItemsCursor) Next() bool
- func (ic *AsyncItemsCursor) NextItem() (v3io.Item, error)
- func (ic *AsyncItemsCursor) Release()
- type Builder
- type ItemsCursor
- type Label
- type Labels
- func (ls Labels) Copy() Labels
- func (ls Labels) Filter(keep []string) LabelsIfc
- func (ls Labels) Get(name string) string
- func (ls Labels) GetExpr() string
- func (ls Labels) GetKey() (string, string, uint64)
- func (ls Labels) Has(name string) bool
- func (ls Labels) Hash() uint64
- func (ls Labels) HashWithMetricName() (uint64, error)
- func (ls Labels) HashWithName() uint64
- func (ls Labels) LabelNames() []string
- func (ls Labels) Len() int
- func (ls Labels) Less(i, j int) bool
- func (ls Labels) Map() map[string]interface{}
- func (ls Labels) MarshalJSON() ([]byte, error)
- func (ls Labels) String() string
- func (ls Labels) Swap(i, j int)
- func (ls *Labels) UnmarshalJSON(b []byte) error
- type LabelsIfc
- type NullSeriesIterator
- type NullSeriesSet
- type Series
- type SeriesIterator
- type SeriesSet
Constants ¶
const ( MetricName = "__name__" AlertName = "alertname" BucketLabel = "le" InstanceName = "instance" )
Well-known label names used by Prometheus components.
const ( OneSecondMs = 1000 OneMinuteMs = 60 * 1000 OneHourMs = 3600 * 1000 OneDayMs = 24 * 3600 * 1000 )
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare compares the two label sets. The result will be 0 if a==b, <0 if a < b, and >0 if a > b.
func CreateContainer ¶
func CurrentTimeInMillis ¶ added in v0.0.12
func CurrentTimeInMillis() int64
func DeleteTable ¶
func FloatToNormalizedScientificStr ¶ added in v0.0.4
func GetTimeFromRange ¶
func IsFalseConditionError ¶ added in v0.9.14
Check if the current error was caused specifically because the condition was evaluated to false.
func IsNotExistsError ¶ added in v0.0.12
func IsNotExistsOrConflictError ¶ added in v0.9.17
func IsUndefined ¶ added in v0.0.4
func IsValidLabelName ¶ added in v0.0.5
func IsValidMetricName ¶ added in v0.0.5
func Str2duration ¶
Convert a "[0-9]+[mhd]" duration string (for example, "24h") to a Unix timestamp in milliseconds integer
func Str2unixTime ¶
Convert a time string to a Unix timestamp in milliseconds integer. The input time string can be of the format "now", "now-[0-9]+[mdh]" (for example, "now-2h"), "<Unix timestamp in milliseconds>", or "<RFC 3339 time>" (for example, "2018-09-26T14:10:20Z").
Types ¶
type AsyncItemsCursor ¶
type AsyncItemsCursor struct { Cnt int // contains filtered or unexported fields }
func NewAsyncItemsCursor ¶
func NewAsyncItemsCursorMultiplePartitions ¶ added in v0.9.21
func (*AsyncItemsCursor) All ¶
func (ic *AsyncItemsCursor) All() ([]v3io.Item, error)
gets all items
func (*AsyncItemsCursor) GetField ¶
func (ic *AsyncItemsCursor) GetField(name string) interface{}
func (*AsyncItemsCursor) GetFieldInt ¶
func (ic *AsyncItemsCursor) GetFieldInt(name string) (int, error)
func (*AsyncItemsCursor) GetFieldString ¶
func (ic *AsyncItemsCursor) GetFieldString(name string) (string, error)
func (*AsyncItemsCursor) GetFields ¶
func (ic *AsyncItemsCursor) GetFields() map[string]interface{}
func (*AsyncItemsCursor) GetItem ¶
func (ic *AsyncItemsCursor) GetItem() v3io.Item
func (*AsyncItemsCursor) Next ¶
func (ic *AsyncItemsCursor) Next() bool
Next gets the next matching item. this may potentially block as this lazy loads items from the collection
func (*AsyncItemsCursor) NextItem ¶
func (ic *AsyncItemsCursor) NextItem() (v3io.Item, error)
NextItem gets the next matching item. this may potentially block as this lazy loads items from the collection
func (*AsyncItemsCursor) Release ¶
func (ic *AsyncItemsCursor) Release()
Release releases a cursor and its underlying resources
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder allows modifiying Labels.
type ItemsCursor ¶
type Labels ¶
type Labels []Label
Labels is a sorted set of labels. Order has to be guaranteed upon instantiation.
func LabelsFromMap ¶ added in v0.0.13
LabelsFromMap returns new sorted Labels from the given map.
func LabelsFromString ¶ added in v0.8.3
func LabelsFromStringList ¶ added in v0.8.3
LabelsFromStringList creates new labels from pairs of strings.
func LabelsFromStringWithName ¶ added in v0.8.3
LabelsFromStringList creates new labels from a string in the following format key1=label1[,key2=label2,...]
func ToLabels ¶ added in v0.0.13
ToLabels returns a sorted Labels from the given labels. The caller has to guarantee that all label names are unique.
func (Labels) Get ¶
Get returns the value for the label with the given name. Returns an empty string if the label doesn't exist.
func (Labels) HashWithMetricName ¶ added in v0.8.2
Hash returns a hash value for the label set.
func (Labels) HashWithName ¶ added in v0.11.2
func (Labels) LabelNames ¶ added in v0.8.5
func (Labels) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Labels) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type NullSeriesIterator ¶ added in v0.8.3
type NullSeriesIterator struct {
// contains filtered or unexported fields
}
Null-series iterator
func (NullSeriesIterator) At ¶ added in v0.8.3
func (s NullSeriesIterator) At() (t int64, v float64)
func (NullSeriesIterator) AtString ¶ added in v0.8.4
func (s NullSeriesIterator) AtString() (t int64, v string)
func (NullSeriesIterator) Encoding ¶ added in v0.8.4
func (s NullSeriesIterator) Encoding() chunkenc.Encoding
func (NullSeriesIterator) Err ¶ added in v0.8.3
func (s NullSeriesIterator) Err() error
func (NullSeriesIterator) Next ¶ added in v0.8.3
func (s NullSeriesIterator) Next() bool
func (NullSeriesIterator) Seek ¶ added in v0.8.3
func (s NullSeriesIterator) Seek(t int64) bool
type NullSeriesSet ¶ added in v0.8.3
type NullSeriesSet struct {
// contains filtered or unexported fields
}
Null-series set
func (NullSeriesSet) At ¶ added in v0.8.3
func (s NullSeriesSet) At() Series
func (NullSeriesSet) Err ¶ added in v0.8.3
func (s NullSeriesSet) Err() error
func (NullSeriesSet) Next ¶ added in v0.8.3
func (s NullSeriesSet) Next() bool
type Series ¶ added in v0.8.3
type Series interface { // Labels returns the complete set of labels identifying the series. Labels() Labels // Iterator returns a new iterator of the data of the series. Iterator() SeriesIterator // Unique key for sorting GetKey() uint64 }
Series represents a single time series.
type SeriesIterator ¶ added in v0.8.3
type SeriesIterator interface { // Seek advances the iterator forward to the given timestamp. // If there's no value exactly at t, it advances to the first value after t. Seek(t int64) bool // At returns the current timestamp/value pair. At() (t int64, v float64) // At returns the current timestamp/String value pair. AtString() (t int64, v string) // Next advances the iterator by one. Next() bool // Err returns the current error. Err() error // Encoding returns the encoding of the data. according to the encoding you will call the appropriate At method Encoding() chunkenc.Encoding }
SeriesIterator iterates over the data of a time series.