Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:21:34 +0000.
Sender:Senthil Muniswamy
.
Date:Thursday, 27 August 2015 17:14:32 UTC+1.
Hi Martin,
Activity by key search is not working as expected.
Tyk received 2 requests around 24/8/2015 22:30 PM EDT which are logged with timestamp of 25/8/2015 02:30 UTC.
Following search should have returned those 2 requests but it did not. Even though the days are included in the result, seems like the search is based on tyk_analytics.timestamp by not including either days.
api/activity/keys/09bf2428-b950-4c93-a275-5d9e4bf68da6/24/8/2015/25/8/2015?p=-1&res=day
{
“data”: [
{
“id”: {
“day”: 24,
“month”: 8,
“year”: 2015,
“hour”: 0,
“code”: 200,
“path”: “”,
“key”: “”
},
“hits”: 0,
“success”: 0,
“error”: 0,
“last_hit”: “0001-01-01T00:00:00Z”,
“request_time”: 0
},
{
“id”: {
“day”: 25,
“month”: 8,
“year”: 2015,
“hour”: 0,
“code”: 200,
“path”: “”,
“key”: “”
},
“hits”: 0,
“success”: 0,
“error”: 0,
“last_hit”: “0001-01-01T00:00:00Z”,
“request_time”: 0
}
],
“pages”: 0
}
So, I had to expand the search range by a day on either side.
api/activity/keys/09bf2428-b950-4c93-a275-5d9e4bf68da6/24/8/2015/26/8/2015?p=-1&res=day
{
“data”: [
{
“id”: {
“day”: 24,
“month”: 8,
“year”: 2015,
“hour”: 0,
“code”: 0,
“path”: “”,
“key”: “”
},
“hits”: 2,
“success”: 0,
“error”: 2,
“last_hit”: “2015-08-24T22:36:41.987-04:00”,
“request_time”: 0
},
{
“id”: {
“day”: 25,
“month”: 8,
“year”: 2015,
“hour”: 0,
“code”: 200,
“path”: “”,
“key”: “”
},
“hits”: 0,
“success”: 0,
“error”: 0,
“last_hit”: “0001-01-01T00:00:00Z”,
“request_time”: 0
},
{
“id”: {
“day”: 26,
“month”: 8,
“year”: 2015,
“hour”: 0,
“code”: 200,
“path”: “”,
“key”: “”
},
“hits”: 0,
“success”: 0,
“error”: 0,
“last_hit”: “0001-01-01T00:00:00Z”,
“request_time”: 0
}
],
“pages”: 0
}
Seem like, the search is based on UTC time but the result is based requests timestamp on server timezone.
Thanks,
Senthil