get_metrics: Get information about metrics from Axibase Time-Series...

Description Usage Arguments Value See Also Examples

View source: R/get_metrics.R

Description

This function fetches a list of metrics and their tags from ATSD, and converts it to a data frame.

Usage

1
2
get_metrics(expression = "", active = "", tags = "*", limit = 0,
  verbose = TRUE)

Arguments

expression

Optional string argument. Select metrics matching particular name pattern and/or user-defined metric tags. The syntax of the expression argument is explained in the package vignette. Type browseVignettes(package = "atsd") to see the vignette.

active

Optional string argument: "true" or "false". Filter metrics by lastInsertTime. If active = "true", only metrics with positive lastInsertTime are included in the response.

tags

Optional string argument. User-defined metric tags to be included in the response. By default, all the tags will be included.

limit

Optional integer argument. If limit > 0, the response shows the top-N metrics ordered by name.

verbose

Optional boolean argument. If verbose = FALSE then all console output will be suppressed. By default, verbose = TRUE.

Value

A data frame. Each row of the data frame corresponds to a metric and its tags: name, counter, lastInsertTime and user-defined metric tags as requested by the 'tags' argument. For more information view the package vignette: browseVignettes(package = "atsd").

See Also

Visit http://axibase.com/axibase-time-series-database/ for information about ATSD.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# get all metrics and include all their tags in the data frame
get_metrics()

# get the top 100 active metrics which have tag, 'table', 
# include this tag into response and exclude oter user-defined metric tags
get_metrics(expression = "tags.table != ''", active = "true", 
            tags = "table", limit = 100)

# get metrics which have user-defined metric tag, 'table', 
# and whose name starts with 'cpu'
get_metrics(expression = "name like 'cpu*' and tags.table != ''")
            
# more complitcated expressions
get_metrics(expression = "likeAll(name, list('*disk*,*use*'))")
get_metrics(expression = "(name like 'cpu*' or tags.source = '') and tags.table like 'BC*'")

## End(Not run)

atsd documentation built on May 2, 2019, 4:06 p.m.