Documentation ¶
Overview ¶
Copyright 2018 StreamSets Inc. 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 StreamSets Inc. 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.
Index ¶
- Constants
- func CastToFloat64(value interface{}) interface{}
- func CloseFile(file *os.File)
- func Contains(slice []string, e string) bool
- func ConvertNanoToSecondsFloat(nano float64) float64
- func ConvertNanoToSecondsInt(nano int64) int64
- func ConvertTimeToLong(t time.Time) int64
- func CreateCounter(registry metrics.Registry, name string) metrics.Counter
- func CreateHistogram5Min(registry metrics.Registry, name string) metrics.Histogram
- func CreateMeter(registry metrics.Registry, name string) metrics.Meter
- func CreateTimer(registry metrics.Registry, name string) metrics.Timer
- func GetLastFieldNameFromPath(path string) string
- func IndexOf(word string, data []string) int
- func IsStringEmpty(str *string) bool
- func LcFirst(str string) string
- func RandString(n int) string
- func TruncateString(str string, num int) string
- func UcFirst(str string) string
- type LevelFilter
- type LogLevel
- type MetricsJson
Constants ¶
const ( COUNTER_SUFFIX = ".counter" METER_SUFFIX = ".meter" HISTOGRAM_M5_SUFFIX = ".histogramM5" TIMER_SUFFIX = ".timer" GAUGE_SUFFIX = ".gauge" )
Variables ¶
This section is empty.
Functions ¶
func CastToFloat64 ¶
func CastToFloat64(value interface{}) interface{}
func ConvertNanoToSecondsInt ¶
func ConvertTimeToLong ¶
func CreateCounter ¶
func CreateCounter(registry metrics.Registry, name string) metrics.Counter
func CreateHistogram5Min ¶
func CreateHistogram5Min(registry metrics.Registry, name string) metrics.Histogram
func CreateMeter ¶
func CreateMeter(registry metrics.Registry, name string) metrics.Meter
func CreateTimer ¶
func CreateTimer(registry metrics.Registry, name string) metrics.Timer
func IsStringEmpty ¶
func RandString ¶
func TruncateString ¶
Types ¶
type LevelFilter ¶
type LevelFilter struct { // Levels is the list of log levels, in increasing order of // severity. Example might be: {"DEBUG", "WARN", "ERROR"}. Levels []LogLevel // MinLevel is the minimum level allowed through MinLevel LogLevel // The underlying io.Writer where log messages that pass the filter // will be set. Writer io.Writer // contains filtered or unexported fields }
LevelFilter is an io.Writer that can be used with a logger that will filter out log messages that aren't at least a certain level.
Once the filter is in use somewhere, it is not safe to modify the structure.
func (*LevelFilter) Check ¶
func (f *LevelFilter) Check(line []byte) bool
Check will check a given line if it would be included in the level filter.
func (*LevelFilter) SetMinLevel ¶
func (f *LevelFilter) SetMinLevel(min LogLevel)
SetMinLevel is used to update the minimum log level
type MetricsJson ¶
type MetricsJson struct { Version string `json:"version"` Gauges map[string]map[string]interface{} `json:"gauges"` Counters map[string]map[string]interface{} `json:"counters"` Histograms map[string]map[string]interface{} `json:"histograms"` Meters map[string]map[string]interface{} `json:"meters"` Timers map[string]map[string]interface{} `json:"timers"` }
func FormatMetricsRegistry ¶
func FormatMetricsRegistry(r metrics.Registry) MetricsJson