QueueSummary: Run a Summary Report

Description Usage Arguments Details Value Examples

View source: R/QueueSummary.R

Description

A QueueSummary report is a summary report of metrics for one or more report suites for a given time period. Time period in the date parameter can be specified as year only ("2015"), year-month ("2015-04") or year-month-day ("2015-04-20"); alternatively, date.to and date.from are available for custom date ranges.

Usage

1
2
3
QueueSummary(reportsuite.ids, date = "", metrics, interval.seconds = 5,
  max.attempts = 120, validate = TRUE, date.from = "", date.to = "",
  enqueueOnly = FALSE)

Arguments

reportsuite.ids

Report suite ids

date

Time period for the report (see Description)

metrics

List of metrics to include in the report

interval.seconds

How long to wait between attempts

max.attempts

Number of API attempts before stopping

validate

whether to submit report definition for validation before requesting the data.

date.from

Start date for the report (YYYY-MM-DD)

date.to

End date for the report (YYYY-MM-DD)

enqueueOnly

only enqueue the report, don't get the data. returns report id, which you can later use to get the data

Details

The QueueSummary function returns a data frame containing a metric summary for the time period selected.

Because of the Reporting API structure, this function first requests the report, then checks the reporting queue to see if the report is completed, and when the report returns as "done" pulls the report from the API. This checking process will occur up to the specified number of times (default 120), with a delay between status checks (default 5 seconds). If the report does not return as "done" after the number of tries have completed, the function will return an error message.

Value

Data frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

aa <- QueueSummary("zwitchdev", "2015", c("pageviews", "visits"))
bb <- QueueSummary("zwitchdev", "", c("pageviews", "visits"), 
                   date.from = "2016-01-01", date.to="2016-01-15")
enqueued.reprot.id <- QueueSummary("zwitchdev", "", c("pageviews", "visits"), 
                   date.from = "2016-01-01", date.to="2016-01-15",
                   enqueueOnly=TRUE)

## End(Not run)

RSiteCatalyst documentation built on Nov. 6, 2019, 5:09 p.m.