usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [19/51] [abbrv] [partial] incubator-usergrid git commit: Switch over to new docs for the website.
Date Wed, 05 Aug 2015 14:56:05 GMT
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2a55601f/content/docs/events-and-counters 2/index.html
----------------------------------------------------------------------
diff --git a/content/docs/events-and-counters 2/index.html b/content/docs/events-and-counters 2/index.html
deleted file mode 100644
index 8c5d316..0000000
--- a/content/docs/events-and-counters 2/index.html	
+++ /dev/null
@@ -1,612 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <title>Apache Usergrid (incubating) — Events and counters</title>
-    <meta http-equiv="x-ua-compatible" content="ie=edge" />
-    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
-    <meta name="keywords" content="Apache Usergrid, Usergrid, BaaS, Backend-as-a-Service">
-    <meta name="description" content="An open-source Backend-as-a-Service stack for web & mobile applications, based on RESTful APIs." />
-    <meta property="og:title" content="Apache Usergrid" />
-    <meta property="og:description" content="An open-source Backend-as-a-Service stack for web & mobile applications, based on RESTful APIs." />
-    <!-- Loading Typekit -->
-    <script type="text/javascript" src="//use.typekit.net/ddl7izx.js"></script>
-    <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
-    <!-- Loading Bootstrap -->
-    <link href="/bootstrap/bootstrap.min.css" rel="stylesheet" type='text/css'>
-    <link href="/css/bootflat.css" rel="stylesheet" type='text/css'>
-    <link href="/css/usergrid-site.css" rel="stylesheet" type='text/css'>
-    <link href="https://fonts.googleapis.com/css?family=Open+Sans:200,400,500,300,600,800,700,400italic,600italic,700italic,800italic,300italic" rel="stylesheet" type="text/css">
-    <link href="/css/font-awesome.min.css" rel="stylesheet" type='text/css'>
-
-    
-
-    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
-    <!--[if lt IE 9]>
-      <script src="js/html5shiv.js"></script>
-      <script src="js/respond.min.js"></script>
-    <![endif]-->
-</head>
-<body>
-
-    <header class="navbar navbar-inverse navbar-fixed-top bf-docs-nav secondary" role="banner">
-    <div class="container">
-        <div class="navbar-header">
-            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bf-navbar-collapse">
-                <span class="sr-only">Toggle navigation</span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-            </button>
-        </div>
-        <a href="/" class="navbar-brand">
-                <img id="home-logo" src="/img/apache_usergrid_logo_white_small.png" />
-            </a>
-        <nav class="collapse navbar-collapse bf-navbar-collapse" role="navigation">
-            <ul class="nav navbar-nav navbar-right">
-                <li class=""><a href="/community/"><span class="icns icon-group"></span></a></li>
-                <li><a href="http://usergrid.readthedocs.org/" target="_blank"><span class="icns icon-book"></span></a></li>
-                <li><a href="http://github.com/apache/incubator-usergrid" target="_blank"><span class="icns icon-github-sign"></span></a></li>
-                <!--<li><a href="https://trello.com/b/exQmJIOn/usergrid" target="_blank"><span class="icns icon-trello"></span></a></li>-->
-                <li><a href="https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=23&view=planning&selectedIssue=USERGRID-362&epics=visible" target="_blank"><span class="icns icon-bug"></span></a></li>
-                <li><a href="http://stackoverflow.com/search?q=usergrid" target="_blank"><span class="icns icon-stackexchange"></span></a></li>
-                <li><a href="/community/#live"><span class="icns icon-comments"></span></a></li>
-                <!--<li><a href="https://groups.google.com/forum/#!forum/usergrid" target="_blank"><span class="icns icon-envelope"></span></a></li>-->
-                <li><a href="https://twitter.com/usergrid" target="_blank"><span class="icns icon-twitter"></span></a></li>
-                <li><a href="https://cwiki.apache.org/confluence/display/usergrid/" target="_blank"><span class="icns icon-wiki"></span></a></li>
-                <li><a href="/releases/"><span class="icns icon-releases"></span></a></li>
-            </ul>
-        </nav>
-    </div>
-    </header>
-
-
-
-<div class="container bf-docs-container">    
-    <div class="row">
-        <div class="col-md-3">
-            <div class="bf-sidebar hidden-print" role="complementary">
-                <ul class="nav nav-list">
-                    <li><a href="/docs/getting-up-and-running-locally/">Getting Up &amp; Running Locally</a></li>
-                    <li><a href="/docs/deploy-local/">Deploying to local Tomcat &amp; Cassandra</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/ugc#usergrid-command-line-ugc"><code>ugc</code> — the Command-line Client</a></li>
-
-                    <li class="nav-header"><span>Concepts</span></li>
-                    <li>
-                        <a href="/docs/organizations-admins/">Organizations & Admins</a>
-                        <ul>
-                            <li>
-                                <a href="/docs/applications/">Applications</a>
-                                <ul>
-                                    <li><a href="/docs/roles-and-permissions/">Roles & Permissions</a></li>
-                                    <!--<li><a href="#">Queues</a></li>-->
-                                    <li><a href="/docs/events-and-counters/">Events & Counters</a></li>
-                                    <li><a href="/docs/relationships/">Relationships (Joins)</a></li>
-                                    <li>
-                                        <a href="/docs/collections">Collections</a>
-                                        <ul>
-                                            <li><a href="/docs/query-language/">Query Language</a></li>
-                                            <li><a href="/docs/users-devices/">Users & Devices</a></li>
-                                            <li><a href="/docs/groups/">Groups</a></li>
-                                            <li><a href="/docs/activities/">Activities</a></li>
-                                            <li><a href="/docs/assets/">Assets</a></li>
-                                        </ul>
-                                    </li>
-                                </ul>
-                            </li>
-                        </ul>
-                    </li>
-
-
-                    <li class="nav-header"><span>Usage</span></li>
-                    <!-- <li>REST API — Coming Soon</li> -->
-                    <li><a class="icns-apple" href="https://github.com/apache/incubator-usergrid/tree/master/sdks/ios">iOS SDK</a></li>
-                    <li><a class="icns-android" href="https://github.com/apache/incubator-usergrid/tree/master/sdks/android">Android SDK</a></li>
-                    <li><a class="icns-html5" href="">HTML5 / JavaScript SDK</a></li>
-                    <li><a class="icns-windows" href="https://github.com/apache/incubator-usergrid/tree/master/sdks/dotnet">Windows 8 / Windows Phone / .net SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/nodejs">Node.js module</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/ruby">Ruby gem</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/ruby-on-rails">Ruby on Rails gem</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/php">PHP library</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/java">Java library</a></li>
-
-                    <!--<li class="nav-header"><span>Internals</span></li>
-                    <li>Design & Goals — Coming Soon</li>
-                    <li>Java Architecture — Coming Soon</li>
-                    <li>Cassandra Schema — Coming Soon</li>-->
-
-                    <li class="nav-header"><span>Operations</span></li>
-                    <!--<li>Deploying — Coming Soon</li>-->
-                    <!-- <li>Monitoring — Coming Soon</li> -->
-                    <li><a href="/docs/upgrading/">Upgrading</a></li>
-                    <!-- <li>Security — Coming Soon</li> -->
-
-                    <li class="nav-header"><span>Presentations & Videos</span></li>
-                    <li><a href="/docs/presentations/">Presentations</a></li>
-                    <li><a href="/docs/videos/">Videos</a></li>
-
-                    <li class="nav-header"><span>We need your help!</span></li>
-                    <li><a href="/docs/contribute-code/">How to Contribute Code & Docs</a></li>
-                    <!--
-                    <li><a href="/docs/contribute-docs">How to contribute docs</a></li>
-                    -->
-                </ul>
-            </div>
-        </div>
-
-        <div class="col-md-9 main-article" role="main">
-            <div class="page-article">
-                <div class="page-header">
-                    <h1>Events and counters</h1>
-                    <!-- TODO: reenable this when we sync SVN to GitHub
-                  <small><a target="_blank" href="https://github.com/usergrid/website/blob/master/content/docs/events-and-counters 2.md">contribute to this article on github</a></small>
-                    -->
-                </div>
-                <div class="toc">
-	<ul>
-<li>
-<a href="#creating-a-new-event">Creating a new event</a><ul>
-<li><a href="#request-uri">Request URI</a></li>
-<li><a href="#parameters">Parameters</a></li>
-<li><a href="#example---request">Example - Request</a></li>
-<li><a href="#example---response">Example - Response</a></li>
-</ul>
-</li>
-<li>
-<a href="#event-properties">Event properties</a><ul>
-<li><a href="#categorizing-events">Categorizing events</a></li>
-</ul>
-</li>
-<li>
-<a href="#counters">Counters</a><ul>
-<li><a href="#user-defined-counters">User-Defined Counters</a></li>
-<li><a href="#counter-hierarchy">Counter hierarchy</a></li>
-<li><a href="#using-counters-in-time-series-queries">Using counters in time series queries</a></li>
-<li><a href="#retrieving-counter-data">Retrieving counter data</a></li>
-</ul>
-</li>
-</ul>
-</div>
-<p>Events are typically used for application logging. For example, they could be used to log error messages that a system administrator might review at a later time. The event mechanism is optimized to handle large numbers of events, so it is an ideal mechanism for logging in your application.</p>
-<p>You can link events to specific users, groups, or custom-defined categories. When created with these links, events offer a powerful tool for running highly targeted, custom reports.</p>
-<p>Events are also the primary way to store custom counter data for analytics. See Counters (below) for further details.</p>
-<p><strong>Note:</strong> Although not shown in the API examples below, you need to provide a valid access token with each API call. See <a href="/authenticating-users-and-application-clients">Authenticating users and application clients</a> for details.</p>
-<p>Using App services APIs you can create an event.</p>
-<h2 id="creating-a-new-event">Creating a new event</h2>
-<p>Use the POST method to create a new event in the events collection.</p>
-<h3 id="request-uri">Request URI</h3>
-<p>POST /{org_id}/{app_id}/events {request body}</p>
-<h3 id="parameters">Parameters</h3>
-<table>
-<col width="50%">
-<col width="50%">
-<thead>
-<tr class="header">
-<th align="left">Parameter</th>
-<th align="left">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr class="odd">
-<td align="left"><p>arg uuid|string org_id</p></td>
-<td align="left"><p>Organization UUID or organization name</p></td>
-</tr>
-<tr class="even">
-<td align="left"><p>arg uuid|string app_id</p></td>
-<td align="left"><p>Application UUID or application name</p></td>
-</tr>
-<tr class="odd">
-<td align="left"><p>request body</p></td>
-<td align="left">
-<p>One or more sets of event properties. You must provide a timestamp property, but if you set it to 0 it is assigned by the system.</p>
-<pre><code>{
-  "timestamp":0,
-  "category" : "advertising",
-  "counters" : {
-    "ad_clicks" : 5
-  }
-}</code></pre>
-</td>
-</tr>
-</tbody>
-</table>
-<h3 id="example---request">Example - Request</h3>
-<ul>
-<li><a href="#curl_create_event">cURL</a></li>
-<li><a href="#javascript_create_event">JavaScript (HTML5)</a></li>
-<li><a href="#ruby_create_event">Ruby</a></li>
-<li><a href="#nodejs_create_event">Node.js</a></li>
-</ul>
-<!-- -->
-
-<pre><code>curl -X POST "https://api.usergrid.com/my-org/my-app/events" -d '{"timestamp":0, "category" : "advertising", "counters" : {"ad_clicks" : 5}}'</code></pre>
-<p>The example assumes use of the <a href="https://github.com/apigee/usergrid-javascript-sdk">JavaScript (HTML5) SDK</a>.</p>
-<pre><code>var options = {
-    method:'POST',
-    endpoint:'events',
-    body:{timestamp:0, category:'advertising', counters:{ad_clicks : 5}}
-};
-client.request(options, function (err, data) {
-    if (err) {
-        //error
-    } else {
-        //success - data will contain raw results from API call
-    }
-});</code></pre>
-<p>The example assumes use of the <a href="https://github.com/scottganyo/usergrid_iron">Ruby SDK</a>.</p>
-<pre><code>app = Usergrid::Application.new 'https://api.usergrid.com/my-org/my-app/'
-result = app.create_event timestamp: '0', category: 'advertising', counters: { ad_clicks: 5 }
-mynewevent = result.entity   </code></pre>
-<p>The example assumes use of the <a href="https://github.com/apigee/usergrid-node-module">Node.js module</a>.</p>
-<pre><code>var options = {
-    method:'POST',
-    endpoint:'events',
-    body:{timestamp:0, category:'advertising', counters:{ad_clicks : 5}}
-};
-client.request(options, function (err, data) {
-    if (err) {
-        //error
-    } else {
-        //success - data will contain raw results from API call
-    }
-});</code></pre>
-<h3 id="example---response">Example - Response</h3>
-<pre><code>{
-      "action": "post",
-      "application": "7fb8d891-477d-11e1-b2bd-22000a1c4e22",
-      "params": {},
-      "path": "/events",
-      "uri": "https://api.usergrid.com/22000a1c4e22-7fb8d891-477d-11e1-b2bd/7fb8d891-477d-11e1-b2bd-22000a1c4e22/events",
-      "entities": [
-        {
-          "uuid": "ce07ea3c-68b5-11e1-a586-9227e40e3559",
-          "type": "event",
-          "created": 1331166585282,
-          "modified": 1331166585282,
-          "counters": {
-            "ad_clicks": 5
-          },
-          "metadata": {
-            "path": "/events/ce07ea3c-68b5-11e1-a586-9227e40e3559"
-          },
-          "timestamp": 1331166585282
-        }
-      ],
-      "timestamp": 1331166585018,
-      "duration": 919,
-      "organization": "my-org",
-      "applicationName": "my-app"
-}</code></pre>
-<h2 id="event-properties">Event properties</h2>
-<p>You can pass various system-defined properties for an event. For example, you can specify a user property, with a uuid as its value. This will link the event to the user and can be used to query against the events queue (see Categorization below). The same is true for the group property. Pass it with a uuid as the value and the event will be linked to the group. To include a uuid of a user or group, add the uuid to the request body, for example:</p>
-<pre><code>POST https://api.usergrid.com/my-org/my-app/events {"timestamp":0, "category" : "advertising", "counters" :  {"ad_clicks" : 5},"user" : "1234891-477d-11e1-b2bd-22005a1c4e22", "group" : "75577d891-347d-2231-b5bd-23400a1c4e22"}</code></pre>
-<p>The response body would look something like this:</p>
-<pre><code>{
- "action": "post",
- "application": "7fb8d891-477d-11e1-b2bd-22000a1c4e22",
- "params": {},
- "path": "/events",
- "uri": "https://api.usergrid.com/22000a1c4e22-7fb8d891-477d-11e1-b2bd/7fb8d891-477d-11e1-b2bd-22000a1c4e22/events",
- "entities": [
-   {
-     "uuid": "ce07ea3c-68b5-11e1-a586-9227e40e3559",
-     "user": "1234891-477d-11e1-b2bd-22005a1c4e22",
-     "group": "75577d891-347d-2231-b5bd-23400a1c4e22",
-     "type": "event",
-     "created": 1331166585282,
-     "modified": 1331166585282,
-     "counters": {
-       "ad_clicks": 5
-     },
-     "metadata": {
-       "path": "/events/ce07ea3c-68b5-11e1-a586-9227e40e3559"
-     },
-     "timestamp": 1331166585282
-   }
- ],
- "timestamp": 1331166585018,
- "duration": 919,
- "organization": "my-org",
- "applicationName": "my-app"
-}</code></pre>
-<p>You can also create application-specific event properties in addition to these predefined properties. The system-defined properties are reserved. You cannot use these names to create other properties for an event entity. In addition the events name is reserved for the events collection — you can’t use it to name another collection.</p>
-<p>The System-defined properties are as follows:</p>
-<table>
-<thead>
-<tr class="header">
-<th align="left">Property</th>
-<th align="left">Type</th>
-<th align="left">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr class="odd">
-<td align="left">uuid</td>
-<td align="left">UUID</td>
-<td align="left">Event’s unique entity ID</td>
-</tr>
-<tr class="even">
-<td align="left">type</td>
-<td align="left">String</td>
-<td align="left">“event”</td>
-</tr>
-<tr class="odd">
-<td align="left">created</td>
-<td align="left">long</td>
-<td align="left">
-<a href="http://en.wikipedia.org/wiki/Unix_time">UNIX timestamp</a> of entity creation</td>
-</tr>
-<tr class="even">
-<td align="left">modified</td>
-<td align="left">long</td>
-<td align="left">
-<a href="http://en.wikipedia.org/wiki/Unix_time">UNIX timestamp</a> of entity modification</td>
-</tr>
-<tr class="odd">
-<td align="left">timestamp</td>
-<td align="left">long</td>
-<td align="left">
-<a href="http://en.wikipedia.org/wiki/Unix_time">UNIX timestamp</a> of application event (mandatory)</td>
-</tr>
-<tr class="even">
-<td align="left">user</td>
-<td align="left">UUID</td>
-<td align="left">UUID of application user that posted the event</td>
-</tr>
-<tr class="odd">
-<td align="left">group</td>
-<td align="left">UUID</td>
-<td align="left">UUID of application group that posted the event</td>
-</tr>
-<tr class="even">
-<td align="left">category</td>
-<td align="left">string</td>
-<td align="left">Category used for organizing similar events</td>
-</tr>
-<tr class="odd">
-<td align="left">counters</td>
-<td align="left">map</td>
-<td align="left">Counter used for tracking number of similar events</td>
-</tr>
-<tr class="even">
-<td align="left">message</td>
-<td align="left">string</td>
-<td align="left">Message describing event</td>
-</tr>
-</tbody>
-</table>
-<h3 id="categorizing-events">Categorizing events</h3>
-<p>As mentioned previously, you can link an event to a user or a group. This enables you to categorize and qualify event data for use in tracking and analysis. For example, linking events to users and groups, enables you to track how often people use a feature. Not only can you determine the total number of users that used the feature, but also which groups contain users that made the most use of the feature. Or, you could provide a location with the event, so you could see how often a feature was used by people in San Francisco versus Los Angeles.</p>
-<h2 id="counters">Counters</h2>
-<p>User-defined counters are used in conjunction with events to keep statistics on many aspects of an application. User-defined counters are JSON objects that are added to events when they are posted. The act of posting an event increments the counter. Once created, user-defined counters can be used to get reports.</p>
-<p><strong>Note:</strong> It may take up to 30 seconds for a counter to be updated.</p>
-<h3 id="user-defined-counters">User-Defined Counters</h3>
-<p>With Apache Usergrid, you can define your own counters. Some of the things that you might track with a user-defined counter are:</p>
-<ul>
-<li>How many times people click on the help button in your application.</li>
-<li>How many times your game is played each day.</li>
-<li>How many times your banner ads are clicked each day.</li>
-</ul>
-<p>You can choose any name for a user-defined counter. For example, the counter for the help button might be named “help_button” or “help_button_clicks”.</p>
-<p>To create a user-defined counter, you post to the events collection and specify the name and increment value of the counter in the request body. The increment value is the value that the counter is incremented by for each tracked event. An increment value of 1, means that the counter is increment by 1 for each tracked event. You could also specify a higher increment value, such as 15, which would increment the value by that number, or a negative number, which would decrement the value.  You can also reset the value of the counter, by specifying an increment value of 0.</p>
-<p>When a counter is incremented by an event, there will be a 20-30 second delay between when the event is posted and when the counter is incremented. </p>
-<p>As an example, here’s how to create a user-defined counter named “button_clicks” with an increment value of 1:</p>
-<pre><code>POST https://api.usergrid.com/my-org/my-app/events {"counters" : {"button_clicks" : 1},"timestamp" : "0"}</code></pre>
-<p>The response body would look something like this:</p>
-<pre><code>{
-   "action": "post",
-   "path": "/events",
-   "uri": "http://api.usergrid.com/438a1ca1-cf9b-11e0-bcc1-12313f0204bb/events",
-   "entities": [
-       {
-           "uuid": "39d41c46-d8e4-11e0-bcc1-12313f0204bb",
-           "type": "event",
-           "timestamp": 1315353555546016,
-           "category":"advertising",
-           "counters": {
-               "button_clicks": 1
-           },
-           "created": 1315353555546016,
-           "modified": 1315353555546016,
-           "metadata": {
-           "path": "/events/39d41c46-d8e4-11e0-bcc1-12313f0204bb"
-           }
-       }
-   ],
-   "timestamp": 1315353555537,
-   "duration": 110,
-   "organization": "my-org",
-   "applicationName": "my-app"
-}</code></pre>
-<h3 id="counter-hierarchy">Counter hierarchy</h3>
-<p>Counters are hierarchical in their structure and in the way they are incremented. Each level of the hierarchy is separated by the dot “.” operator. The hierarchical structure can be useful if you want to store or view statistics in a hierarchical way. For example, suppose you want to log errors that your app generates. One way to do this, is to fire an event every time an error occurs, by creating a counter called “errors”. However, you can get more detail by adding additional parameters to the counter. Imagine that you want to track errors in a specific module and function within that module, say module_1, function_1, you could use a counter like this:</p>
-<p>errors.module_1.function_1</p>
-<p>And then for a different function in the same module:</p>
-<p>errors.module_1.function_2</p>
-<p>And then for a different function in a different module:</p>
-<p>errors.module_2.function_3</p>
-<p>If each of the preceding examples were called once, the resulting values would be:</p>
-<p>errors = 3<br><br> errors.module_1 = 2<br><br> errors.module_1.function_1 = 1<br><br> errors.module_1.function_2 = 1<br><br> errors.module_2 = 1<br><br> errors.module_2.function_3 = 1</p>
-<p>This tells you that there were 3 errors in the application, with 2 of those errors in module_1. You can then drill down further to see errors in specific functions.</p>
-<h3 id="using-counters-in-time-series-queries">Using counters in time series queries</h3>
-<p>Knowing the value of a counter is useful. However, you often need to know how the value varies over time. Fortunately, the API provides a method for you to view this data over any time interval or level of granularity.</p>
-<p>For example, let’s say you’re incrementing a counter every time someone launches your application. You might be interested in which days of the week the application sees the most usage. Using the API, you can examine the counter over a set of weeks, with the data split into daily intervals. Using this information, you can see which are your peak days of usage. You can also view usage across a single day, so you can see if your application is used more in the mornings or the evenings. For business reporting, you may be more interested in monthly reporting.</p>
-<p>Note that the system is able to provide you with the report data as you need it. The data is maintained in real-time so it can be viewed instantly.</p>
-<h3 id="retrieving-counter-data">Retrieving counter data</h3>
-<p>To retrieve counter data, you issue a GET request to the /counters endpoint. This is a special, built-in collection that gives you access to all the counters currently in the system. The API also provides a number of parameters that you can use to search for counter data, as follows:</p>
-<table>
-<thead>
-<tr class="header">
-<th align="left">Parameter</th>
-<th align="left">Type</th>
-<th align="left">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr class="odd">
-<td align="left">start_time</td>
-<td align="left">An <a href="http://en.wikipedia.org/wiki/Unix_time">Epoch(Unix)</a> timestamp in milliseconds</td>
-<td align="left">The beginning of the time period to search</td>
-</tr>
-<tr class="even">
-<td align="left">end_time</td>
-<td align="left">An <a href="http://en.wikipedia.org/wiki/Unix_time">Epoch(Unix)</a> timestamp in milliseconds</td>
-<td align="left">The end of the time period to search</td>
-</tr>
-<tr class="odd">
-<td align="left">counter</td>
-<td align="left">string</td>
-<td align="left">The name of a specific counter to search. You can specify more than one counter in a query (for example, counter=counter1&amp;counter=counter2…)</td>
-</tr>
-<tr class="even">
-<td align="left">resolution</td>
-<td align="left">string</td>
-<td align="left">The interval at which counters are displayed. For example, if the interval is day, and the start time and end time values span 4 days, you will get aggregate counts for each of the 4 days. Possible values are all, minute, five_minutes, half_hour, hour, six_day, day, week, and month.</td>
-</tr>
-</tbody>
-</table>
-<p>For example, to retrieve a time range of values, with a granularity of “day”, for a counter called “button_clicks”, the GET request would look like this:</p>
-<pre><code>GET /my-org/my-app/counters?start_time=1315119600000&amp;end_time=1315724400000&amp;resolution=day&amp;counter=button_clicks</code></pre>
-<p>The response body would look something like this:</p>
-<pre><code>{
- action: "get",
-    uri: "http://api.usergrid.com/438a1ca1-cf9b-11e0-bcc1-12313f0204bb/counters",
-    timestamp: 1315354369272,
-    duration: 28,
-    counters: [
-        {
-            name: "button_clicks",
-            values: [
-                {
-                    value: 2
-                    timestamp: 1315180800000
-                },
-                {
-                    value: 1
-                    timestamp: 1315267200000
-                },
-                {
-                    value: 1
-                    timestamp: 1315353600000
-                }
-            ]
-        }
-    ]
-}</code></pre>
-            </div>
-        </div>
-    </div>
-    <div class="row">
-        <div class="col-md-3"></div>
-        <div class="col-md-9">
-            <div class="github-callout">
-                <strong>Questions?</strong> Please do <a href="/community">ask on the mailing-lists</a>!<br/>
-                <!--
-                <strong>Found an error?</strong> We’d greatly appreciate a pull request about <a target="_blank" href="https://github.com/usergrid/website/blob/master/content/docs/events-and-counters 2.md">this article on github</a>.</div> 
-                -->
-            </div>
-        </div>
-    </div>
-</div>
-
-
-<footer class="bf-footer" role="contentinfo">
-    <div class="container">
-        <div class="row">
-            <div class="col-md-2">
-                <ul class="nav nav-list">
-                    <li class="nav-header"><a href="/">Home</a></li>
-                    <li class="nav-header"><a href="/community/">Community</a></li>
-                        <li><a href="/community/#events">Events</a></li>
-                        <li><a href="/community/#mailing-lists">Mailing Lists</a></li>
-                        <li><a href="/community/#deployments">Deployments</a></li>
-                        <li><a href="/community/#committers">Commiters</a></li>
-                </ul>
-            </div>
-            <div class="col-md-2">
-                <ul class="nav nav-list">
-                    <li class="nav-header"><a href="https://github.com/apache/incubator-usergrid/" target="_blank">Code</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/stack" target="_blank">Server Stack</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/portal" target="_blank">Admin Portal</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/ugc" target="_blank">ugc command line</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/ios" target="_blank">iOS SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/android" target="_blank">Android SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/html5-javascript" target="_blank">HTML5/JS SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/nodejs" target="_blank">node.js module</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/ruby-on-rails" target="_blank">Ruby on Rails gem</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/ruby" target="_blank">Ruby gem</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/php" target="_blank">PHP SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/java" target="_blank">Java SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/dotnet" target="_blank">.NET / Windows SDK</a></li>
-                </ul>
-            </div>
-            <div class="col-md-2">
-                <ul class="nav nav-list">
-                    <li class="nav-header">Resources</li>
-                    <li><a href="http://github.com/apache/incubator-usergrid" target="_blank">GitHub Code</a></li>
-                    <li><a href="http://usergrid.readthedocs.org/" target="_blank">Docs</a></li>
-                    <li><a href="https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=23&view=planning&selectedIssue=USERGRID-362&epics=visible" target="_blank">JIRA Bug Tracker</a></li>
-                    <li><a href="http://stackoverflow.com/search?q=usergrid" target="_blank">StackOverflow</a></li>
-                    <li><a href="/community/#live">Live Chat</a></li>
-                    <li><a href="https://twitter.com/usergrid" target="_blank">Twitter</a></li>
-                    <li><a href="http://incubator.apache.org/projects/usergrid.html" target="_blank">Podling Listing</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/stack#requirements" target="_blank">Getting Started</a></li>
-                    <li><a href="https://cwiki.apache.org/confluence/display/usergrid/GitHub+Based+Contribution+Workflow" target="_blank">Contribution Guidelines</a></li>
-                </ul>
-            </div>
-            <div class="col-md-2">
-                <ul class="nav nav-list">
-                    <li class="nav-header">Apache</li>
-                    <li><a href="http://www.apache.org/licenses/" target="_blank">License</a></li>
-                    <li><a href="http://www.apache.org/foundation/sponsorship.html" target="_blank">Sponsorship</a></li>
-                    <li><a href="http://www.apache.org/foundation/thanks.html" target="_blank">Thanks</a></li>
-                    <li><a href="http://www.apache.org/security/">Security</a></li>
-                    <li><a href="http://www.apache.org/" target="_blank">Apache Foundation</a></li>
-                </ul>
-            </div>
-            <div class="col-md-4">
-                <a class="twitter-timeline" href="https://twitter.com/search?q=%23usergrid" data-widget-id="401499136807038976"  data-related="usergrid" height="400px" style="overflow:hidden">Tweets about "usergrid"</a>
-                <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
-            </div> 
-        <!--
-            <div class="col-md-4">
-                <div class="input-group form-search">
-                    <input type="text" class="form-control search-query">
-                    <span class="input-group-btn">
-                        <button type="submit" class="btn btn-primary" data-type="last">Search</button>
-                    </span>
-                </div>
-            </div> -->
-        </div> 
-        <div class="row">
-            <div id="copyright">
-                <img src="/img/egg-logo.png" /><br/><br/>
-                <p>Apache Usergrid is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.</p>
-                <p>Copyright © 2013 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
-                Apache and the Apache feather logos are trademarks of The Apache Software Foundation.</p>
-                <p class="credits">Site designed & assembled with love by <a href="https://github.com/ryuneeee">@ryuneeee</a> + <a href="https://github.com/realbeast">@realbeast</a> + <a href="https://twitter.com/timanglade">@timanglade</a>.</p>
-            </div>
-        </div>
-    </div>
-</footer>
-
-<script type="text/javascript" src="/js/head.js"></script>
-<script type="text/javascript">
-    head.js("/js/jquery-1.10.1.min.js", "/js/bootstrap.min.js", "/js/usergrid-site.js");
-</script>
-<script>
-  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-  ga('create', 'UA-45815079-1', 'apache.org');
-  ga('send', 'pageview');
-
-</script>
-
-
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2a55601f/content/docs/events-and-counters/index.html
----------------------------------------------------------------------
diff --git a/content/docs/events-and-counters/index.html b/content/docs/events-and-counters/index.html
deleted file mode 100644
index c56426b..0000000
--- a/content/docs/events-and-counters/index.html
+++ /dev/null
@@ -1,502 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <title>Apache Usergrid (incubating) — Events and counters</title>
-    <meta http-equiv="x-ua-compatible" content="ie=edge" />
-    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
-    <meta name="keywords" content="Apache Usergrid, Usergrid, BaaS, Backend-as-a-Service">
-    <meta name="description" content="An open-source Backend-as-a-Service stack for web & mobile applications, based on RESTful APIs." />
-    <meta property="og:title" content="Apache Usergrid" />
-    <meta property="og:description" content="An open-source Backend-as-a-Service stack for web & mobile applications, based on RESTful APIs." />
-    <!-- Loading Typekit -->
-    <script type="text/javascript" src="//use.typekit.net/ddl7izx.js"></script>
-    <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
-    <!-- Loading Bootstrap -->
-    <link href="/bootstrap/bootstrap.min.css" rel="stylesheet" type='text/css'>
-    <link href="/css/bootflat.css" rel="stylesheet" type='text/css'>
-    <link href="/css/usergrid-site.css" rel="stylesheet" type='text/css'>
-    <link href="https://fonts.googleapis.com/css?family=Open+Sans:200,400,500,300,600,800,700,400italic,600italic,700italic,800italic,300italic" rel="stylesheet" type="text/css">
-    <link href="/css/font-awesome.min.css" rel="stylesheet" type='text/css'>
-
-    
-
-    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
-    <!--[if lt IE 9]>
-      <script src="js/html5shiv.js"></script>
-      <script src="js/respond.min.js"></script>
-    <![endif]-->
-</head>
-<body>
-
-    <header class="navbar navbar-inverse navbar-fixed-top bf-docs-nav secondary" role="banner">
-    <div class="container">
-        <div class="navbar-header">
-            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bf-navbar-collapse">
-                <span class="sr-only">Toggle navigation</span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-            </button>
-        </div>
-        <a href="/" class="navbar-brand">
-                <img id="home-logo" src="/img/apache_usergrid_logo_white_small.png" />
-            </a>
-        <nav class="collapse navbar-collapse bf-navbar-collapse" role="navigation">
-            <ul class="nav navbar-nav navbar-right">
-                <li class=""><a href="/community/"><span class="icns icon-group"></span></a></li>
-                <li><a href="http://usergrid.readthedocs.org/" target="_blank"><span class="icns icon-book"></span></a></li>
-                <li><a href="http://github.com/apache/incubator-usergrid" target="_blank"><span class="icns icon-github-sign"></span></a></li>
-                <!--<li><a href="https://trello.com/b/exQmJIOn/usergrid" target="_blank"><span class="icns icon-trello"></span></a></li>-->
-                <li><a href="https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=23&view=planning&selectedIssue=USERGRID-362&epics=visible" target="_blank"><span class="icns icon-bug"></span></a></li>
-                <li><a href="http://stackoverflow.com/search?q=usergrid" target="_blank"><span class="icns icon-stackexchange"></span></a></li>
-                <li><a href="/community/#live"><span class="icns icon-comments"></span></a></li>
-                <!--<li><a href="https://groups.google.com/forum/#!forum/usergrid" target="_blank"><span class="icns icon-envelope"></span></a></li>-->
-                <li><a href="https://twitter.com/usergrid" target="_blank"><span class="icns icon-twitter"></span></a></li>
-                <li><a href="https://cwiki.apache.org/confluence/display/usergrid/" target="_blank"><span class="icns icon-wiki"></span></a></li>
-                <li><a href="/releases/"><span class="icns icon-releases"></span></a></li>
-            </ul>
-        </nav>
-    </div>
-    </header>
-
-
-
-<div class="container bf-docs-container">    
-    <div class="row">
-        <div class="col-md-3">
-            <div class="bf-sidebar hidden-print" role="complementary">
-                <ul class="nav nav-list">
-                    <li><a href="/docs/getting-up-and-running-locally/">Getting Up &amp; Running Locally</a></li>
-                    <li><a href="/docs/deploy-local/">Deploying to local Tomcat &amp; Cassandra</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/ugc#usergrid-command-line-ugc"><code>ugc</code> — the Command-line Client</a></li>
-
-                    <li class="nav-header"><span>Concepts</span></li>
-                    <li>
-                        <a href="/docs/organizations-admins/">Organizations & Admins</a>
-                        <ul>
-                            <li>
-                                <a href="/docs/applications/">Applications</a>
-                                <ul>
-                                    <li><a href="/docs/roles-and-permissions/">Roles & Permissions</a></li>
-                                    <!--<li><a href="#">Queues</a></li>-->
-                                    <li><a href="/docs/events-and-counters/">Events & Counters</a></li>
-                                    <li><a href="/docs/relationships/">Relationships (Joins)</a></li>
-                                    <li>
-                                        <a href="/docs/collections">Collections</a>
-                                        <ul>
-                                            <li><a href="/docs/query-language/">Query Language</a></li>
-                                            <li><a href="/docs/users-devices/">Users & Devices</a></li>
-                                            <li><a href="/docs/groups/">Groups</a></li>
-                                            <li><a href="/docs/activities/">Activities</a></li>
-                                            <li><a href="/docs/assets/">Assets</a></li>
-                                        </ul>
-                                    </li>
-                                </ul>
-                            </li>
-                        </ul>
-                    </li>
-
-
-                    <li class="nav-header"><span>Usage</span></li>
-                    <!-- <li>REST API — Coming Soon</li> -->
-                    <li><a class="icns-apple" href="https://github.com/apache/incubator-usergrid/tree/master/sdks/ios">iOS SDK</a></li>
-                    <li><a class="icns-android" href="https://github.com/apache/incubator-usergrid/tree/master/sdks/android">Android SDK</a></li>
-                    <li><a class="icns-html5" href="">HTML5 / JavaScript SDK</a></li>
-                    <li><a class="icns-windows" href="https://github.com/apache/incubator-usergrid/tree/master/sdks/dotnet">Windows 8 / Windows Phone / .net SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/nodejs">Node.js module</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/ruby">Ruby gem</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/ruby-on-rails">Ruby on Rails gem</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/php">PHP library</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/tree/master/sdks/java">Java library</a></li>
-
-                    <!--<li class="nav-header"><span>Internals</span></li>
-                    <li>Design & Goals — Coming Soon</li>
-                    <li>Java Architecture — Coming Soon</li>
-                    <li>Cassandra Schema — Coming Soon</li>-->
-
-                    <li class="nav-header"><span>Operations</span></li>
-                    <!--<li>Deploying — Coming Soon</li>-->
-                    <!-- <li>Monitoring — Coming Soon</li> -->
-                    <li><a href="/docs/upgrading/">Upgrading</a></li>
-                    <!-- <li>Security — Coming Soon</li> -->
-
-                    <li class="nav-header"><span>Presentations & Videos</span></li>
-                    <li><a href="/docs/presentations/">Presentations</a></li>
-                    <li><a href="/docs/videos/">Videos</a></li>
-
-                    <li class="nav-header"><span>We need your help!</span></li>
-                    <li><a href="/docs/contribute-code/">How to Contribute Code & Docs</a></li>
-                    <!--
-                    <li><a href="/docs/contribute-docs">How to contribute docs</a></li>
-                    -->
-                </ul>
-            </div>
-        </div>
-
-        <div class="col-md-9 main-article" role="main">
-            <div class="page-article">
-                <div class="page-header">
-                    <h1>Events and counters</h1>
-                    <!-- TODO: reenable this when we sync SVN to GitHub
-                  <small><a target="_blank" href="https://github.com/usergrid/website/blob/master/content/docs/events-and-counters.md">contribute to this article on github</a></small>
-                    -->
-                </div>
-                <div class="toc">
-	<ul>
-<li>
-<a href="#event-properties">Event properties</a><ul>
-<li><a href="#categorizing-events">Categorizing events</a></li>
-</ul>
-</li>
-<li>
-<a href="#counters">Counters</a><ul>
-<li><a href="#user-defined-counters">User-Defined Counters</a></li>
-<li><a href="#counter-hierarchy">Counter hierarchy</a></li>
-<li><a href="#using-counters-in-time-series-queries">Using counters in time series queries</a></li>
-<li><a href="#retrieving-counter-data">Retrieving counter data</a></li>
-</ul>
-</li>
-</ul>
-</div>
-<p>Events are typically used for application logging. For example, they could be used to log error messages that a system administrator might review at a later time. The event mechanism is optimized to handle large numbers of events, so it is an ideal mechanism for logging in your application.</p>
-<p>You can link events to specific users, groups, or custom-defined categories. When created with these links, events offer a powerful tool for running highly targeted, custom reports.</p>
-<p>Events are also the primary way to store custom counter data for analytics. See Counters (below) for further details.</p>
-<h2 id="event-properties">Event properties</h2>
-<p>You can pass various system-defined properties for an event. For example, you can specify a user property, with a uuid as its value. This will link the event to the user and can be used to query against the events queue (see Categorization below). The same is true for the group property. Pass it with a uuid as the value and the event will be linked to the group. To include a uuid of a user or group, add the uuid to the request body, for example:</p>
-<pre><code>POST https://api.usergrid.com/my-org/my-app/events {"timestamp":0, "category" : "advertising", "counters" :  {"ad_clicks" : 5},"user" : "1234891-477d-11e1-b2bd-22005a1c4e22", "group" : "75577d891-347d-2231-b5bd-23400a1c4e22"}</code></pre>
-<p>The response body would look something like this:</p>
-<pre><code>{
- "action": "post",
- "application": "7fb8d891-477d-11e1-b2bd-22000a1c4e22",
- "params": {},
- "path": "/events",
- "uri": "https://api.usergrid.com/22000a1c4e22-7fb8d891-477d-11e1-b2bd/7fb8d891-477d-11e1-b2bd-22000a1c4e22/events",
- "entities": [
-   {
-     "uuid": "ce07ea3c-68b5-11e1-a586-9227e40e3559",
-     "user": "1234891-477d-11e1-b2bd-22005a1c4e22",
-     "group": "75577d891-347d-2231-b5bd-23400a1c4e22",
-     "type": "event",
-     "created": 1331166585282,
-     "modified": 1331166585282,
-     "counters": {
-       "ad_clicks": 5
-     },
-     "metadata": {
-       "path": "/events/ce07ea3c-68b5-11e1-a586-9227e40e3559"
-     },
-     "timestamp": 1331166585282
-   }
- ],
- "timestamp": 1331166585018,
- "duration": 919,
- "organization": "my-org",
- "applicationName": "my-app"
-}</code></pre>
-<p>You can also create application-specific event properties in addition to these predefined properties. The system-defined properties are reserved. You cannot use these names to create other properties for an event entity. In addition the events name is reserved for the events collection — you can’t use it to name another collection.</p>
-<p>The System-defined properties are as follows:</p>
-<table>
-<thead>
-<tr class="header">
-<th align="left">Property</th>
-<th align="left">Type</th>
-<th align="left">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr class="odd">
-<td align="left">uuid</td>
-<td align="left">UUID</td>
-<td align="left">Event’s unique entity ID</td>
-</tr>
-<tr class="even">
-<td align="left">type</td>
-<td align="left">String</td>
-<td align="left">“event”</td>
-</tr>
-<tr class="odd">
-<td align="left">created</td>
-<td align="left">long</td>
-<td align="left">
-<a href="http://en.wikipedia.org/wiki/Unix_time">UNIX timestamp</a> of entity creation</td>
-</tr>
-<tr class="even">
-<td align="left">modified</td>
-<td align="left">long</td>
-<td align="left">
-<a href="http://en.wikipedia.org/wiki/Unix_time">UNIX timestamp</a> of entity modification</td>
-</tr>
-<tr class="odd">
-<td align="left">timestamp</td>
-<td align="left">long</td>
-<td align="left">
-<a href="http://en.wikipedia.org/wiki/Unix_time">UNIX timestamp</a> of application event (mandatory)</td>
-</tr>
-<tr class="even">
-<td align="left">user</td>
-<td align="left">UUID</td>
-<td align="left">UUID of application user that posted the event</td>
-</tr>
-<tr class="odd">
-<td align="left">group</td>
-<td align="left">UUID</td>
-<td align="left">UUID of application group that posted the event</td>
-</tr>
-<tr class="even">
-<td align="left">category</td>
-<td align="left">string</td>
-<td align="left">Category used for organizing similar events</td>
-</tr>
-<tr class="odd">
-<td align="left">counters</td>
-<td align="left">map</td>
-<td align="left">Counter used for tracking number of similar events</td>
-</tr>
-<tr class="even">
-<td align="left">message</td>
-<td align="left">string</td>
-<td align="left">Message describing event</td>
-</tr>
-</tbody>
-</table>
-<h3 id="categorizing-events">Categorizing events</h3>
-<p>As mentioned previously, you can link an event to a user or a group using a standard <a href="/docs/relationships">Relationship</a>. This enables you to categorize and qualify event data for use in tracking and analysis. For example, linking events to users and groups, enables you to track how often people use a feature. Not only can you determine the total number of users that used the feature, but also which groups contain users that made the most use of the feature. Or, you could provide a location with the event, so you could see how often a feature was used by people in San Francisco versus Los Angeles.</p>
-<h2 id="counters">Counters</h2>
-<p>User-defined counters are used in conjunction with events to keep statistics on many aspects of an application. User-defined counters are JSON objects that are added to events when they are posted. The act of posting an event increments the counter. Once created, user-defined counters can be used to get reports.</p>
-<p><strong>Note:</strong> It may take up to 30 seconds for a counter to be updated.</p>
-<h3 id="user-defined-counters">User-Defined Counters</h3>
-<p>With Apache Usergrid, you can define your own counters. Some of the things that you might track with a user-defined counter are:</p>
-<ul>
-<li>How many times people click on the help button in your application.</li>
-<li>How many times your game is played each day.</li>
-<li>How many times your banner ads are clicked each day.</li>
-</ul>
-<p>You can choose any name for a user-defined counter. For example, the counter for the help button might be named “help_button” or “help_button_clicks”.</p>
-<p>To create a user-defined counter, you post to the events collection and specify the name and increment value of the counter in the request body. The increment value is the value that the counter is incremented by for each tracked event. An increment value of 1, means that the counter is increment by 1 for each tracked event. You could also specify a higher increment value, such as 15, which would increment the value by that number, or a negative number, which would decrement the value.  You can also reset the value of the counter, by specifying an increment value of 0.</p>
-<p>When a counter is incremented by an event, there will be a 20-30 second delay between when the event is posted and when the counter is incremented. </p>
-<p>As an example, here’s how to create a user-defined counter named “button_clicks” with an increment value of 1:</p>
-<pre><code>POST https://api.usergrid.com/my-org/my-app/events {"counters" : {"button_clicks" : 1},"timestamp" : "0"}</code></pre>
-<p>The response body would look something like this:</p>
-<pre><code>{
-   "action": "post",
-   "path": "/events",
-   "uri": "http://api.usergrid.com/438a1ca1-cf9b-11e0-bcc1-12313f0204bb/events",
-   "entities": [
-       {
-           "uuid": "39d41c46-d8e4-11e0-bcc1-12313f0204bb",
-           "type": "event",
-           "timestamp": 1315353555546016,
-           "category":"advertising",
-           "counters": {
-               "button_clicks": 1
-           },
-           "created": 1315353555546016,
-           "modified": 1315353555546016,
-           "metadata": {
-           "path": "/events/39d41c46-d8e4-11e0-bcc1-12313f0204bb"
-           }
-       }
-   ],
-   "timestamp": 1315353555537,
-   "duration": 110,
-   "organization": "my-org",
-   "applicationName": "my-app"
-}</code></pre>
-<h3 id="counter-hierarchy">Counter hierarchy</h3>
-<p>Counters are hierarchical in their structure and in the way they are incremented. Each level of the hierarchy is separated by the dot “.” operator. The hierarchical structure can be useful if you want to store or view statistics in a hierarchical way. For example, suppose you want to log errors that your app generates. One way to do this, is to fire an event every time an error occurs, by creating a counter called “errors”. However, you can get more detail by adding additional parameters to the counter. Imagine that you want to track errors in a specific module and function within that module, say module_1, function_1, you could use a counter like this:</p>
-<pre><code>errors.module_1.function_1</code></pre>
-<p>And then for a different function in the same module:</p>
-<pre><code>errors.module_1.function_2</code></pre>
-<p>And then for a different function in a different module:</p>
-<pre><code>errors.module_2.function_3</code></pre>
-<p>If each of the preceding examples were called once, the resulting values would be:</p>
-<pre><code>errors = 3
-errors.module_1 = 2
-errors.module_1.function_1 = 1
-errors.module_1.function_2 = 1
-errors.module_2 = 1
-errors.module_2.function_3 = 1</code></pre>
-<p>This tells you that there were 3 errors in the application, with 2 of those errors in module_1. You can then drill down further to see errors in specific functions.</p>
-<h3 id="using-counters-in-time-series-queries">Using counters in time series queries</h3>
-<p>Knowing the value of a counter is useful. However, you often need to know how the value varies over time. Fortunately, the API provides a method for you to view this data over any time interval or level of granularity.</p>
-<p>For example, let’s say you’re incrementing a counter every time someone launches your application. You might be interested in which days of the week the application sees the most usage. Using the API, you can examine the counter over a set of weeks, with the data split into daily intervals. Using this information, you can see which are your peak days of usage. You can also view usage across a single day, so you can see if your application is used more in the mornings or the evenings. For business reporting, you may be more interested in monthly reporting.</p>
-<p>Note that the system is able to provide you with the report data as you need it. The data is maintained in real-time so it can be viewed instantly.</p>
-<h3 id="retrieving-counter-data">Retrieving counter data</h3>
-<p>To retrieve counter data, you issue a GET request to the /counters endpoint. This is a special, built-in collection that gives you access to all the counters currently in the system. The API also provides a number of parameters that you can use to search for counter data, as follows:</p>
-<table>
-<thead>
-<tr class="header">
-<th align="left">Parameter</th>
-<th align="left">Type</th>
-<th align="left">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr class="odd">
-<td align="left">start_time</td>
-<td align="left">An <a href="http://en.wikipedia.org/wiki/Unix_time">Epoch(Unix)</a> timestamp in milliseconds</td>
-<td align="left">The beginning of the time period to search</td>
-</tr>
-<tr class="even">
-<td align="left">end_time</td>
-<td align="left">An <a href="http://en.wikipedia.org/wiki/Unix_time">Epoch(Unix)</a> timestamp in milliseconds</td>
-<td align="left">The end of the time period to search</td>
-</tr>
-<tr class="odd">
-<td align="left">counter</td>
-<td align="left">string</td>
-<td align="left">The name of a specific counter to search. You can specify more than one counter in a query (for example, counter=counter1&amp;counter=counter2…)</td>
-</tr>
-<tr class="even">
-<td align="left">resolution</td>
-<td align="left">string</td>
-<td align="left">The interval at which counters are displayed. For example, if the interval is day, and the start time and end time values span 4 days, you will get aggregate counts for each of the 4 days. Possible values are all, minute, five_minutes, half_hour, hour, six_day, day, week, and month.</td>
-</tr>
-</tbody>
-</table>
-<p>For example, to retrieve a time range of values, with a granularity of “day”, for a counter called “button_clicks”, the GET request would look like this:</p>
-<pre><code>GET /my-org/my-app/counters?start_time=1315119600000&amp;end_time=1315724400000&amp;resolution=day&amp;counter=button_clicks</code></pre>
-<p>The response body would look something like this:</p>
-<pre><code>{
- action: "get",
-    uri: "http://api.usergrid.com/438a1ca1-cf9b-11e0-bcc1-12313f0204bb/counters",
-    timestamp: 1315354369272,
-    duration: 28,
-    counters: [
-        {
-            name: "button_clicks",
-            values: [
-                {
-                    value: 2
-                    timestamp: 1315180800000
-                },
-                {
-                    value: 1
-                    timestamp: 1315267200000
-                },
-                {
-                    value: 1
-                    timestamp: 1315353600000
-                }
-            ]
-        }
-    ]
-}</code></pre>
-            </div>
-        </div>
-    </div>
-    <div class="row">
-        <div class="col-md-3"></div>
-        <div class="col-md-9">
-            <div class="github-callout">
-                <strong>Questions?</strong> Please do <a href="/community">ask on the mailing-lists</a>!<br/>
-                <!--
-                <strong>Found an error?</strong> We’d greatly appreciate a pull request about <a target="_blank" href="https://github.com/usergrid/website/blob/master/content/docs/events-and-counters.md">this article on github</a>.</div> 
-                -->
-            </div>
-        </div>
-    </div>
-</div>
-
-
-<footer class="bf-footer" role="contentinfo">
-    <div class="container">
-        <div class="row">
-            <div class="col-md-2">
-                <ul class="nav nav-list">
-                    <li class="nav-header"><a href="/">Home</a></li>
-                    <li class="nav-header"><a href="/community/">Community</a></li>
-                        <li><a href="/community/#events">Events</a></li>
-                        <li><a href="/community/#mailing-lists">Mailing Lists</a></li>
-                        <li><a href="/community/#deployments">Deployments</a></li>
-                        <li><a href="/community/#committers">Commiters</a></li>
-                </ul>
-            </div>
-            <div class="col-md-2">
-                <ul class="nav nav-list">
-                    <li class="nav-header"><a href="https://github.com/apache/incubator-usergrid/" target="_blank">Code</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/stack" target="_blank">Server Stack</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/portal" target="_blank">Admin Portal</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/ugc" target="_blank">ugc command line</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/ios" target="_blank">iOS SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/android" target="_blank">Android SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/html5-javascript" target="_blank">HTML5/JS SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/nodejs" target="_blank">node.js module</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/ruby-on-rails" target="_blank">Ruby on Rails gem</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/ruby" target="_blank">Ruby gem</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/php" target="_blank">PHP SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/java" target="_blank">Java SDK</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/sdks/dotnet" target="_blank">.NET / Windows SDK</a></li>
-                </ul>
-            </div>
-            <div class="col-md-2">
-                <ul class="nav nav-list">
-                    <li class="nav-header">Resources</li>
-                    <li><a href="http://github.com/apache/incubator-usergrid" target="_blank">GitHub Code</a></li>
-                    <li><a href="http://usergrid.readthedocs.org/" target="_blank">Docs</a></li>
-                    <li><a href="https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=23&view=planning&selectedIssue=USERGRID-362&epics=visible" target="_blank">JIRA Bug Tracker</a></li>
-                    <li><a href="http://stackoverflow.com/search?q=usergrid" target="_blank">StackOverflow</a></li>
-                    <li><a href="/community/#live">Live Chat</a></li>
-                    <li><a href="https://twitter.com/usergrid" target="_blank">Twitter</a></li>
-                    <li><a href="http://incubator.apache.org/projects/usergrid.html" target="_blank">Podling Listing</a></li>
-                    <li><a href="https://github.com/apache/incubator-usergrid/blob/master/stack#requirements" target="_blank">Getting Started</a></li>
-                    <li><a href="https://cwiki.apache.org/confluence/display/usergrid/GitHub+Based+Contribution+Workflow" target="_blank">Contribution Guidelines</a></li>
-                </ul>
-            </div>
-            <div class="col-md-2">
-                <ul class="nav nav-list">
-                    <li class="nav-header">Apache</li>
-                    <li><a href="http://www.apache.org/licenses/" target="_blank">License</a></li>
-                    <li><a href="http://www.apache.org/foundation/sponsorship.html" target="_blank">Sponsorship</a></li>
-                    <li><a href="http://www.apache.org/foundation/thanks.html" target="_blank">Thanks</a></li>
-                    <li><a href="http://www.apache.org/security/">Security</a></li>
-                    <li><a href="http://www.apache.org/" target="_blank">Apache Foundation</a></li>
-                </ul>
-            </div>
-            <div class="col-md-4">
-                <a class="twitter-timeline" href="https://twitter.com/search?q=%23usergrid" data-widget-id="401499136807038976"  data-related="usergrid" height="400px" style="overflow:hidden">Tweets about "usergrid"</a>
-                <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
-            </div> 
-        <!--
-            <div class="col-md-4">
-                <div class="input-group form-search">
-                    <input type="text" class="form-control search-query">
-                    <span class="input-group-btn">
-                        <button type="submit" class="btn btn-primary" data-type="last">Search</button>
-                    </span>
-                </div>
-            </div> -->
-        </div> 
-        <div class="row">
-            <div id="copyright">
-                <img src="/img/egg-logo.png" /><br/><br/>
-                <p>Apache Usergrid is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.</p>
-                <p>Copyright © 2013 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
-                Apache and the Apache feather logos are trademarks of The Apache Software Foundation.</p>
-                <p class="credits">Site designed & assembled with love by <a href="https://github.com/ryuneeee">@ryuneeee</a> + <a href="https://github.com/realbeast">@realbeast</a> + <a href="https://twitter.com/timanglade">@timanglade</a>.</p>
-            </div>
-        </div>
-    </div>
-</footer>
-
-<script type="text/javascript" src="/js/head.js"></script>
-<script type="text/javascript">
-    head.js("/js/jquery-1.10.1.min.js", "/js/bootstrap.min.js", "/js/usergrid-site.js");
-</script>
-<script>
-  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-  ga('create', 'UA-45815079-1', 'apache.org');
-  ga('send', 'pageview');
-
-</script>
-
-
-
-</body>
-</html>


Mime
View raw message