Metrics (FQL)

From Facebook Developer Wiki

Jump to: navigation, search


Contents

Description

The FQL metrics table. Query this table to retrieve metrics about your application. All metrics are identified by a name, and a period over which they've been collected (e.g. one day or seven days).

To structure your query, use the table name (metrics in this case) in the FROM clause. The items in the Name column correspond to columns in the table that can be referenced in the SELECT and WHERE clauses.

This query is indexable only if a) the given date range is bounded and less than 30 days, and b) a list of periods is specified. In order to make your query indexable, the WHERE in your query should contain a comparison or IN clause for the end_time column, and an equality or IN clause for the period.

The See Also section lists API functions that work on similar data; their documentation pages contain additional information about the contents of the column and example FQL queries.

Columns

IndexableNameTypeDescription
* end_time int The end of the period during which the metrics were collected (expressed as a unix time).
* period int The length of the period, in seconds, during which the metrics were collected. Currently, the only supported periods are 86400, 604800, and 2592000.
active_users int Number of active users.
api_calls int Number of API calls made by your application.
unique_api_calls int Number of users on behalf of whom your application made API calls.
canvas_page_views int Number of canvas page views.
unique_canvas_page_views int Number of users who viewed a canvas page for your application.
canvas_http_request_time_avg int Average HTTP request time for your application's canvas pages.
canvas_fbml_render_time_avg int Average FBML render time for your application's canvas pages.
unique_adds int Number of users who added your application. (Only available for period 86400.)
unique_removes int Number of users who removed your application. (Only available for period 86400.)
unique_blocks int Number of users who blocked your application. (Only available for period 86400.)
unique_unblocks int Number of users who unblocked your application. (Only available for period 86400.)
canvas_page_views_http_code_0 int Number of canvas page views which timed out. (Only available for period 86400.)
canvas_page_views_http_code_200 int Number of canvas page views returned HTTP code 200. (Only available for period 86400.)
canvas_page_views_http_code_200ND int Number of canvas page views which returned HTTP code 200 and no data. (Only available for period 86400.)
canvas_page_views_http_code_404 int Number of canvas page views which returned HTTP code 404. (Only available for period 86400.)

Examples

SELECT end_time, period, active_users, canvas_page_views FROM metrics WHERE end_time IN (1212822000, 1212908400) AND period IN (86400, 604800) SELECT end_time, period, api_calls FROM metrics WHERE end_time >= 1212822000 AND end_time <= 1212994800 AND (period = 86400 OR period = 2592000)

Notes

  • To retrieve canvas page views for HTTP codes other than those listed, use the desired code in the "canvas_page_views_http_code_X" format (e.g. canvas_page_views_http_code_403). (Only available for period 86400.)
  • The end_time variable specifies the end of the period over which the metrics were collected. For example, to obtain data for the 7-day period starting on June 8th at 12:00AM and ending on June 14th at 11:59PM, specify 1213513200 (midnight on June 15th) as the end_time and 604800 (the number of seconds in seven days) as the period.
  • All values for the end_time variable must be specified as midnight, Pacific time.
  • request and render times are in milliseconds

See Also