{"id":24698664,"url":"https://github.com/faradayio/billing","last_synced_at":"2026-05-16T18:10:42.360Z","repository":{"id":1200099,"uuid":"1107955","full_name":"faradayio/billing","owner":"faradayio","description":"Brighter Planet billing subsystem","archived":false,"fork":false,"pushed_at":"2011-09-23T15:10:44.000Z","size":224,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-01T02:43:09.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/faradayio.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-11-24T03:17:34.000Z","updated_at":"2018-04-13T16:11:55.000Z","dependencies_parsed_at":"2022-08-16T12:35:06.560Z","dependency_job_id":null,"html_url":"https://github.com/faradayio/billing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/faradayio/billing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fbilling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fbilling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fbilling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fbilling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faradayio","download_url":"https://codeload.github.com/faradayio/billing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fbilling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33113536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-27T04:29:42.295Z","updated_at":"2026-05-16T18:10:42.345Z","avatar_url":"https://github.com/faradayio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Installation\n\n## Gemfile\n\nGem is not in rubygems.org\n\n    gem 'brighter_planet_billing', :git =\u003e 'git://github.com/brighterplanet/billing.git'\n\n# Usage\n\n## Setup\n\nDefine mongodb connection settings\n\n    BrighterPlanet.billing.config.mongo_host='billinghost.com'\n    BrighterPlanet.billing.config.mongo_arbiter_host='abattoir.billinghost.com'\n    BrighterPlanet.billing.config.mongo_username='user'\n    BrighterPlanet.billing.config.mongo_password='password'\n    BrighterPlanet.billing.config.mongo_database='db'\n\nOptionally, in a rails app, create the CacheEntry table for [insert_reason]\n\n    BrighterPlanet.billing.setup\n\n## Billing stats\n\n### Total number of CM1 queries\n\n    BrighterPlanet.billing.cm1.queries.count\n\n### CM1 result statistics\n\n    flight_sample = BrighterPlanet.billing.cm1.queries.sample(:selector =\u003e {:emitter =\u003e 'Flight', :key =\u003e 'ABC123'})\n    stats = flight_sample.stats('impact.carbon', :mean, :sd)\n\n### CM1 usage statistics for a key\n\n    usage = BrighterPlanet.billing.cm1.queries.\n      usage(:start_at =\u003e Time.parse('2011-04-01'), :end_at =\u003e Time.parse('2011-05-01'),\n            :period =\u003e 5.days, :selector =\u003e { :key =\u003e 'ABC123' })\n    puts usage.to_a.inspect\n\n## Billing operations\n\n### Bill a certified CM1 query\n\n    BrighterPlanet.billing.cm1.bill do |query|\n      query.certified = true\n      query.key = 'ABC123'\n      query.timeframe = Timeframe.this_year\n      query.input = { :my =\u003e 'params' }\n      query.url = 'http://query.bp.com/automobiles.json'\n      query.emitter = 'Automobile'\n      query.remote_ip = '127.0.0.1'\n      query.referer = 'http://example.com/quux'\n      query.impact = { 'carbon' =\u003e 12345 }\n\n      execution_id = query.execution_id\n    end\n    \n    puts \"Executed query with #{execution_id}\"\n\n# Mongo stats command\n\nmon-get-stats PageViewCount -n \"MyService\" -s \"Sum,Maximum,Minimum,Average,SampleCount\" --start-time 2011-03-14T12:00:00.000Z --end-time 2011-03-14T12:01:00.000Z --headers\nas found on\nhttp://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/\n(http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/publishingMetrics.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fbilling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaradayio%2Fbilling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fbilling/lists"}