com.google.code.facebookapi
Enum Metric

java.lang.Object
  extended by java.lang.Enum<Metric>
      extended by com.google.code.facebookapi.Metric
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Metric>

public enum Metric
extends java.lang.Enum<Metric>

This class enumerates the various metrics that are available through the admin.getMetrics API call. Typically, you will pass a set containing the metrics you are interested in to the API call. See http://wiki.developers.facebook.com/index.php/Admin.getMetrics for details.


Enum Constant Summary
ACTIVE_USERS
          Active users for your app.
API_CALLS
          Number of API calls made by your app.
CANVAS_PAGE_VIEWS
          Number of canvas page views.
DAILY_ACTIVE_USERS
          Deprecated. 
FBML_RENDER_TIME_AVG
          Average time required to render your app's FBML.
REQUEST_CONTINUE
          Number of requests, that returned http code 100.
REQUEST_ERROR_301
          Number of requests that produced a status 301 error.
REQUEST_ERROR_302
          Number of requests that produced a status 302 error.
REQUEST_ERROR_303
          Number of requests that produced a status 303 error.
REQUEST_ERROR_400
          Number of requests that produced a status 400 error.
REQUEST_ERROR_401
          Number of requests that produced a status 401 error.
REQUEST_ERROR_403
          Number of requests that produced a status 403 error.
REQUEST_ERROR_404
          Number of requests that produced a status 404 error.
REQUEST_ERROR_405
          Number of requests that produced a status 405 error.
REQUEST_ERROR_413
          Number of requests that produced a status 413 error.
REQUEST_ERROR_422
          Number of requests that produced a status 422 error.
REQUEST_ERROR_500
          Number of requests that produced a status 500 error.
REQUEST_ERROR_502
          Number of requests that produced a status 502 error.
REQUEST_ERROR_503
          Number of requests that produced a status 503 error.
REQUEST_ERROR_505
          Number of requests that produced a status 505 error.
REQUEST_OK
          Number of requests that completed successfully.
REQUEST_OK_NO_DATA
          Number of requests that returned status 200, but with no data.
REQUEST_TIME_AVG
          Average time required to load your app's canvas page.
REQUEST_TIMEOUT
          Number of requests that timed out.
UNIQUE_ADDS
          Number of unique users adding your app.
UNIQUE_API_CALLS
          Number of users making API calls through your app.
UNIQUE_BLOCKS
          Number of unique users blocking your app.
UNIQUE_CANVAS_PAGE_VIEWS
          Number of unique users viewing your canvas page.
UNIQUE_REMOVES
          Number of unique users removing your app.
UNIQUE_UNBLOCKS
          Number of unique users unblocking your app.
 
Field Summary
protected static java.util.Map<java.lang.String,Metric> METRIC_TABLE
           
static java.lang.Long PERIOD_DAY
          Use in Admin.getMetrics calls to specify a daily time-period.
static java.lang.Long PERIOD_MONTH
          Use in Admin.getMetrics calls to specify a monthly time-period.
static java.lang.Long PERIOD_WEEK
          Use in Admin.getMetrics calls to specify a weekly time-period.
 
Method Summary
static Metric getErrorMetric(int errorCode)
          Lookup a metric by HTTP error code.
static Metric getMetric(java.lang.String name)
          Lookup a metric by name.
 java.lang.String getName()
          Get the name by which Facebook refers to this metric.
