Changes between Version 52 and Version 53 of Ticket #395

12/17/2014 10:31:55 PM (6 years ago)


  • Ticket #395 – Description

    v52 v53  
    99If storing the incoming data fails an error status code of 500 should be returned to the client. If the database processing fails however the transaction should be rolled back but 200 OK should be returned to the client instead. This is to avoid re-transmission of the data, the error should be logged on the server however. 
     11If the incoming data is invalid an error status code of 400 will be returned to the client and the data will not be logged. Possible reasons could include: 
     13 - Wrong content type (should be "application/json") 
     14 - Invalid JSON in request body. 
     15 - Data in request body is missing required fields / fields are not of the appropriate data type. 
    1117Aggregation approach is complicated by the fact that clients will submit data that was collected over different time intervals. We want to use geometrical mean for now, but this is merely a placeholder for a better approach. Let's say we have stored in the database (for a particular filter and domain): `numclicks = 7`, `timestamp = 123`. We receive `numclicks = 2`, `timestamp = 128`. So the timestamp difference is 5. We update the record: `numclicks = 7 ^ (1 - 5 / interval) * 2 ^ (5 / interval)` and `timestamp = 128`. Here `interval` is a constant that will determine how fast old values expire, it probably makes sense to set it equal to the push interval on the client (meaning e.g. 1 week).