|
libusermetrics
|
#include <libusermetricsinput/UserMetricsInputExport.h>Go to the source code of this file.
Typedefs | |
| typedef void * | UserMetricsInputMetricManager |
| A central place for registering user metrics. | |
| typedef void * | UserMetricsInputMetricParameters |
| Parameters for constructing a metric. | |
| typedef void * | UserMetricsInputMetric |
| A single user metric, e.g. "number of e-mails today" or "photos taken today". | |
| typedef void * | UserMetricsInputMetricUpdate |
| A update to a user metric for a particular user. | |
Enumerations | |
| enum | USERMETRICSINPUT_METRICTYPE { METRIC_TYPE_USER , METRIC_TYPE_SYSTEM } |
Functions | |
| USERMETRICSINPUT_EXPORT UserMetricsInputMetricManager | usermetricsinput_metricmanager_new () |
| Construct a new UserMetricsInputMetricManager. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricmanager_delete (UserMetricsInputMetricManager metricManager) |
| Free a UserMetricsInputMetricManager. | |
| USERMETRICSINPUT_EXPORT UserMetricsInputMetricParameters | usermetricsinput_metricparameters_new (const char *dataSourceId) |
| Construct a new UserMetricsInputMetricParameters. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricparameters_set_format_string (UserMetricsInputMetricParameters metricParameter, const char *formatString) |
| Set the string to print in the output API, e.g. "<b>%1</b> messages received today". | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricparameters_set_empty_data_string (UserMetricsInputMetricParameters metricParameter, const char *emptyDataString) |
| set the string to print in the case of no data, e.g. "No messages received today" | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricparameters_set_text_domain (UserMetricsInputMetricParameters metricParameter, const char *textDomain) |
| Set the translation domain. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricparameters_set_minimum (UserMetricsInputMetricParameters metricParameter, double minimum) |
| Set the minimum display value for this metric. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricparameters_set_maximum (UserMetricsInputMetricParameters metricParameter, double maximum) |
| Set the maximum display value for this metric. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricparameters_set_type (UserMetricsInputMetricParameters metricParameter, USERMETRICSINPUT_METRICTYPE metricType) |
| Set the type of metric this is (user owned or system owned). | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricparameters_delete (UserMetricsInputMetricParameters metricParameters) |
| Free a UserMetricsInputMetricParameters. | |
| USERMETRICSINPUT_EXPORT UserMetricsInputMetric | usermetricsinput_metricmanager_add (UserMetricsInputMetricManager metricManager, UserMetricsInputMetricParameters metricParameters) |
| Register a new UserMetricsInputMetric. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metric_increment (UserMetricsInputMetric metric, double amount, const char *username) |
| Increment the "today" value for a simple user metric. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metric_update_today (UserMetricsInputMetric metric, double value, const char *username) |
| Update the "today" value for a simple user metric. | |
| USERMETRICSINPUT_EXPORT UserMetricsInputMetricUpdate | usermetricsinput_metric_update (UserMetricsInputMetric metric, const char *username) |
| Create an update to a particular metric. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricupdate_delete (UserMetricsInputMetricUpdate metricUpdate) |
| Free a UserMetricsInputMetric. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricupdate_add_data (UserMetricsInputMetricUpdate metricUpdate, double data) |
| Add data to a UserMetricsInputMetricUpdate. | |
| USERMETRICSINPUT_EXPORT void | usermetricsinput_metricupdate_add_null (UserMetricsInputMetricUpdate metricUpdate) |
| Add unknown data to an update. | |
| typedef void* UserMetricsInputMetric |
A single user metric, e.g. "number of e-mails today" or "photos taken today".
| typedef void* UserMetricsInputMetricManager |
A central place for registering user metrics.
| typedef void* UserMetricsInputMetricParameters |
Parameters for constructing a metric.
| typedef void* UserMetricsInputMetricUpdate |
A update to a user metric for a particular user.
| USERMETRICSINPUT_EXPORT void usermetricsinput_metric_increment | ( | UserMetricsInputMetric | metric, |
| double | amount, | ||
| const char * | username ) |
Increment the "today" value for a simple user metric.
| metric | |
| amount | How much to increase the metric by - usually 1. |
| username | The user to update the data for. If blank ("") then the current user is used. |
| USERMETRICSINPUT_EXPORT UserMetricsInputMetricUpdate usermetricsinput_metric_update | ( | UserMetricsInputMetric | metric, |
| const char * | username ) |
Create an update to a particular metric.
| metric | |
| username | The user to update the data for. If blank ("") then the current user is used. |
Must be freed with usermetricsinput_metricupdate_delete - this is when the actual update will be sent to the storage service.
| USERMETRICSINPUT_EXPORT void usermetricsinput_metric_update_today | ( | UserMetricsInputMetric | metric, |
| double | value, | ||
| const char * | username ) |
Update the "today" value for a simple user metric.
| metric | |
| value | Today's value |
| username | The user to update the data for. If blank ("") then the current user is used. |
| USERMETRICSINPUT_EXPORT UserMetricsInputMetric usermetricsinput_metricmanager_add | ( | UserMetricsInputMetricManager | metricManager, |
| UserMetricsInputMetricParameters | metricParameters ) |
Register a new UserMetricsInputMetric.
| metricManager | |
| metricParameters | The parameters of the metric to create |
Do not attempt to delete this object.
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricmanager_delete | ( | UserMetricsInputMetricManager | metricManager | ) |
Free a UserMetricsInputMetricManager.
| metricManager | The UserMetricsInputMetricManager to free |
| USERMETRICSINPUT_EXPORT UserMetricsInputMetricManager usermetricsinput_metricmanager_new | ( | ) |
Construct a new UserMetricsInputMetricManager.
Must be freed with usermetricsinput_metricmanager_delete
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricparameters_delete | ( | UserMetricsInputMetricParameters | metricParameters | ) |
Free a UserMetricsInputMetricParameters.
| metricParameters | The UserMetricsInputMetricManager to free |
| USERMETRICSINPUT_EXPORT UserMetricsInputMetricParameters usermetricsinput_metricparameters_new | ( | const char * | dataSourceId | ) |
Construct a new UserMetricsInputMetricParameters.
| dataSourceId | The unique ID of the data source, e.g. "facebook" |
Must be freed with usermetricsinput_metricparameters_delete
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricparameters_set_empty_data_string | ( | UserMetricsInputMetricParameters | metricParameter, |
| const char * | emptyDataString ) |
set the string to print in the case of no data, e.g. "No messages received today"
| metricParameter | |
| emptyDataString |
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricparameters_set_format_string | ( | UserMetricsInputMetricParameters | metricParameter, |
| const char * | formatString ) |
Set the string to print in the output API, e.g. "<b>%1</b> messages received today".
| metricParameter | |
| formatString |
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricparameters_set_maximum | ( | UserMetricsInputMetricParameters | metricParameter, |
| double | maximum ) |
Set the maximum display value for this metric.
| metricParameter | |
| maximum |
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricparameters_set_minimum | ( | UserMetricsInputMetricParameters | metricParameter, |
| double | minimum ) |
Set the minimum display value for this metric.
| metricParameter | |
| minimum |
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricparameters_set_text_domain | ( | UserMetricsInputMetricParameters | metricParameter, |
| const char * | textDomain ) |
Set the translation domain.
| metricParameter | |
| textDomain |
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricparameters_set_type | ( | UserMetricsInputMetricParameters | metricParameter, |
| USERMETRICSINPUT_METRICTYPE | metricType ) |
Set the type of metric this is (user owned or system owned).
| metricParameter | |
| metricType |
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricupdate_add_data | ( | UserMetricsInputMetricUpdate | metricUpdate, |
| double | data ) |
Add data to a UserMetricsInputMetricUpdate.
| metricUpdate | The UserMetricsInputMetricUpdate to add data to |
| data | The double-valued data to add |
Each call to this method appends a new day's data to the update. So the first call adds data for today, the second call adds data for yesterday, and so on.
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricupdate_add_null | ( | UserMetricsInputMetricUpdate | metricUpdate | ) |
Add unknown data to an update.
| metricUpdate | The UserMetricsInputMetricUpdate to add data to |
If data is not known for a particular day, then null can be added.
| USERMETRICSINPUT_EXPORT void usermetricsinput_metricupdate_delete | ( | UserMetricsInputMetricUpdate | metricUpdate | ) |
Free a UserMetricsInputMetric.
| metricUpdate | The UserMetricsInputMetric to free and dispatch |
This will cause the update to be dispatched.