Coder Social home page Coder Social logo

pubgraphite's Introduction

PUBGraphite

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.

Running the script

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.

Example metrics

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

Running the tests

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.

pubgraphite's People

Contributors

jgshaw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.