token-counter

command
v0.0.0-...-97238d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

README

Overview

Token-counter is a program that polls github to see how much of a token's ratelimit has been used.

Github doesn't report how many requests you've used, and instead reports how many request you have left before the rate-limit resets. In order to do that, we poll more and more aggressively as we get near to the reset time. Once the reset happens, we compute the difference between Limit and Remaining giving us how much we've used in the last hour.

Deploying

token-counter is fairly easy to deploy, and can keep track of multiple keys at the same time. The result will be pushed to an InfluxDB.

Make a github-tokens secret with each of your tokens in there:

kubectl create secret generic github-tokens --from-file=token1=token1 ...

Change deployment.yaml to have --token=token1 for each of your token. Also make sure the influxdb is properly configured.

Deploy the token-counter:

kubectl apply -f deployment.yaml

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL