Documentation ¶
Index ¶
- Constants
- Variables
- func JsonNumToFloat64(num json.Number) (val float64)
- func JsonNumToInt32(num json.Number) (val int32)
- func MetricsHandler(inner http.Handler, sbox string, svc string) http.Handler
- func ObserveNotification(sbox string, svc string, notif string, url string, resp *http.Response, ...)
- func StrToFloat64(str string) (val float64)
- func StrToInt32(str string) (val int32)
- type EventMetric
- type GisMetric
- type HttpMetric
- type Metric
- type MetricStore
- func (ms *MetricStore) Copy(src string, dst string) error
- func (ms *MetricStore) Flush()
- func (ms *MetricStore) FormatMetrics(h HttpMetric) (mermaidLogs string, sdorgLogs string)
- func (ms *MetricStore) GetCachedNetworkMetric(src string, dst string) (metric NetworkMetric, err error)
- func (ms *MetricStore) GetCachedNetworkMetrics(src string, dst string) (metric []NetworkMetric, err error)
- func (ms *MetricStore) GetEventMetric(eventType string, duration string, count int) (metrics []EventMetric, err error)
- func (ms *MetricStore) GetHttpMetric(loggerName string, msgType string, duration string, count int) (metrics []HttpMetric, err error)
- func (ms *MetricStore) GetInfluxMetric(metric string, tags map[string]string, fields []string, duration string, ...) (values []map[string]interface{}, err error)
- func (ms *MetricStore) GetNetworkMetric(src string, dst string, duration string, count int) (metrics []NetworkMetric, err error)
- func (ms *MetricStore) GetRedisMetric(metric string, tagStr string) (values []map[string]interface{}, err error)
- func (ms *MetricStore) GetSandboxMetric(typ string, duration string, count int) (metrics []SandboxMetric, err error)
- func (ms *MetricStore) GetSessionMetric(typ string, duration string, count int) (metrics []SessionMetric, err error)
- func (ms *MetricStore) SetCachedNetworkMetric(metric NetworkMetric) (err error)
- func (ms *MetricStore) SetEventMetric(eventType string, em EventMetric) error
- func (ms *MetricStore) SetHttpMetric(h HttpMetric) error
- func (ms *MetricStore) SetInfluxMetric(metricList []Metric) error
- func (ms *MetricStore) SetNetworkMetric(nm NetworkMetric) error
- func (ms *MetricStore) SetRedisMetric(metric string, tagStr string, fields map[string]interface{}) (err error)
- func (ms *MetricStore) SetSandboxMetric(typ string, sm SandboxMetric) error
- func (ms *MetricStore) SetSessionMetric(typ string, sm SessionMetric) error
- func (ms *MetricStore) SetStore(name string, namespace string, createDb bool) error
- func (ms *MetricStore) StartSnapshotThread() error
- func (ms *MetricStore) StopSnapshotThread()
- func (ms *MetricStore) TakeGisMetricSnapshot()
- type MetricsResponseWriter
- type NetworkMetric
- type SandboxMetric
- type SessionMetric
Constants ¶
View Source
const ( SesMetTypeLogin = "login" SesMetTypeLogout = "logout" SesMetTypeTimeout = "timeout" SesMetTypeError = "error" )
Session metric types
View Source
const ( SesMetErrTypeOauth = "oauth" SesMetErrTypeMaxSessions = "maxsessions" )
Session metric error types
View Source
const EvMetDescription = "description"
View Source
const EvMetDest = "dest"
View Source
const EvMetEvent = "event"
View Source
const EvMetName = "events"
View Source
const EvMetSrc = "src"
View Source
const EvMetTime = "time"
View Source
const EvMetType = "type"
View Source
const GisMetDest = "dest"
View Source
const GisMetDestType = "destType"
View Source
const GisMetDistance = "dist"
View Source
const GisMetMeasType = "measType"
View Source
const GisMetMeasTypeDistance = "distance"
View Source
const GisMetMeasTypeSignal = "signal"
View Source
const GisMetName = "meas"
View Source
const GisMetNameInflux = "gis"
View Source
const GisMetRsrp = "rsrp"
View Source
const GisMetRsrq = "rsrq"
View Source
const GisMetRssi = "rssi"
View Source
const GisMetSrc = "src"
View Source
const GisMetSrcType = "srcType"
View Source
const GisMetTime = "time"
View Source
const HttpBody = "body"
View Source
const HttpDst = "dst"
View Source
const HttpLogEndpoint = "endpoint"
View Source
const HttpLogId = "id"
View Source
const HttpLogMetricName = "http"
View Source
const HttpLogTime = "time"
View Source
const HttpLoggerDirection = "direction"
View Source
const HttpLoggerMsgType = "msg_type"
View Source
const HttpLoggerName = "logger_name"
View Source
const HttpMermaid = "mermaid"
View Source
const HttpMethod = "method"
View Source
const HttpMsgDirectionRx = "RX"
View Source
const HttpMsgDirectionTx = "TX"
View Source
const HttpMsgTypeNotification = "notification"
View Source
const HttpMsgTypeRequest = "request"
View Source
const HttpMsgTypeResponse = "response"
View Source
const HttpProcTime = "proc_time"
View Source
const HttpRespBody = "resp_body"
View Source
const HttpRespCode = "resp_code"
View Source
const HttpSdorg = "sdorg"
View Source
const HttpSrc = "src"
View Source
const HttpUrl = "url"
View Source
const MetricsDbDisabled = "disabled"
View Source
const NetMetDLPktLoss = "dlos"
View Source
const NetMetDLThroughput = "dl"
View Source
const NetMetDst = "dest"
View Source
const NetMetLatency = "lat"
View Source
const NetMetName = "network"
View Source
const NetMetSrc = "src"
View Source
const NetMetTime = "time"
View Source
const NetMetULPktLoss = "ulos"
View Source
const NetMetULThroughput = "ul"
View Source
const SboxMetCreateTime = "createtime"
View Source
const SboxMetName = "sbox"
View Source
const SboxMetSboxName = "sboxname"
View Source
const SboxMetTime = "time"
View Source
const SboxMetType = "type"
View Source
const (
SboxMetTypeCreate = "create"
)
Sandbox metric types
View Source
const SesMetDesc = "description"
View Source
const SesMetErrType = "errtype"
View Source
const SesMetName = "session"
View Source
const SesMetProvider = "provider"
View Source
const SesMetSbox = "sbox"
View Source
const SesMetSid = "sid"
View Source
const SesMetTime = "time"
View Source
const SesMetType = "type"
View Source
const SesMetUser = "userid"
Variables ¶
View Source
var MAX_LIMIT = 10000
Functions ¶
func JsonNumToFloat64 ¶
func JsonNumToInt32 ¶
func MetricsHandler ¶
MetricsHandler - REST API Metrics Handler
func ObserveNotification ¶
func StrToFloat64 ¶
func StrToInt32 ¶
Types ¶
type EventMetric ¶
type HttpMetric ¶
type MetricStore ¶
type MetricStore struct {
// contains filtered or unexported fields
}
MetricStore - Implements a metric store
func NewMetricStore ¶
func NewMetricStore(name string, namespace string, influxAddr string, redisAddr string) (ms *MetricStore, err error)
NewMetricStore - Creates and initialize a Metric Store instance
func (*MetricStore) FormatMetrics ¶
func (ms *MetricStore) FormatMetrics(h HttpMetric) (mermaidLogs string, sdorgLogs string)
func (*MetricStore) GetCachedNetworkMetric ¶
func (ms *MetricStore) GetCachedNetworkMetric(src string, dst string) (metric NetworkMetric, err error)
GetCachedNetworkMetric
func (*MetricStore) GetCachedNetworkMetrics ¶
func (ms *MetricStore) GetCachedNetworkMetrics(src string, dst string) (metric []NetworkMetric, err error)
GetCachedNetworkMetrics
func (*MetricStore) GetEventMetric ¶
func (ms *MetricStore) GetEventMetric(eventType string, duration string, count int) (metrics []EventMetric, err error)
GetEventMetric
func (*MetricStore) GetHttpMetric ¶
func (ms *MetricStore) GetHttpMetric(loggerName string, msgType string, duration string, count int) (metrics []HttpMetric, err error)
GetHttpMetric
func (*MetricStore) GetInfluxMetric ¶
func (ms *MetricStore) GetInfluxMetric(metric string, tags map[string]string, fields []string, duration string, limit int) (values []map[string]interface{}, err error)
GetInfluxMetric - Generic metric getter
func (*MetricStore) GetNetworkMetric ¶
func (ms *MetricStore) GetNetworkMetric(src string, dst string, duration string, count int) (metrics []NetworkMetric, err error)
GetNetworkMetric
func (*MetricStore) GetRedisMetric ¶
func (ms *MetricStore) GetRedisMetric(metric string, tagStr string) (values []map[string]interface{}, err error)
GetRedisMetric - Generic metric getter
func (*MetricStore) GetSandboxMetric ¶
func (ms *MetricStore) GetSandboxMetric(typ string, duration string, count int) (metrics []SandboxMetric, err error)
GetSandboxMetric
func (*MetricStore) GetSessionMetric ¶
func (ms *MetricStore) GetSessionMetric(typ string, duration string, count int) (metrics []SessionMetric, err error)
GetSessionMetric
func (*MetricStore) SetCachedNetworkMetric ¶
func (ms *MetricStore) SetCachedNetworkMetric(metric NetworkMetric) (err error)
SetCachedNetworkMetric
func (*MetricStore) SetEventMetric ¶
func (ms *MetricStore) SetEventMetric(eventType string, em EventMetric) error
SetEventMetric
func (*MetricStore) SetHttpMetric ¶
func (ms *MetricStore) SetHttpMetric(h HttpMetric) error
SetHttpMetric
func (*MetricStore) SetInfluxMetric ¶
func (ms *MetricStore) SetInfluxMetric(metricList []Metric) error
SetInfluxMetric - Generic metric setter
func (*MetricStore) SetNetworkMetric ¶
func (ms *MetricStore) SetNetworkMetric(nm NetworkMetric) error
SetNetworkMetric
func (*MetricStore) SetRedisMetric ¶
func (ms *MetricStore) SetRedisMetric(metric string, tagStr string, fields map[string]interface{}) (err error)
SetRedisMetric - Generic metric setter
func (*MetricStore) SetSandboxMetric ¶
func (ms *MetricStore) SetSandboxMetric(typ string, sm SandboxMetric) error
SetSandboxMetric
func (*MetricStore) SetSessionMetric ¶
func (ms *MetricStore) SetSessionMetric(typ string, sm SessionMetric) error
SetSessionMetric
func (*MetricStore) SetStore ¶
func (ms *MetricStore) SetStore(name string, namespace string, createDb bool) error
SetStore -
func (*MetricStore) StartSnapshotThread ¶
func (ms *MetricStore) StartSnapshotThread() error
func (*MetricStore) StopSnapshotThread ¶
func (ms *MetricStore) StopSnapshotThread()
func (*MetricStore) TakeGisMetricSnapshot ¶
func (ms *MetricStore) TakeGisMetricSnapshot()
func (gc *GisCache) getMetricsEntryHandler(key string, fields map[string]string, userData interface{}) error { // Retrieve field values values := make(map[string]interface{}) for k, v := range fields { values[k] = v } // Append values list to data data := userData.(*[]map[string]interface{}) *data = append(*data, values) return nil }
type MetricsResponseWriter ¶
type MetricsResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriter wrapper to capture status code
func NewMetricsResponseWriter ¶
func NewMetricsResponseWriter(w http.ResponseWriter) *MetricsResponseWriter
func (*MetricsResponseWriter) WriteHeader ¶
func (mrw *MetricsResponseWriter) WriteHeader(code int)
type NetworkMetric ¶
type SandboxMetric ¶
Click to show internal directories.
Click to hide internal directories.