Description Usage Arguments Time stamps format Entity specification Tags specification
Save time series from given data frame into ATSD. The data frame should have a column with time stamps and at least one numeric column with values of a metric.
1 2 3 4 |
dfr |
Required argument, a data frame. The data frame should have a column with timestamps and at least one numeric column with values of a metric. |
time_col |
Optional numeric or character argument, default value is 1. Number or name of the column with timestamps. For example, time_col = 1, or time_col = "Timestamp". Read "Time stamps format" section for supported time stamps formats. |
time_format |
Optional string argument, indicates format of time stamps. This argument is used in the case when time stamps format is not clear from their class. The value of this argument can be one of strings: "ms" (for epoch milliseconds), "sec" (for epoch seconds), or format string, for example "%Y-%m-%d %H:%M:%S". This format string will be used to convert provided time stamps to epoch milliseconds before storing time stamps into ATSD. Read "Time stamps format" section for details. |
tz |
Optional string argument. By default, |
metric_col |
Required argument. Numeric or character vector.
Specifies numbers or names of the columns
where metrics values are stored.
For example, |
metric_name |
Optional argument. Character vector.
Specifies names of metrics. The series pointed by |
entity_col |
Optional argument, should be provided if the entity argument is not given. Number or name of a column with entities. Several entities in the column are allowed. For example, entity_col = 4, or entity_col = "server001". |
entity |
Optional character argument, should be provided if the entity_col argument is not given. Name of the entity. |
tags_col |
Optional argument. Numeric or character vector. Lists numbers or names of the columns containing values of tags. So the name of a column is a tag name, and values in the column are the tag values. |
tags |
Optional argument. Character vector. Lists tags and their values in "tag=value" format. Each provided tag stick to each series. Whitespace symbols are ignored. |
verbose |
Optional boolean argument.
If |
The list of allowed time stamps types.
– Numeric, in epoch milliseconds or epoch seconds. In that case time_format = "ms"
or time_format = "sec"
should be used, and time zone argument tz
is ignored.
– Object of one of types "Date", "POSIXct", "POSIXlt", "chron" from the chron package
or "timeDate" from the timeDate package.
In that case arguments time_format
and tz
are ignored.
– String, for example, "2015-01-03 10:07:15". In that case time_format
argument should specify which format string is used for the time stamps.
For example, time_format = "%Y-%m-%d %H:%M:%S"
.
Type ?strptime
to see list of format symbols.
This format string will be used to convert provided time stamps
to epoch milliseconds before store time stamps in ATSD.
So time zone, as written in tz
argument, and standard
origin "1970-01-01 00:00:00" are used for conversion. In fact conversion is done with use
of command:
as.POSIXct(time_stamp, format = time_format, origin="1970-01-01", tz = tz)
.
Note that time stamps will be stored in epoch milliseconds. So if you put some data into ATSD
and then get it back, the time stamps will refer to the same time but in GMT time zone.
For example, if you save time stamp "2015-02-15 10:00:00"
with
tz = "Australia/Darwin"
in ATSD, and then fetch it back, you will get time stamp
"2015-02-15 00:30:00"
because Australia/Darwin
time zone has +09:30 shift relatively GMT zone.
You can provide entity name in one of 'entity' or 'entity_col' arguments. In the first case all series will have the same entity. In the second case, if the column of the data frame, specified by 'entity_col', contains several entities, then that entities will be saved along with corresponding series.
The 'tags_col' argument points which columns of the data frame keep tags of time series. The name of each column specified by tags_col argument is a tag name, and the values in the column are the tag values.
Before storing in ATSD the data frame will be split to several data frames, each of them has unique entity and unique list of tags values. This entity and tags are stored in ATSD along with time series from such data frame. NA's and missing values in time series will be ignored.
In 'tags' argument you can specify tags which are the same for all rows (records) of the data frame. So each series value saved in ATSD will have tags, provided in the 'tags' argument.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.