metrics

package
v1.0.6-1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DescProjectTopics     = "Counter that displays the number of topics belonging to the specific project"
	NameProjectTopics     = "project.number_of_topics"
	DescProjectSubs       = "Counter that displays the number of subscriptions belonging to the specific project"
	NameProjectSubs       = "project.number_of_subscriptions"
	NameDailyProjectMsgs  = "project.number_of_daily_messages"
	DescDailyProjectMsgs  = "A collection of counters that represents the total number of messages published each day to all of the project's topics"
	DescTopicSubs         = "Counter that displays the number of subscriptions belonging to a specific topic"
	NameTopicSubs         = "topic.number_of_subscriptions"
	DescTopicRate         = "A rate that displays how many messages were published per second between the last two publish events"
	NameTopicRate         = "topic.publishing_rate"
	DescSubRate           = "A rate that displays how many messages were consumed per second between the last two consume events"
	NameSubRate           = "subscription.consumption_rate"
	DescTopicMsgs         = "Counter that displays the number of messages published to the specific topic"
	NameTopicMsgs         = "topic.number_of_messages"
	DescDailyTopicMsgs    = "A collection of counters that represents the total number of messages published each day to a specific topic"
	NameDailyTopicMsgs    = "topic.number_of_daily_messages"
	DescTopicBytes        = "Counter that displays the total size of data (in bytes) published to the specific topic"
	NameTopicBytes        = "topic.number_of_bytes"
	DescProjectUserSubs   = "Counter that displays the number of subscriptions that a user has access to the specific project"
	NameProjectUserSubs   = "project.user.number_of_subscriptions"
	DescProjectUserTopics = "Counter that displays the number of topics that a user has access to the specific project"
	NameProjectUserTopics = "project.user.number_of_topics"
	DescSubMsgs           = "Counter that displays the number of messages consumed from the specific subscription"
	NameSubMsgs           = "subscription.number_of_messages"
	DescSubBytes          = "Counter that displays the total size of data (in bytes) consumed from the specific subscription"
	NameSubBytes          = "subscription.number_of_bytes"
	DescOpNodeCPU         = "Percentage value that displays the CPU usage of ams service in the specific node"
	NameOpNodeCPU         = "ams_node.cpu_usage"
	DescOpNodeMEM         = "Percentage value that displays the Memory usage of ams service in the specific node"
	NameOpNodeMEM         = "ams_node.memory_usage"
)

Metric names and descriptions

Variables

This section is empty.

Functions

func GetProjectSubs

func GetProjectSubs(projectUUID string, store stores.Store) (int64, error)

func GetProjectSubsACL

func GetProjectSubsACL(projectUUID string, username string, store stores.Store) (int64, error)

func GetProjectSubsByTopic

func GetProjectSubsByTopic(projectUUID string, topic string, store stores.Store) (int64, error)

func GetProjectTopics

func GetProjectTopics(projectUUID string, store stores.Store) (int64, error)

func GetProjectTopicsACL

func GetProjectTopicsACL(projectUUID string, username string, store stores.Store) (int64, error)

func GetTimeNowZulu

func GetTimeNowZulu() string

Types

type Metric

type Metric struct {
	Metric       string      `json:"metric"`
	MetricType   string      `json:"metric_type"`
	ValueType    string      `json:"value_type"`
	ResourceType string      `json:"resource_type"`
	Resource     string      `json:"resource_name"`
	Timeseries   []Timepoint `json:"timeseries"`
	Description  string      `json:"description"`
}

func NewDailyProjectMsgCount

func NewDailyProjectMsgCount(project string, timePoints []Timepoint) Metric

func NewDailyTopicMsgCount

func NewDailyTopicMsgCount(topic string, timePoints []Timepoint) Metric

func NewOpNodeCPU

func NewOpNodeCPU(hostname string, value float64, tstamp string) Metric

Initialize single point timeseries with the latest timestamp and value

func NewOpNodeMEM

func NewOpNodeMEM(hostname string, value float64, tstamp string) Metric

func NewProjectSubs

func NewProjectSubs(project string, value int64, tstamp string) Metric

func NewProjectTopics

func NewProjectTopics(project string, value int64, tstamp string) Metric

func NewProjectUserSubs

func NewProjectUserSubs(project string, user string, value int64, tstamp string) Metric

func NewProjectUserTopics

func NewProjectUserTopics(project string, user string, value int64, tstamp string) Metric

func NewSubBytes

func NewSubBytes(topic string, value int64, tstamp string) Metric

func NewSubMsgs

func NewSubMsgs(topic string, value int64, tstamp string) Metric

func NewSubRate

func NewSubRate(sub string, value float64, tstamp string) Metric

func NewTopicBytes

func NewTopicBytes(topic string, value int64, tstamp string) Metric

func NewTopicMsgs

func NewTopicMsgs(topic string, value int64, tstamp string) Metric

func NewTopicRate

func NewTopicRate(topic string, value float64, tstamp string) Metric

func NewTopicSubs

func NewTopicSubs(topic string, value int64, tstamp string) Metric

func (*Metric) ExportJSON

func (m *Metric) ExportJSON() (string, error)

ExportJSON exports whole ProjectTopic structure

type MetricList

type MetricList struct {
	Metrics []Metric `json:"metrics"`
}

func AggrProjectUserSubs

func AggrProjectUserSubs(projectUUID string, store stores.Store) (MetricList, error)

func AggrProjectUserTopics

func AggrProjectUserTopics(projectUUID string, store stores.Store) (MetricList, error)

func GetMetricsFromJSON

func GetMetricsFromJSON(input []byte) (MetricList, error)

GetUserFromJSON retrieves User info From JSON string

func GetUsageCpuMem

func GetUsageCpuMem(store stores.Store) (MetricList, error)

func NewMetricList

func NewMetricList(m Metric) MetricList

func (*MetricList) ExportJSON

func (ml *MetricList) ExportJSON() (string, error)

ExportJSON exports whole ProjectTopic structure

type Timepoint

type Timepoint struct {
	Timestamp string      `json:"timestamp"`
	Value     interface{} `json:"value"`
}

func GetDailyProjectMsgCount

func GetDailyProjectMsgCount(projectUUID string, store stores.Store) ([]Timepoint, error)

func GetDailyTopicMsgCount

func GetDailyTopicMsgCount(projectUUID string, topicName string, store stores.Store) ([]Timepoint, error)

Jump to

Keyboard shortcuts

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