HubSpot/BuckyClient is a CoffeeScript project with 1.7k stars. Collect performance data from the client
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Bucky is a client and server for sending performance data from the client into statsd+graphite, OpenTSDB, or any
other stats aggregator of your choice.
It can automatically measure how long your pages take to load, how long AJAX requests take and how long
various functions take to run. Most importantly, it's taking the measurements on actual page loads,
so the data has the potential to be much more valuable than in vitro measurements.
If you already use statsd or OpenTSDB, you can get started in just a few minutes. If you're not
collecting stats, you should start!
What gets measured gets managed.
Server
You can play with Bucky just using the client, but if you'd like to start collecting data, see the
Server Instructions.
Setup
From The Client
Include bucky.js on your page, the only required config can be done right in the script tag:
That config will automatically log the performance of your page and all the requests you make to a server running at
/bucky. It will automatically decide the right key name based on the url of the page. If you'd like, you can also specify it manually:
host: Where we can reach your Bucky server, including the
APP_ROOT.
The Bucky server has a very liberal CORS config, so we should be able to connect to it even if
it's on a different domain, but hosting it on the same domain and port will save you some preflight requests.
active: Should Bucky actually send data? Use this to disable Bucky during local dev for example.
sample: What fraction of clients should actually send data? Use to subsample your clients if you have
too much data coming in.
Take a look at the source for a
full list of options.
Sending Page Performance
Modern browsers log a bunch of page performance data, bucky includes a method for writing all of this in
one go. It won't do anything on browsers which don't support the performance.timing api. Call it whenever,
it will bind an event if the data isn't ready yet.
Setting data-bucky-page triggers this automatically.
The two most relevant stats provided are responseEnd which is the amount of time it took for the
original page to be loaded and domInteractive which is the amount of time before the page has
finished loaded and can be interacted with by the user.
As a reminder: this data is browser specific, so it will likely skew lower than what users on
old browsers see.
If you're using Backbone, it might be a good idea to send your data based on route:
Backbone.history.on 'route', (router, route) ->
# Will only send on the initial page load:
Bucky.sendPagePerformance("some.location.page.#{ route }")
A description of what each datapoint represents is included in the spec.
Sending AJAX Request Time
Bucky can automatically log all ajax requests made by hooking into XMLHttpRequest and doing some transformations
on the url to try and create a graphite key from it. Enable it as early in your app's load as is possible:
Bucky.requests.monitor('my.project.requests')
Setting data-bucky-requests calls this automatically.
The data collected will look something like this for a GET request to
api.hubapi.com/automation/v2/workflows:
You can then call watch.mark('key') to send the time since the stopwatch started, or
watch.split('key') to send the time since the last split.
Sending Points
If you want to send absolute values (rare from the client), you can use send directly.
The one use we've had for this is sending +new Date from every client to get an idea
of how skewed their clocks are.
Bucky.send 'my.awesome.datapoint', 2432.43434
Your Stats
You can find your stats in the stats and stats.timing folders in graphite, or as written in OpenTSDB.
Send Frequency
Bucky will send your data in bulk from the client either five seconds after the last datapoint is added, or thirty seconds after
the last send, whichever comes first. If you log multiple datapoints within this send frequency, the points will
be averaged (and the appropriate frequency information will be sent to statsd) (with the exception of counters, they
are incremented). This means that the max and min numbers you get from statsd actually represent the max and min
5-30 second bucket. Note that this is per-client, not for the entire bucky process (it's generally only important
on the server where you might be pushing out many points with the same key).
Bucky Object
The Bucky object provides a couple extra properties you can access:
Bucky.history: The history of all datapoints ever sent.
Bucky.active: Is Bucky sending data? This can change if you change the active or sample settings.
Bucky.flush(): Send the Bucky queue immediately
Bucky.timer.now(): A clock based on the most precise time available (not guarenteed to be from the epoch)
URL -> Key Transformation
request.monitor attempts to automatically transform your urls into keys. It does a bunch of transformations
with the goal of removing anything which will vary per-request, so you end up with stats per-endpoint. These
tranformations include:
Stripping GUIDS, IDs, SHA1s, MD5s
Stripping email addresses
Stripping domains
If you find these tranformations too invasive, or not invasive enough, you can modify them.
// You can diable tranforms with `.disable`
Bucky.requests.transforms.disable('guid');
// You can enable transforms with `.enable`
Bucky.requests.tranforms.enable('guid');
// `.enable` can also be used to add a new tranform:
Bucky.requests.transforms.enable('my-ids', /[0-9]{4}-[0-9]{12}/g)
// The third argument defines what the match is replaced with (rather than just eliminating it):
Bucky.requests.transforms.enable('campaign', /campaigns\/\w{15}/ig, '/campaigns')
// You can also just provide a function which takes in the url, and returns it modified:
Bucky.request.transforms.enable('soup', function(url){ return url.split('').reverse().join(''); })
Enabled tests will be added to the beginning of the enabled list, meaning they will be executed before
any other tranform. Edit the Bucky.requests.tranforms.enabled array if you need more specific control.
The order of the transforms is very important. If you, for example, were to run the id transform before
the guid one, the guid transform wouldn't match any guid which began with a number (as the number would
have already been stripped out, making the guid the wrong length).
When you first enable request monitoring, it's a good idea to keep an eye on the Bucky logs to get
an idea of what sort of data points are being created.
The most recent commit recorded on HubSpot/BuckyClient was 10.3 years ago, based on the GitHub push timestamp. The repository has 94 forks — one of the better signals of community interest.
How many stars does HubSpot/BuckyClient have?
HubSpot/BuckyClient has 1.7k GitHub stars — refresh the page for the live number, or check github.com/HubSpot/BuckyClient. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is HubSpot/BuckyClient open source?
Yes — HubSpot/BuckyClient ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/HubSpot/BuckyClient.
What is HubSpot/BuckyClient?
HubSpot/BuckyClient (HubSpot/BuckyClient) is a CoffeeScript project on GitHub. From the project's own README: Collect performance data from the client
What language is HubSpot/BuckyClient written in?
HubSpot/BuckyClient is written primarily in CoffeeScript. GitHub's language field is based on the largest share of bytes in the default branch.
What license does HubSpot/BuckyClient use?
HubSpot/BuckyClient is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about HubSpot/BuckyClient?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/HubSpot/BuckyClient is the definitive source.
Read full README in the tab above.
Still deciding about BuckyClient?
One click hands the question to an AI along with this page — see what it says about BuckyClient.