Skip to content

selvakn/GCMTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android app and a script to test the latency of Google Cloud Messaging

Steps to Run
------------

1) Change API_KEY, mysql connection url in server/server.rb
2) cd server && bundle install && bundle exec ruby server.rb
3) Change SENDER_ID in GCMIntentService to your google project id
4) Change STATISTICS_ENDPOINT in GCMIntentService to your IP where the ruby script is running (step 1)
5) Deploy the android app to any number of devices / emulators
6) execute "watch -n 10 'curl -s http://localhost:4567/push'" <-- Pushed a message every 10 secs

Queries to get stats:
---------------------

1) Max latencies
select post_time, received_time, TIMESTAMPDIFF(SECOND, post_time, received_time) as latency from stats where received_time IS NOT NULL order by latency desc limit 5;

Sample Result:
+---------------------+---------------------+---------+
| post_time           | received_time       | latency |
+---------------------+---------------------+---------+
| 2012-12-16 23:32:13 | 2012-12-16 23:40:50 |     517 |
| 2012-12-18 09:39:28 | 2012-12-18 09:40:51 |      83 |
| 2012-12-18 15:02:49 | 2012-12-18 15:03:48 |      59 |
| 2012-12-18 15:02:59 | 2012-12-18 15:03:51 |      52 |
| 2012-12-18 15:03:10 | 2012-12-18 15:03:54 |      44 |
+---------------------+---------------------+---------+


2) Percentage of notifications received across time of the day
select HOUR(post_time) as posted_hour, (count(received_time)/count(*))*100 as percentage_of_messages_received from stats group by posted_hour;

+-------------+---------------------------------+
| posted_hour | percentage_of_messages_received |
+-------------+---------------------------------+
|           9 |                         25.9804 |
|          10 |                          6.2315 |
|          11 |                          5.9172 |
|          12 |                          4.0059 |
|          13 |                          3.2397 |
|          14 |                          3.1065 |
|          15 |                          7.4074 |
|          16 |                          6.5828 |
|          17 |                          5.0766 |
|          18 |                          3.3175 |
|          19 |                         20.2586 |
|          20 |                         11.5741 |
|          21 |                          0.7813 |
|          23 |                         18.0952 |
+-------------+---------------------------------+

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published