static Metric valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Metric[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DAILY_ACTIVE_USERS

@Deprecated
public static final Metric DAILY_ACTIVE_USERS
Deprecated. 
Daily active users for your app. For use with Admin.getDailyMetrics only.


ACTIVE_USERS

public static final Metric ACTIVE_USERS
Active users for your app. For use with Admin.getMetrics only.


UNIQUE_ADDS

public static final Metric UNIQUE_ADDS
Number of unique users adding your app.


UNIQUE_REMOVES

public static final Metric UNIQUE_REMOVES
Number of unique users removing your app.


UNIQUE_BLOCKS

public static final Metric UNIQUE_BLOCKS
Number of unique users blocking your app.


UNIQUE_UNBLOCKS

public static final Metric UNIQUE_UNBLOCKS
Number of unique users unblocking your app.


API_CALLS

public static final Metric API_CALLS
Number of API calls made by your app.


UNIQUE_API_CALLS

public static final Metric UNIQUE_API_CALLS
Number of users making API calls through your app.


CANVAS_PAGE_VIEWS

public static final Metric CANVAS_PAGE_VIEWS
Number of canvas page views.


UNIQUE_CANVAS_PAGE_VIEWS

public static final Metric UNIQUE_CANVAS_PAGE_VIEWS
Number of unique users viewing your canvas page.


REQUEST_TIME_AVG

public static final Metric REQUEST_TIME_AVG
Average time required to load your app's canvas page.


FBML_RENDER_TIME_AVG

public static final Metric FBML_RENDER_TIME_AVG
Average time required to render your app's FBML.


REQUEST_TIMEOUT

public static final Metric REQUEST_TIMEOUT
Number of requests that timed out.


REQUEST_CONTINUE

public static final Metric REQUEST_CONTINUE
Number of requests, that returned http code 100.


REQUEST_OK

public static final Metric REQUEST_OK
Number of requests that completed successfully.


REQUEST_OK_NO_DATA

public static final Metric REQUEST_OK_NO_DATA
Number of requests that returned status 200, but with no data.


REQUEST_ERROR_301

public static final Metric REQUEST_ERROR_301
Number of requests that produced a status 301 error.


REQUEST_ERROR_302

public static final Metric REQUEST_ERROR_302
Number of requests that produced a status 302 error.


REQUEST_ERROR_303

public static final Metric REQUEST_ERROR_303
Number of requests that produced a status 303 error.


REQUEST_ERROR_400

public static final Metric REQUEST_ERROR_400
Number of requests that produced a status 400 error.


REQUEST_ERROR_401

public static final Metric REQUEST_ERROR_401
Number of requests that produced a status 401 error.


REQUEST_ERROR_403

public static final Metric REQUEST_ERROR_403
Number of requests that produced a status 403 error.


REQUEST_ERROR_404

public static final Metric REQUEST_ERROR_404
Number of requests that produced a status 404 error.


REQUEST_ERROR_405

public static final Metric REQUEST_ERROR_405
Number of requests that produced a status 405 error.


REQUEST_ERROR_413

public static final Metric REQUEST_ERROR_413
Number of requests that produced a status 413 error.


REQUEST_ERROR_422

public static final Metric REQUEST_ERROR_422
Number of requests that produced a status 422 error.


REQUEST_ERROR_500

public static final Metric REQUEST_ERROR_500
Number of requests that produced a status 500 error.


REQUEST_ERROR_502

public static final Metric REQUEST_ERROR_502
Number of requests that produced a status 502 error.


REQUEST_ERROR_503

public static final Metric REQUEST_ERROR_503
Number of requests that produced a status 503 error.


REQUEST_ERROR_505

public static final Metric REQUEST_ERROR_505
Number of requests that produced a status 505 error.

Field Detail

PERIOD_DAY

public static final java.lang.Long PERIOD_DAY
Use in Admin.getMetrics calls to specify a daily time-period.


PERIOD_WEEK

public static final java.lang.Long PERIOD_WEEK
Use in Admin.getMetrics calls to specify a weekly time-period.


PERIOD_MONTH

public static final java.lang.Long PERIOD_MONTH
Use in Admin.getMetrics calls to specify a monthly time-period.


METRIC_TABLE

protected static final java.util.Map<java.lang.String,Metric> METRIC_TABLE
Method Detail

values

public static Metric[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Metric c : Metric.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Metric valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getName

public java.lang.String getName()
Get the name by which Facebook refers to this metric.

Returns:
the Facebook-supplied name of this metric.

getMetric

public static Metric getMetric(java.lang.String name)
Lookup a metric by name.

Parameters:
name - the Facebook-supplied name of the metric to lookup, such as "daily_active_users".
Returns:
the metric the corresponds to the supplied name, or null if none exists.

getErrorMetric

public static Metric getErrorMetric(int errorCode)
Lookup a metric by HTTP error code.

Parameters:
errorCode - the code to get the metric for, such as 500, 404, 401, 200, etc..
Returns:
the metric the corresponds to the supplied HTTP error-code, or null if none exists.


Copyright © 2010. All Rights Reserved.