This project uses the RUBG gem to query the PUBG API and convert its results into graphite metrics. It will then send the metrics to a graphite server using TCP. The script loops forever, querying the API for new games for all of the players specified every 2 minutes.
ruby lib/run.rb <<YOUR API KEY>> <<GRAPHITE IP>> <<GRAPHITE PORT>> <<SHARD>> <<PLAYER NAMES>>
The shard is the region you wish to query, please check the PUBG api for a list of available regions.
The player names should be seperated by commas with no spaces, e.g. shroud,wadu,...
. These names are case sensitive.
PUBG.shroud.matches.assists 0 1524544931
PUBG.shroud.matches.boosts 0 1524544931
PUBG.shroud.matches.damage_dealt 500 1524544931
PUBG.shroud.matches.dbnos 3 1524544931
PUBG.shroud.matches.headshot_kills 2 1524544931
PUBG.shroud.matches.heals 0 1524544931
PUBG.shroud.matches.kills 5 1524544931
PUBG.shroud.matches.longest_kill 33 1524544931
PUBG.shroud.matches.number_of_teams 49 1524544931
PUBG.shroud.matches.rank 40 1524544931
PUBG.shroud.matches.revives 0 1524544931
PUBG.shroud.matches.ride_distance 0 1524544931
PUBG.shroud.matches.road_kills 0 1524544931
PUBG.shroud.matches.time_survived 159 1524544931
PUBG.shroud.matches.vehicle_destroys 0 1524544931
PUBG.shroud.matches.walk_distance 89.03397 1524544931
The tests are written using Rspec, and use VCR to record and save the HTTP interactions between the RUBG gem and the PUBG API. The cassettes are located in spec/cassettes
. If new recordings are required then delete the files in this folder, and update the values expected in the tests for all of the metrics. When creating new cassettes you will need to set an environment variable PUBG_API_KEY
containing a valid API key, this key will not be stored in the cassettes.